aws s3api put-bucket-encryption
This operation configures default encryption and Amazon S3 Bucket Keys for an existing bucket. AWS CLI reference
1 example 5 options Its page in the AWS CLI reference
Examples
To configure server-side encryption for a bucket
The following put-bucket-encryption example sets AES256 encryption as the default for the specified bucket.
aws s3api put-bucket-encryption --bucket amzn-s3-demo-bucket --server-side-encryption-configuration '{"Rules": [{"ApplyServerSideEncryptionByDefault": {"SSEAlgorithm": "AES256"}}]}'Identify--bucketSpecifies default encryption for a bucket using server-side encryption with different key options.--server-side-encryption-configurationSpecifies the default server-side-encryption configuration.This command produces no output.
For more information, see Setting default server-side encryption behavior for Amazon S3 buckets in the Amazon S3 User Guide.
Options
--bucketSpecifies default encryption for a bucket using server-side encryption with different key options.--checksum-algorithmIndicates the algorithm used to create the checksum for the request when you use the SDK.--content-md5The Base64 encoded 128-bit MD5 digest of the server-side encryption configuration.--expected-bucket-ownerThe account ID of the expected bucket owner.--server-side-encryption-configurationSpecifies the default server-side-encryption configuration.