Skip to content

Commit 5a67092

Browse files
Add branch tagging (#23)
1 parent 340ed5a commit 5a67092

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/pull-request-ephemeral-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Sandbox Environment
1+
name: Deploy Ephemeral Sandbox Environment
22

33
on:
44
pull_request:

terragrunt.hcl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
dynamodb_table = "${local.name_dash}-${local.region}-${local.name_hash}-tflocks"
2020
repo_name = basename(abspath("${get_path_to_repo_root()}"))
2121
state_filename_ephemeral = "${local.account_name}/${coalesce(local.git_branch, local.current_user)}/${local.environment_instance}/terraform.tfstate"
22-
state_filename_persist = "${local.account_name}/${coalesce(local.git_branch, local.current_user)}/${local.environment_instance}/terraform.tfstate"
22+
state_filename_persist = "${local.account_name}/${local.environment_instance}/terraform.tfstate"
2323
}
2424

2525
# Generate the AWS provider settings
@@ -34,6 +34,7 @@ provider "aws" {
3434
tags = {
3535
Organization = var.organization_tag
3636
Repository = coalesce(var.repository_tag, "${basename(abspath(dirname(find_in_parent_folders("terragrunt.hcl"))))}")
37+
Branch = var.branch_tag
3738
CommitHash = var.commit_hash_tag
3839
}
3940
}
@@ -47,6 +48,7 @@ provider "aws" {
4748
tags = {
4849
Organization = var.organization_tag
4950
Repository = coalesce(var.repository_tag, "${basename(abspath(dirname(find_in_parent_folders("terragrunt.hcl"))))}")
51+
Branch = var.branch_tag
5052
CommitHash = var.commit_hash_tag
5153
}
5254
}
@@ -62,6 +64,11 @@ variable "repository_tag" {
6264
default = ""
6365
}
6466
67+
variable "branch_tag" {
68+
type = string
69+
default = "RUN OUTSIDE PIPELINE"
70+
}
71+
6572
variable "commit_hash_tag" {
6673
type = string
6774
default = "RUN OUTSIDE PIPELINE"

0 commit comments

Comments
 (0)