Skip to content

Commit

Permalink
Enable encryption on the CDN bucket [sc-118422] (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
darend authored Apr 7, 2022
1 parent a7f77cf commit d6ebfdf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,22 @@ resource "aws_s3_bucket" "default" {
}
}
}

lifecycle {
ignore_changes = [
server_side_encryption_configuration
]
}
}

resource "aws_s3_bucket_server_side_encryption_configuration" "cdn_bucket" {
bucket = aws_s3_bucket.default.bucket

rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}

# AWS only supports a single bucket policy on a bucket. You can combine multiple Statements into a single policy, but not attach multiple policies.
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.0"
version = ">= 3.0"
}
local = {
source = "hashicorp/local"
Expand Down

0 comments on commit d6ebfdf

Please sign in to comment.