diff --git a/project-x-infra-live/terragrunt.hcl b/project-x-infra-live/terragrunt.hcl index ebd7375..1c510ae 100644 --- a/project-x-infra-live/terragrunt.hcl +++ b/project-x-infra-live/terragrunt.hcl @@ -78,44 +78,22 @@ EOF # Configure Terragrunt to automatically store tfstate files in an S3 bucket remote_state { backend = "s3" - config = { - encrypt = true - bucket = "${get_env("TG_BUCKET_PREFIX", "")}tg-infrastructure-tf-state-${local.account_name}-us-gov-east-1" - //bucket = "inf-tfstate-224384469011" - key = "${path_relative_to_include()}/terraform.tfstate" - //key = "${trimprefix(replace(run_cmd("realpath",get_original_terragrunt_dir()),dirname(get_repo_root()),""),"/")}" - region = "us-gov-east-1" - //dynamodb_table = "tf_remote_state" - dynamodb_table = "terraform-locks-cidcd" - // REVERT DON'S CHANGES TEMPORARILY WHILE FINISHING TESTING - } generate = { - path = "backend.tf" + path = "remote_state.backend.tf" if_exists = "overwrite_terragrunt" } + config = { + bucket = "${local.state_bucket_prefix}-${local.account_id}" + dynamodb_table = "${local.state_table_name}" + key = "${trimprefix(replace(run_cmd("realpath", get_original_terragrunt_dir()), dirname(get_repo_root()), ""), "/")}" + profile = "${local.profile}" + region = "${local.region}" + skip_bucket_enforced_tls = true + skip_bucket_root_access = true + skip_bucket_ssencryption = true + } } -# remote_state { -# backend = "s3" -# generate = { -# path = "remote_state.backend.tf" -# if_exists = "overwrite_terragrunt" -# } -# config = { -# #--- -# # "${local.account_name}": "${get_path_from_repo_root()}" -# #--- -# bucket = "${local.state_bucket_prefix}-${local.account_id}" -# profile = "${local.profile}" -# key = "${trimprefix(replace(run_cmd("realpath", get_original_terragrunt_dir()), dirname(get_repo_root()), ""), "/")}" -# region = "${local.region}" -# dynamodb_table = "${local.state_table_name}" -# skip_bucket_root_access = true -# skip_bucket_ssencryption = true -# skip_bucket_enforced_tls = true -# } -# } - # --------------------------------------------------------------------------------------------------------------------- # GLOBAL PARAMETERS # These variables apply to all configurations in this subfolder. These are automatically merged into the child