Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::S3::Bucket - RequesterPays #123

Open
bjorg opened this issue Aug 12, 2019 · 5 comments
Open

AWS::S3::Bucket - RequesterPays #123

bjorg opened this issue Aug 12, 2019 · 5 comments
Labels
storage S3, EFS, FSx, S3 Glacier, Storage Gateway, AWS Backup

Comments

@bjorg
Copy link

bjorg commented Aug 12, 2019

1. Title

AWS::S3::Bucket-RequesterPays

2. Scope of request

Enable CloudFormation to set the Requester Pays property on an S3 bucket. Currently, this property can only be set by the AWS console and AWS SDK.

3. Expected behavior

MyBucket:
  Type: AWS::S3::Bucket
  Properties:
    RequestPayment:
      Payer: Requester

5. Helpful Links to speed up research and evaluation

6. Category

  1. Storage (S3)
@TheDanBlanco TheDanBlanco added the storage S3, EFS, FSx, S3 Glacier, Storage Gateway, AWS Backup label Aug 13, 2019
@ghost
Copy link

ghost commented Oct 28, 2019

Such feature would be exceptionally helpful!!!

@brett-vendia
Copy link

Hey @rhboyd, any plans for this? 🤗

@seekayel
Copy link

Shocked that this isn't supported after 7 years... also sadly not shocked, more like resigned.

sigh

@cristianrat
Copy link

WOW

@WaelA WaelA changed the title AWS::S3::Bucket-RequesterPays AWS::S3::Bucket - RequesterPays Aug 5, 2021
@matiasgvega
Copy link

Code Snippet to enable the feature using AwsCustomResource:

addRequesterPaysToS3Bucket(prefix: string, stage: string, region: string, bucket: IBucket): AwsCustomResource {
        // AWSSDKCall to apply to onCreate and onUpdate 
        const addRequestPay = {
            action: 'putBucketRequestPayment',
            region: region,
            service: `S3`,
            parameters: {
                Bucket: bucket.bucketName,
                RequestPaymentConfiguration: {
                    Payer: `Requester`
                }
            },
            physicalResourceId: PhysicalResourceId.of(bucket.bucketName)
        }

        const awsCustomResource = new AwsCustomResource(this, `${prefix}-RequesterPaysCustomResource-${stage}`, {
            policy: AwsCustomResourcePolicy.fromSdkCalls({
                resources: [bucket.bucketArn]
            }),
            onCreate: addRequestPay,
            onUpdate: addRequestPay
        });
        awsCustomResource.node.addDependency(bucket)
        return awsCustomResource
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
storage S3, EFS, FSx, S3 Glacier, Storage Gateway, AWS Backup
Projects
Status: Researching
Development

No branches or pull requests

6 participants