diff --git a/terraform/s3-web-workspaced.tf b/terraform/s3-web-workspaced.tf index 5741c204..5dd3513b 100644 --- a/terraform/s3-web-workspaced.tf +++ b/terraform/s3-web-workspaced.tf @@ -23,7 +23,7 @@ resource "aws_s3_bucket_ownership_controls" "wkspc_www_bucket_ownership_controls resource "aws_s3_bucket_acl" "wkspc_www_bucket_acl" { # only create objects if we are in the prod workspace - count = local.is_prod ? length(local.files) : 0 + count = local.is_prod ? 1 : 0 depends_on = [ aws_s3_bucket_ownership_controls.wkspc_www_bucket_ownership_controls, @@ -35,7 +35,7 @@ resource "aws_s3_bucket_acl" "wkspc_www_bucket_acl" { resource "aws_s3_bucket_policy" "wkspc_www_bucket_policy" { # only create objects if we are in the prod workspace - count = local.is_prod ? length(local.files) : 0 + count = local.is_prod ? 1 : 0 depends_on = [ aws_s3_bucket_acl.wkspc_www_bucket_acl, @@ -47,7 +47,7 @@ resource "aws_s3_bucket_policy" "wkspc_www_bucket_policy" { resource "aws_s3_bucket_cors_configuration" "wkspc_www_bucket_cors" { # only create objects if we are in the prod workspace - count = local.is_prod ? length(local.files) : 0 + count = local.is_prod ? 1 : 0 bucket = aws_s3_bucket.wkspc_www_bucket.id @@ -62,7 +62,7 @@ resource "aws_s3_bucket_cors_configuration" "wkspc_www_bucket_cors" { resource "aws_s3_bucket_website_configuration" "wkspc_www_bucket_website" { # only create objects if we are in the prod workspace - count = local.is_prod ? length(local.files) : 0 + count = local.is_prod ? 1 : 0 bucket = aws_s3_bucket.wkspc_www_bucket.id @@ -79,7 +79,7 @@ resource "aws_s3_bucket_website_configuration" "wkspc_www_bucket_website" { resource "aws_cloudfront_distribution" "wkspc_www_s3_distribution" { # only create objects if we are in the prod workspace - count = local.is_prod ? length(local.files) : 0 + count = local.is_prod ? 1 : 0 origin { domain_name = aws_s3_bucket.wkspc_www_bucket.bucket_regional_domain_name @@ -173,7 +173,7 @@ resource "aws_lambda_permission" "allow_bucket" { resource "aws_lambda_permission" "apigw_invoke_function" { # only create objects if we are in the prod workspace - count = local.is_prod ? length(local.files) : 0 + count = local.is_prod ? 1 : 0 statement_id = "AllowApiGatewayToInvokeFunction-${local.site_name}-${terraform.workspace}" action = "lambda:InvokeFunction"