diff --git a/terraform/s3-web-workspaced.tf b/terraform/s3-web-workspaced.tf index 5dd3513b..22ea4ada 100644 --- a/terraform/s3-web-workspaced.tf +++ b/terraform/s3-web-workspaced.tf @@ -13,7 +13,7 @@ resource "aws_s3_bucket_ownership_controls" "wkspc_www_bucket_ownership_controls # only create objects if we are in the prod workspace count = local.is_prod ? length(local.files) : 0 - bucket = aws_s3_bucket.wkspc_www_bucket.id + bucket = aws_s3_bucket.wkspc_www_bucket[count.index].id rule { object_ownership = "BucketOwnerPreferred" @@ -28,7 +28,7 @@ resource "aws_s3_bucket_acl" "wkspc_www_bucket_acl" { depends_on = [ aws_s3_bucket_ownership_controls.wkspc_www_bucket_ownership_controls, ] - bucket = aws_s3_bucket.wkspc_www_bucket.id + bucket = aws_s3_bucket.wkspc_www_bucket[count.index].id acl = "public-read" } @@ -49,7 +49,7 @@ resource "aws_s3_bucket_cors_configuration" "wkspc_www_bucket_cors" { # only create objects if we are in the prod workspace count = local.is_prod ? 1 : 0 - bucket = aws_s3_bucket.wkspc_www_bucket.id + bucket = aws_s3_bucket.wkspc_www_bucket[count.index].id cors_rule { allowed_headers = ["Authorization", "Content-Length"] @@ -64,7 +64,7 @@ resource "aws_s3_bucket_website_configuration" "wkspc_www_bucket_website" { # only create objects if we are in the prod workspace count = local.is_prod ? 1 : 0 - bucket = aws_s3_bucket.wkspc_www_bucket.id + bucket = aws_s3_bucket.wkspc_www_bucket[count.index].id index_document { suffix = "index.html"