There are more AWS SDK examples available in the AWS Doc SDK Examples
Use GetBucketEncryption
with an AWS SDK or CLI
The following code examples show how to use GetBucketEncryption
.
- CLI
-
- AWS CLI
-
To retrieve the server-side encryption configuration for a bucket
The following
get-bucket-encryption
example retrieves the server-side encryption configuration for the bucketmy-bucket
.aws s3api get-bucket-encryption \ --bucket
my-bucket
Output:
{ "ServerSideEncryptionConfiguration": { "Rules": [ { "ApplyServerSideEncryptionByDefault": { "SSEAlgorithm": "AES256" } } ] } }
-
For API details, see GetBucketEncryption
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell
-
Example 1: This command returns all the server side encryption rules associated with the given bucket.
Get-S3BucketEncryption -BucketName 's3casetestbucket'
-
For API details, see GetBucketEncryption in AWS Tools for PowerShell Cmdlet Reference.
-