aws.s3.BucketRequestPaymentConfiguration
Explore with Pulumi AI
Provides an S3 bucket request payment configuration resource. For more information, see Requester Pays Buckets.
NOTE: Destroying an
aws.s3.BucketRequestPaymentConfiguration
resource resets the bucket’spayer
to the S3 default: the bucket owner.
This resource cannot be used with S3 directory buckets.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketRequestPaymentConfiguration("example", {
bucket: exampleAwsS3Bucket.id,
payer: "Requester",
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketRequestPaymentConfiguration("example",
bucket=example_aws_s3_bucket["id"],
payer="Requester")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := s3.NewBucketRequestPaymentConfiguration(ctx, "example", &s3.BucketRequestPaymentConfigurationArgs{
Bucket: pulumi.Any(exampleAwsS3Bucket.Id),
Payer: pulumi.String("Requester"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.S3.BucketRequestPaymentConfiguration("example", new()
{
Bucket = exampleAwsS3Bucket.Id,
Payer = "Requester",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketRequestPaymentConfiguration;
import com.pulumi.aws.s3.BucketRequestPaymentConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new BucketRequestPaymentConfiguration("example", BucketRequestPaymentConfigurationArgs.builder()
.bucket(exampleAwsS3Bucket.id())
.payer("Requester")
.build());
}
}
resources:
example:
type: aws:s3:BucketRequestPaymentConfiguration
properties:
bucket: ${exampleAwsS3Bucket.id}
payer: Requester
Create BucketRequestPaymentConfiguration Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BucketRequestPaymentConfiguration(name: string, args: BucketRequestPaymentConfigurationArgs, opts?: CustomResourceOptions);
@overload
def BucketRequestPaymentConfiguration(resource_name: str,
args: BucketRequestPaymentConfigurationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BucketRequestPaymentConfiguration(resource_name: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
payer: Optional[str] = None,
expected_bucket_owner: Optional[str] = None,
region: Optional[str] = None)
func NewBucketRequestPaymentConfiguration(ctx *Context, name string, args BucketRequestPaymentConfigurationArgs, opts ...ResourceOption) (*BucketRequestPaymentConfiguration, error)
public BucketRequestPaymentConfiguration(string name, BucketRequestPaymentConfigurationArgs args, CustomResourceOptions? opts = null)
public BucketRequestPaymentConfiguration(String name, BucketRequestPaymentConfigurationArgs args)
public BucketRequestPaymentConfiguration(String name, BucketRequestPaymentConfigurationArgs args, CustomResourceOptions options)
type: aws:s3:BucketRequestPaymentConfiguration
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args BucketRequestPaymentConfigurationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args BucketRequestPaymentConfigurationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args BucketRequestPaymentConfigurationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BucketRequestPaymentConfigurationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BucketRequestPaymentConfigurationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var bucketRequestPaymentConfigurationResource = new Aws.S3.BucketRequestPaymentConfiguration("bucketRequestPaymentConfigurationResource", new()
{
Bucket = "string",
Payer = "string",
ExpectedBucketOwner = "string",
Region = "string",
});
example, err := s3.NewBucketRequestPaymentConfiguration(ctx, "bucketRequestPaymentConfigurationResource", &s3.BucketRequestPaymentConfigurationArgs{
Bucket: pulumi.String("string"),
Payer: pulumi.String("string"),
ExpectedBucketOwner: pulumi.String("string"),
Region: pulumi.String("string"),
})
var bucketRequestPaymentConfigurationResource = new BucketRequestPaymentConfiguration("bucketRequestPaymentConfigurationResource", BucketRequestPaymentConfigurationArgs.builder()
.bucket("string")
.payer("string")
.expectedBucketOwner("string")
.region("string")
.build());
bucket_request_payment_configuration_resource = aws.s3.BucketRequestPaymentConfiguration("bucketRequestPaymentConfigurationResource",
bucket="string",
payer="string",
expected_bucket_owner="string",
region="string")
const bucketRequestPaymentConfigurationResource = new aws.s3.BucketRequestPaymentConfiguration("bucketRequestPaymentConfigurationResource", {
bucket: "string",
payer: "string",
expectedBucketOwner: "string",
region: "string",
});
type: aws:s3:BucketRequestPaymentConfiguration
properties:
bucket: string
expectedBucketOwner: string
payer: string
region: string
BucketRequestPaymentConfiguration Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The BucketRequestPaymentConfiguration resource accepts the following input properties:
- Bucket string
- Name of the bucket.
- Payer string
- Specifies who pays for the download and request fees. Valid values:
BucketOwner
,Requester
. - Expected
Bucket stringOwner - Account ID of the expected bucket owner.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Bucket string
- Name of the bucket.
- Payer string
- Specifies who pays for the download and request fees. Valid values:
BucketOwner
,Requester
. - Expected
Bucket stringOwner - Account ID of the expected bucket owner.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket String
- Name of the bucket.
- payer String
- Specifies who pays for the download and request fees. Valid values:
BucketOwner
,Requester
. - expected
Bucket StringOwner - Account ID of the expected bucket owner.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket string
- Name of the bucket.
- payer string
- Specifies who pays for the download and request fees. Valid values:
BucketOwner
,Requester
. - expected
Bucket stringOwner - Account ID of the expected bucket owner.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket str
- Name of the bucket.
- payer str
- Specifies who pays for the download and request fees. Valid values:
BucketOwner
,Requester
. - expected_
bucket_ strowner - Account ID of the expected bucket owner.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket String
- Name of the bucket.
- payer String
- Specifies who pays for the download and request fees. Valid values:
BucketOwner
,Requester
. - expected
Bucket StringOwner - Account ID of the expected bucket owner.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
Outputs
All input properties are implicitly available as output properties. Additionally, the BucketRequestPaymentConfiguration resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing BucketRequestPaymentConfiguration Resource
Get an existing BucketRequestPaymentConfiguration resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: BucketRequestPaymentConfigurationState, opts?: CustomResourceOptions): BucketRequestPaymentConfiguration
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
expected_bucket_owner: Optional[str] = None,
payer: Optional[str] = None,
region: Optional[str] = None) -> BucketRequestPaymentConfiguration
func GetBucketRequestPaymentConfiguration(ctx *Context, name string, id IDInput, state *BucketRequestPaymentConfigurationState, opts ...ResourceOption) (*BucketRequestPaymentConfiguration, error)
public static BucketRequestPaymentConfiguration Get(string name, Input<string> id, BucketRequestPaymentConfigurationState? state, CustomResourceOptions? opts = null)
public static BucketRequestPaymentConfiguration get(String name, Output<String> id, BucketRequestPaymentConfigurationState state, CustomResourceOptions options)
resources: _: type: aws:s3:BucketRequestPaymentConfiguration get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Bucket string
- Name of the bucket.
- Expected
Bucket stringOwner - Account ID of the expected bucket owner.
- Payer string
- Specifies who pays for the download and request fees. Valid values:
BucketOwner
,Requester
. - Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Bucket string
- Name of the bucket.
- Expected
Bucket stringOwner - Account ID of the expected bucket owner.
- Payer string
- Specifies who pays for the download and request fees. Valid values:
BucketOwner
,Requester
. - Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket String
- Name of the bucket.
- expected
Bucket StringOwner - Account ID of the expected bucket owner.
- payer String
- Specifies who pays for the download and request fees. Valid values:
BucketOwner
,Requester
. - region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket string
- Name of the bucket.
- expected
Bucket stringOwner - Account ID of the expected bucket owner.
- payer string
- Specifies who pays for the download and request fees. Valid values:
BucketOwner
,Requester
. - region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket str
- Name of the bucket.
- expected_
bucket_ strowner - Account ID of the expected bucket owner.
- payer str
- Specifies who pays for the download and request fees. Valid values:
BucketOwner
,Requester
. - region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket String
- Name of the bucket.
- expected
Bucket StringOwner - Account ID of the expected bucket owner.
- payer String
- Specifies who pays for the download and request fees. Valid values:
BucketOwner
,Requester
. - region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
Import
If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, import using the bucket
and expected_bucket_owner
separated by a comma (,
):
Using pulumi import
to import S3 bucket request payment configuration using the bucket
or using the bucket
and expected_bucket_owner
separated by a comma (,
). For example:
If the owner (account ID) of the source bucket is the same account used to configure the AWS Provider, import using the bucket
:
$ pulumi import aws:s3/bucketRequestPaymentConfiguration:BucketRequestPaymentConfiguration example bucket-name
If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, import using the bucket
and expected_bucket_owner
separated by a comma (,
):
$ pulumi import aws:s3/bucketRequestPaymentConfiguration:BucketRequestPaymentConfiguration example bucket-name,123456789012
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.