Terraform resource: aws s3 bucket server side encryption configuration

From wikieduonline
Jump to navigation Jump to search

aws_s3_bucket_server_side_encryption_configuration

Resource not supported with S3 directory buckets.

Official usage

resource "aws_kms_key" "mykey" {
  description             = "This key is used to encrypt bucket objects"
  deletion_window_in_days = 10
}

resource "aws_s3_bucket" "mybucket" {
  bucket = "mybucket"
}

resource "aws_s3_bucket_server_side_encryption_configuration" "example" {
  bucket = aws_s3_bucket.mybucket.id

  rule {
    apply_server_side_encryption_by_default {
      kms_master_key_id = aws_kms_key.mykey.arn
      sse_algorithm     = "aws:kms"
    }
  }
}


Related

See also

Advertising: