Skip to content

Commit 963f7c1

Browse files
committed
added extra tags variable
1 parent e794b2c commit 963f7c1

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

modules/single-cluster/subnet.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ resource "aws_subnet" "admin" {
1010
{
1111
"Name" = "Admin Subnet"
1212
},
13+
var.extra_tags_admin_subnet
1314
)
1415
}
1516

@@ -30,6 +31,7 @@ resource "aws_subnet" "public" {
3031
{
3132
"Name" = "Public Subnet"
3233
},
34+
var.extra_tags_public_subnet
3335
)
3436
}
3537

@@ -50,6 +52,7 @@ resource "aws_subnet" "private" {
5052
{
5153
"Name" = "Private Subnet"
5254
},
55+
var.extra_tags_private_subnet
5356
)
5457
}
5558

modules/single-cluster/variables.tf

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,28 @@ variable "vpc_enable_classiclink" {
5252
}
5353

5454
## Tagging Settings
55-
variable "extra_tags" {
55+
variable "extra_tags_global" {
56+
type = map(string)
57+
description = "Map of tags to apply in addition to already predefined tags of the module."
58+
default = {}
59+
}
60+
61+
## Tagging Settings
62+
variable "extra_tags_admin_subnet" {
63+
type = map(string)
64+
description = "Map of tags to apply in addition to already predefined tags of the module."
65+
default = {}
66+
}
67+
68+
## Tagging Settings
69+
variable "extra_tags_public_subnet" {
70+
type = map(string)
71+
description = "Map of tags to apply in addition to already predefined tags of the module."
72+
default = {}
73+
}
74+
75+
## Tagging Settings
76+
variable "extra_tags_private_subnet" {
5677
type = map(string)
5778
description = "Map of tags to apply in addition to already predefined tags of the module."
5879
default = {}
@@ -65,7 +86,7 @@ locals {
6586
"Author" = "Fairwinds"
6687
}
6788

68-
tags = merge(local.default_tags, var.extra_tags)
89+
tags = merge(local.default_tags, var.extra_tags_global)
6990
avail_zones_list = split(",", var.availability_zones)
7091
}
7192

0 commit comments

Comments
 (0)