From 7fd9cf103435417425f7204e52c25f91d65e7e8e Mon Sep 17 00:00:00 2001 From: digorgonzola <29941279+digorgonzola@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:17:12 +1100 Subject: [PATCH] terragrunt.hcl: add repo url to tags --- deploy/tg/terragrunt.hcl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy/tg/terragrunt.hcl b/deploy/tg/terragrunt.hcl index b2b13d4..fc61db7 100644 --- a/deploy/tg/terragrunt.hcl +++ b/deploy/tg/terragrunt.hcl @@ -1,8 +1,9 @@ locals { aws_account = get_env("AWS_ACCOUNT_ID") - aws_region = get_env("AWS_REGION", "ap-southeast-2") + aws_region = get_env("AWS_REGION") environment = get_env("ENVIRONMENT") project_name = "sample-django-app" + repo_url = run_cmd("--terragrunt-quiet", "sh", "-c", "git config --get remote.origin.url") state_bucket = "tfstate-${local.aws_account}-${local.aws_region}" state_key = "apps/${local.project_name}/${local.environment}/${basename(get_terragrunt_dir())}.tfstate" } @@ -17,9 +18,10 @@ provider "aws" { default_tags { tags = { "Environment" = "apps" - "ManagedBy" = "Terradeploy Apps - ${local.state_bucket}/${local.state_key}" + "ManagedBy" = "Apps - ${local.state_bucket}/${local.state_key}" "Owner" = "Platform Engineering" "Project" = "AODN Applications" + "Repository" = "${local.repo_url}" } } }