Skip to content

Commit 008764d

Browse files
authored
changed hardcoded tags for vcn to use variables (#53)
Signed-off-by: Ali Mukadam <[email protected]>
1 parent 4fd0046 commit 008764d

File tree

5 files changed

+10
-21
lines changed

5 files changed

+10
-21
lines changed

docs/terraformoptions.adoc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,6 @@ Configuration Terraform Options:
235235
[source,hcl]
236236
----
237237
tags = {
238-
department = ""
239-
environment = "dev"
240238
role = "bastion"
241239
}
242240
----
@@ -309,8 +307,6 @@ tags = {
309307
[source,hcl]
310308
----
311309
tags = {
312-
department = ""
313-
environment = "dev"
314310
role = "operator"
315311
}
316312
----

examples/database/locals.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ locals {
2424
internet_gateway_enabled = var.internet_gateway_enabled
2525
nat_gateway_enabled = var.nat_gateway_enabled
2626
service_gateway_enabled = var.service_gateway_enabled
27-
tags = null
27+
tags = var.tags["vcn"]
2828
vcn_cidr = var.vcn_cidr
2929
vcn_dns_label = var.vcn_dns_label
3030
vcn_name = var.vcn_name
@@ -45,7 +45,7 @@ locals {
4545
notification_topic = var.bastion_notification_topic
4646
ssh_private_key_path = var.ssh_private_key_path
4747
ssh_public_key_path = var.ssh_public_key_path
48-
tags = null
48+
tags = var.tags["bastion"]
4949
timezone = var.bastion_timezone
5050
use_autonomous = var.bastion_use_autonomous
5151
}
@@ -65,7 +65,7 @@ locals {
6565
notification_topic = var.operator_notification_topic
6666
ssh_private_key_path = var.ssh_private_key_path
6767
ssh_public_key_path = var.ssh_public_key_path
68-
tags = null
68+
tags = var.tags["operator"]
6969
timezone = var.operator_timezone
7070
}
7171

main.tf

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@ module "vcn" {
1616
internet_gateway_enabled = var.oci_base_vcn.internet_gateway_enabled
1717
nat_gateway_enabled = var.oci_base_vcn.nat_gateway_enabled
1818
service_gateway_enabled = var.oci_base_vcn.service_gateway_enabled
19-
tags = {
20-
department = "finance"
21-
environment = "dev"
22-
}
23-
vcn_cidr = var.oci_base_vcn.vcn_cidr
24-
vcn_dns_label = var.oci_base_vcn.vcn_dns_label
25-
vcn_name = var.oci_base_vcn.vcn_name
19+
tags = var.oci_base_vcn.tags
20+
vcn_cidr = var.oci_base_vcn.vcn_cidr
21+
vcn_dns_label = var.oci_base_vcn.vcn_dns_label
22+
vcn_name = var.oci_base_vcn.vcn_name
2623
}
2724

2825
module "bastion" {

terraform.tfvars.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ oci_base_vcn = {
2222
nat_gateway_enabled = true
2323
service_gateway_enabled = true
2424
tags = {
25-
department = ""
25+
department = "finance"
2626
environment = "dev"
2727
}
2828
vcn_cidr = "10.0.0.0/16"
@@ -48,7 +48,7 @@ oci_base_bastion = {
4848
ssh_private_key_path = ""
4949
ssh_public_key_path = ""
5050
tags = {
51-
department = ""
51+
department = "finace"
5252
environment = "dev"
5353
role = "bastion"
5454
}
@@ -72,7 +72,7 @@ oci_base_operator = {
7272
ssh_private_key_path = ""
7373
ssh_public_key_path = ""
7474
tags = {
75-
department = ""
75+
department = "finance"
7676
environment = "dev"
7777
role = "operator"
7878
}

variables.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ variable "oci_base_bastion" {
8686
ssh_private_key_path = ""
8787
ssh_public_key_path = ""
8888
tags = {
89-
department = ""
90-
environment = "dev"
9189
role = "bastion"
9290
}
9391
timezone = "Australia/Sydney"
@@ -132,8 +130,6 @@ variable "oci_base_operator" {
132130
ssh_private_key_path = ""
133131
ssh_public_key_path = ""
134132
tags = {
135-
department = ""
136-
environment = "dev"
137133
role = "operator"
138134
}
139135
timezone = "Australia/Sydney"

0 commit comments

Comments
 (0)