Skip to content

Commit

Permalink
Adopt latest state management approach
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgin314 committed Sep 17, 2024
1 parent eed5724 commit 54a4ff0
Showing 1 changed file with 11 additions and 33 deletions.
44 changes: 11 additions & 33 deletions project-x-infra-live/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 54a4ff0

Please sign in to comment.