Skip to content

Commit

Permalink
Add bucket versioning to audio (#1597)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwilkie authored Oct 13, 2024
1 parent a3e030a commit 735646a
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions infrastructure/modules/scfm/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,32 @@ resource "aws_s3_bucket_acl" "audio" {
acl = "public-read"
}

resource "aws_s3_bucket_versioning" "audio" {
bucket = aws_s3_bucket.audio.id

versioning_configuration {
status = "Enabled"
}
}

resource "aws_s3_bucket_policy" "audio" {
bucket = aws_s3_bucket.audio.id

policy = <<POLICY
{
"Version":"2012-10-17",
"Statement":[
policy = jsonencode(
{
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject"
],
"Resource": [
"${aws_s3_bucket.audio.arn}/*"
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Principal" : "*",
"Action" : [
"s3:GetObject"
],
"Resource" : [
"${aws_s3_bucket.audio.arn}/*"
]
}
]
}
]
}
POLICY
)
}

0 comments on commit 735646a

Please sign in to comment.