Skip to content

Commit 370d304

Browse files
committed
added extra_tags variable for custom tags
1 parent c5f7937 commit 370d304

File tree

6 files changed

+21
-20
lines changed

6 files changed

+21
-20
lines changed

.github/workflows/readme.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
python-version: '3.x'
1919

2020
- name: 'create readme'
21-
uses: 'clouddrove/github-actions@v9.0'
21+
uses: 'clouddrove/github-actions@v9.0.1'
2222
with:
2323
actions_subcommand: 'readme'
2424
github_token: '${{ secrets.GITHUB}}'
@@ -35,7 +35,7 @@ jobs:
3535
continue-on-error: true
3636

3737
- name: 'push readme'
38-
uses: 'clouddrove/github-actions@v9.0'
38+
uses: 'clouddrove/github-actions@v9.0.1'
3939
continue-on-error: true
4040
with:
4141
actions_subcommand: 'push'

.github/workflows/terraform.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,30 @@ jobs:
2020
aws-region: us-east-2
2121

2222
- name: 'Terraform Format'
23-
uses: 'clouddrove/github-actions@v9.0'
23+
uses: 'clouddrove/github-actions@v9.0.1'
2424
with:
2525
actions_subcommand: 'fmt'
2626

2727
- name: 'Terraform init for memcached'
28-
uses: 'clouddrove/github-actions@v9.0'
28+
uses: 'clouddrove/github-actions@v9.0.1'
2929
with:
3030
actions_subcommand: 'init'
3131
tf_actions_working_dir: ./_example/memcached
3232

3333
- name: 'Terraform validate for memcached'
34-
uses: 'clouddrove/github-actions@v9.0'
34+
uses: 'clouddrove/github-actions@v9.0.1'
3535
with:
3636
actions_subcommand: 'validate'
3737
tf_actions_working_dir: ./_example/memcached
3838

3939
- name: 'Terraform plan for memcached'
40-
uses: 'clouddrove/github-actions@v9.0'
40+
uses: 'clouddrove/github-actions@v9.0.1'
4141
with:
4242
actions_subcommand: 'plan'
4343
tf_actions_working_dir: ./_example/memcached
4444

4545
- name: 'Terraform init for redis'
46-
uses: 'clouddrove/github-actions@v9.0'
46+
uses: 'clouddrove/github-actions@v9.0.1'
4747
with:
4848
actions_subcommand: 'init'
4949
tf_actions_working_dir: ./_example/redis
@@ -55,25 +55,25 @@ jobs:
5555
tf_actions_working_dir: ./_example/redis
5656

5757
- name: 'Terraform plan for redis'
58-
uses: 'clouddrove/github-actions@v9.0'
58+
uses: 'clouddrove/github-actions@v9.0.1'
5959
with:
6060
actions_subcommand: 'plan'
6161
tf_actions_working_dir: ./_example/redis
6262

6363
- name: 'Terraform init for redis-cluster'
64-
uses: 'clouddrove/github-actions@v9.0'
64+
uses: 'clouddrove/github-actions@v9.0.1'
6565
with:
6666
actions_subcommand: 'init'
6767
tf_actions_working_dir: ./_example/redis-cluster
6868

6969
- name: 'Terraform validate for redis-cluster'
70-
uses: 'clouddrove/github-actions@v9.0'
70+
uses: 'clouddrove/github-actions@v9.0.1'
7171
with:
7272
actions_subcommand: 'validate'
7373
tf_actions_working_dir: ./_example/redis-cluster
7474

7575
- name: 'Terraform plan for redis-cluster'
76-
uses: 'clouddrove/github-actions@v9.0'
76+
uses: 'clouddrove/github-actions@v9.0.1'
7777
with:
7878
actions_subcommand: 'plan'
7979
tf_actions_working_dir: ./_example/redis-cluster

.github/workflows/terratest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
- name: 'Terratest for redis'
2626
if: ${{ github.event.label.name == 'terratest' }}
27-
uses: 'clouddrove/github-actions@v9.0'
27+
uses: 'clouddrove/github-actions@v9.0.1'
2828
with:
2929
actions_subcommand: 'terratest'
3030
tf_actions_working_dir: '_test/redis'
@@ -33,7 +33,7 @@ jobs:
3333

3434
- name: 'Terratest for redis-cluster'
3535
if: ${{ github.event.label.name == 'terratest' }}
36-
uses: 'clouddrove/github-actions@v9.0'
36+
uses: 'clouddrove/github-actions@v9.0.1'
3737
with:
3838
actions_subcommand: 'terratest'
3939
tf_actions_working_dir: '_test/redis-cluster'

main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module "labels" {
1717
environment = var.environment
1818
managedby = var.managedby
1919
label_order = var.label_order
20+
extra_tags = var.extra_tags
2021
}
2122

2223
# Module : Elasticache Subnet Group
@@ -27,7 +28,7 @@ resource "aws_elasticache_subnet_group" "default" {
2728
subnet_ids = var.subnet_ids
2829
description = var.description
2930

30-
tags = merge(var.tags, module.labels.tags)
31+
tags = module.labels.tags
3132
}
3233

3334
# Module : Elasticache Replication Group
@@ -59,7 +60,7 @@ resource "aws_elasticache_replication_group" "default" {
5960
transit_encryption_enabled = var.transit_encryption_enabled
6061
auth_token = var.auth_token
6162
kms_key_id = var.kms_key_id
62-
tags = merge(var.tags, module.labels.tags)
63+
tags = module.labels.tags
6364

6465
}
6566

@@ -91,7 +92,7 @@ resource "aws_elasticache_replication_group" "cluster" {
9192
transit_encryption_enabled = var.transit_encryption_enabled
9293
auth_token = var.auth_token
9394
kms_key_id = var.kms_key_id
94-
tags = merge(var.tags, module.labels.tags)
95+
tags = module.labels.tags
9596
cluster_mode {
9697
replicas_per_node_group = var.replicas_per_node_group #Replicas per Shard
9798
num_node_groups = var.num_node_groups #Number of Shards
@@ -121,5 +122,5 @@ resource "aws_elasticache_cluster" "default" {
121122
apply_immediately = var.apply_immediately
122123
preferred_availability_zones = slice(var.availability_zones, 0, var.num_cache_nodes)
123124
maintenance_window = var.maintenance_window
124-
tags = merge(var.tags, module.labels.tags)
125+
tags = module.labels.tags
125126
}

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ output "port" {
1212
}
1313

1414
output "tags" {
15-
value = merge(var.tags, module.labels.tags)
15+
value = module.labels.tags
1616
description = "A mapping of tags to assign to the resource."
1717
}
1818

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ variable "attributes" {
3636
description = "Additional attributes (e.g. `1`)."
3737
}
3838

39-
variable "tags" {
40-
type = map(any)
39+
variable "extra_tags" {
40+
type = map(string)
4141
default = {}
4242
description = "Additional tags (e.g. map(`BusinessUnit`,`XYZ`)."
4343
}

0 commit comments

Comments
 (0)