Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CloudFormation template to set S3 bucket default encryption [duplicate]

S3 now supports encryption to be applied by default when individual object PUT requests do not contain a specific encryption header.

How can this be set up as part of bucket creation during CloudFormation template? I have found the API call for this but it would be great if it could be supplied as an attribute within CloudFormation rather than a separate step.

So far the only options I see are

  • make a separate API / client call after bucket creation
  • use the older way of a bucket policy to reject unencrypted requests, which can be supplied via CloudFormation S3::BucketPolicy resource
like image 628
wrschneider Avatar asked Nov 09 '17 17:11

wrschneider


People also ask

What is the default S3 bucket encryption setting?

By default, S3 bucket encryption option is disabled. Select the needed option, for example, AES-256. This is server-side encryption with Amazon S3-managed keys (SSE-S3).

Will applying default encryption setting to the S3 buckets encrypt the data that already exists?

Amazon S3's default encryption can be used to automate the encryption of new objects in your bucket, but default encryption does not change the encryption of existing objects in the same bucket.

Does S3 automatically replicate default data?

S3 Replication Time Control, by default, includes S3 replication metrics and S3 event notifications, with which you can monitor the total number of S3 API operations that are pending replication, the total size of objects pending replication, and the maximum replication time.


1 Answers

As of some time apparently between last Friday and today, they've finally added a BucketEncryption property to S3 buckets in CloudFormation, allowing you to enable this default encryption.

like image 59
iv597 Avatar answered Nov 10 '22 23:11

iv597