Skip to content

Commit

Permalink
terragrunt.hcl: add repo url to tags
Browse files Browse the repository at this point in the history
  • Loading branch information
digorgonzola committed Dec 8, 2023
1 parent 77e708b commit 7fd9cf1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions deploy/tg/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -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"
}
Expand All @@ -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}"
}
}
}
Expand Down

0 comments on commit 7fd9cf1

Please sign in to comment.