diff --git a/terraform/api/terragrunt.hcl b/terraform/api/terragrunt.hcl index e087d760..9899afc4 100644 --- a/terraform/api/terragrunt.hcl +++ b/terraform/api/terragrunt.hcl @@ -15,10 +15,10 @@ locals { app_env = get_env("app_env") statefile_bucket_name = "${local.tf_remote_state_prefix}-${local.aws_license_plate}-${local.target_env}" statefile_key = "${local.stack_prefix}/${local.app_env}/api/terraform.tfstate" - statelock_table_name = "${local.tf_remote_state_prefix}-lock-${local.aws_license_plate}" flyway_image = get_env("flyway_image") api_image = get_env("api_image") rds_app_env = (contains(["dev", "test", "prod"], "${local.app_env}") ? "${local.app_env}" : "dev") # if app_env is not dev, test, or prod, default to dev + repo_name = get_env("repo_name") } @@ -32,7 +32,7 @@ terraform { bucket = "${local.statefile_bucket_name}" key = "${local.statefile_key}" # Path and name of the state file within the bucket region = "${local.region}" # AWS region where the bucket is located - dynamodb_table = "${local.statelock_table_name}" + use_lockfile = true # Enable native S3 locking encrypt = true } } diff --git a/terraform/database/terragrunt.hcl b/terraform/database/terragrunt.hcl index d1355604..ceb0dc9c 100644 --- a/terraform/database/terragrunt.hcl +++ b/terraform/database/terragrunt.hcl @@ -14,7 +14,6 @@ locals { app_env = get_env("app_env") # this is the environment for the app, like PR, dev, test, since same AWS dev can be reused for both dev and test statefile_bucket_name = "${local.tf_remote_state_prefix}-${local.aws_license_plate}-${local.target_env}" statefile_key = "${local.stack_prefix}/${local.app_env}/database/aurora-v2/terraform.tfstate" - statelock_table_name = "${local.tf_remote_state_prefix}-lock-${local.aws_license_plate}" rds_app_env = (contains(["dev", "test", "prod"], "${local.app_env}") ? "${local.app_env}" : "dev") # if app_env is not dev, test, or prod, default to dev } @@ -28,7 +27,7 @@ terraform { bucket = "${local.statefile_bucket_name}" key = "${local.statefile_key}" # Path and name of the state file within the bucket region = "${local.region}" # AWS region where the bucket is located - dynamodb_table = "${local.statelock_table_name}" + use_lockfile = true # Enable native S3 locking encrypt = true } } diff --git a/terraform/frontend/terragrunt.hcl b/terraform/frontend/terragrunt.hcl index b8c58165..6b849d0f 100644 --- a/terraform/frontend/terragrunt.hcl +++ b/terraform/frontend/terragrunt.hcl @@ -14,7 +14,6 @@ locals { aws_license_plate = get_env("aws_license_plate") statefile_bucket_name = "${local.tf_remote_state_prefix}-${local.aws_license_plate}-${local.target_env}" statefile_key = "${local.stack_prefix}/${local.app_env}/frontend/terraform.tfstate" - statelock_table_name = "${local.tf_remote_state_prefix}-lock-${local.aws_license_plate}" } # Remote S3 state for Terraform. @@ -27,7 +26,7 @@ terraform { bucket = "${local.statefile_bucket_name}" key = "${local.statefile_key}" # Path and name of the state file within the bucket region = "${local.region}" # AWS region where the bucket is located - dynamodb_table = "${local.statelock_table_name}" + use_lockfile = true # Enable native S3 locking encrypt = true } }