Skip to content

Commit d6b35e9

Browse files
rmoving json around merge in provider.tf (#41)
* rmoving json around merge in provider.tf Co-authored-by: LeoDiazL <[email protected]>
1 parent 08e69a6 commit d6b35e9

File tree

4 files changed

+10
-18
lines changed

4 files changed

+10
-18
lines changed

action.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ inputs:
5252
description: 'Relative path for the directory of the app (i.e. where `Dockerfile` and `docker-compose.yaml` files are located). This is the directory that is copied to the EC2 instance. Default is the root of the repo.'
5353
additional_tags:
5454
description: 'A list of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}`'
55+
required: false
56+
default: '{}'
5557
outputs:
5658
vm_url:
5759
description: "The URL of the generated app"

operations/_scripts/generate/generate_provider.sh

+5-6
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ provider \"aws\" {
3333
region = \"${AWS_DEFAULT_REGION}\"
3434
profile = \"default\"
3535
default_tags {
36-
tags = {
37-
merge(
38-
local.aws_tags,
39-
var.additional_tags
40-
)
41-
}
36+
tags = merge(
37+
local.aws_tags,
38+
var.additional_tags
39+
)
4240
}
4341
}
42+
4443
" >> "${GITHUB_ACTION_PATH}/operations/deployment/terraform/provider.tf"

operations/_scripts/generate/generate_tf_vars.sh

+2-11
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@ if [ -z "${EC2_INSTANCE_PROFILE}" ]; then
3232
EC2_INSTANCE_PROFILE="${GITHUB_IDENTIFIER}"
3333
fi
3434

35-
36-
# ADDITIONAL TAGS
37-
IFS=',' read -ra ADDR <<< "$ADDITIONAL_TAGS"
38-
for i in "${ADDR[@]}"; do
39-
40-
IFS='=' read -r key val <<< "$i"
41-
ADDITIONAL_TAGS_LIST+="\"$key\": \"$val\","
42-
done
43-
4435
echo "
4536
app_port = \"$APP_PORT\"
4637
@@ -78,6 +69,6 @@ sub_domain_name = \"${SUB_DOMAIN}\"
7869
7970
domain_name = \"${DOMAIN_NAME}\"
8071
81-
additional_tags = {$( IFS=','; echo "${ADDITIONAL_TAGS_LIST[*]}" )}
82-
72+
additional_tags = ${ADDITIONAL_TAGS}
73+
#
8374
" >> "${GITHUB_ACTION_PATH}/operations/deployment/terraform/terraform.tfvars"

operations/deployment/terraform/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,5 @@ variable "domain_name" {
9292
variable "additional_tags" {
9393
type = map(string)
9494
description = "A list of strings that will be added to created resources"
95-
default = ""
95+
default = {}
9696
}

0 commit comments

Comments
 (0)