This template configures server-side encryption for an S3 object using the S3 default master key.

Terraform Template

resource "aws_s3_bucket" "examplebucket" {
  bucket = "examplebuckettftest"
}

resource "aws_s3_bucket_acl" "example" {
  acl = "private"
  bucket = aws_s3_bucket.examplebucket.id
}

resource "aws_s3_object" "example" {
  bucket = aws_s3_bucket.examplebucket.id
  key = "someobject"
  server_side_encryption = "aws:kms"
  source = "index.html"
}