diff --git a/modules/artifacts_bucket.tf b/modules/artifacts_bucket.tf index ec68385af..5b342fa34 100755 --- a/modules/artifacts_bucket.tf +++ b/modules/artifacts_bucket.tf @@ -1,3 +1,8 @@ +locals { + redbox_principal_policy = var.redbox_principal_policy == "" ? "${path.module}/fixtures/policies/redbox_principal_policy.tmpl" : var.redbox_principal_policy +} + + # Configure an S3 Bucket to hold artifacts # (eg. application code deployments, etc.) resource "aws_s3_bucket" "artifacts" { @@ -62,6 +67,6 @@ POLICY resource "aws_s3_bucket_object" "redbox_principal_policy" { bucket = aws_s3_bucket.artifacts.id key = "fixtures/policies/redbox_principal_policy.tmpl" - source = var.redbox_principal_policy - etag = "${filemd5(var.redbox_principal_policy)}" + source = local.redbox_principal_policy + etag = "${filemd5(local.redbox_principal_policy)}" } diff --git a/modules/variables.tf b/modules/variables.tf index ed27e5978..e39067662 100755 --- a/modules/variables.tf +++ b/modules/variables.tf @@ -163,5 +163,5 @@ variable "budget_notification_threshold_percentiles" { variable "redbox_principal_policy" { type = string description = "Location of file with the policy used for the RedBox Principal Account" - default = "fixtures/policies/redbox_principal_policy.tmpl" + default = "" }