Resource
aws.s3.BucketServerSideEncryptionConfiguration
rules[].apply_server_side_encryption_by_default.kms_master_key_id uses KmsKeyReference; during planning, key IDs, alias names, and alias ARNs may need kms:DescribeKey for the provider's effective identity and authorization in the key policy, only when the authored value differs from the value the service returns. Key ARNs never need a lookup; resolving an AWS-managed alias can initialize its key during planning (see KMS reference planning permissions).
Example
let bucket = aws.s3.Bucket {
bucket = 'carina-example-encrypted-bucket'
tags = {
Environment = 'example'
}
}
aws.s3.BucketServerSideEncryptionConfiguration {
bucket = bucket.bucket
rules = [
{
apply_server_side_encryption_by_default = {
sse_algorithm = aws.s3.BucketServerSideEncryptionConfiguration.SseRule.SseByDefault.SseAlgorithm.aes256
}
bucket_key_enabled = true
},
]
}
Argument Reference
bucket
- Type:
String - Required: Yes
Specifies default encryption for a bucket using server-side encryption with different key options. Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region-code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format bucket-base-name--zone-id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide
rules
- Type: List<Struct(SseRule)> (items: 1.., ordered)
- Required: Yes
List of server-side encryption rules to apply to the bucket.
Enum Values
rules[].apply_server_side_encryption_by_default.sse_algorithm (SseAlgorithm)
| Value | DSL Identifier |
|---|---|
AES256 |
aws.s3.BucketServerSideEncryptionConfiguration.SseRule.SseByDefault.SseAlgorithm.aes256 |
aws:kms |
aws.s3.BucketServerSideEncryptionConfiguration.SseRule.SseByDefault.SseAlgorithm.aws_kms |
aws:kms:dsse |
aws.s3.BucketServerSideEncryptionConfiguration.SseRule.SseByDefault.SseAlgorithm.aws_kms_dsse |
Shorthand formats: aes256 or SseAlgorithm.aes256
Struct Definitions
rules[]
| Field | Type | Required | Description |
|---|---|---|---|
apply_server_side_encryption_by_default |
Struct(SseByDefault) | No | |
bucket_key_enabled |
Bool |
No |
rules[].apply_server_side_encryption_by_default
| Field | Type | Required | Description |
|---|---|---|---|
sse_algorithm |
SseAlgorithm | Yes | |
kms_master_key_id |
KmsKeyReference (pattern: /^((arn:(?:aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b|aws-iso-e|aws-iso-f|aws-eusc):kms:[a-z]{2,4}(-[a-z0-9]+)+-[0-9]+:[0-9]{12}:(key/([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|mrk-[0-9a-fA-F]{32})|alias/[a-zA-Z0-9:/_-]+))|(alias/[a-zA-Z0-9:/_-]+)|([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})|(mrk-[0-9a-fA-F]{32}))$/ (Full), len: 1..=2048) |
No |