Skip to content

Commit b75d5c5

Browse files
authored
Merge pull request #66 from tfhartmann/tfhartmann-adding-description
feat: adding optional description field to created subnets
2 parents 6575822 + 011e273 commit b75d5c5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module "vpc" {
3636
subnet_region = "us-west1"
3737
subnet_private_access = "true"
3838
subnet_flow_logs = "true"
39+
description = "This subnet has a description"
3940
},
4041
]
4142
@@ -121,6 +122,7 @@ The subnets list contains maps, where each object represents a subnet. Each map
121122
| subnet_region | The region where the subnet will be created | string | - | yes |
122123
| subnet_private_access | Whether this subnet will have private Google access enabled | string | false | no |
123124
| subnet_flow_logs | Whether the subnet will record and send flow log data to logging | string | false | no |
125+
| description | The description of the subnet being created | string | null | no |
124126

125127
### Route Inputs
126128
The routes list contains maps, where each object represents a route. For the next_hop_* inputs, only one is possible to be used in each route. Having two next_hop_* inputs will produce an error. Each map has the following inputs (please see examples folder for additional references):

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ resource "google_compute_subnetwork" "subnetwork" {
4848
network = google_compute_network.network.name
4949
project = var.project_id
5050
secondary_ip_range = [for i in range(length(contains(keys(var.secondary_ranges), var.subnets[count.index]["subnet_name"]) == true ? var.secondary_ranges[var.subnets[count.index]["subnet_name"]] : [])) : var.secondary_ranges[var.subnets[count.index]["subnet_name"]][i]]
51+
description = lookup(var.subnets[count.index], "description", null)
5152
}
5253

5354
data "google_compute_subnetwork" "created_subnets" {
@@ -98,4 +99,3 @@ resource "null_resource" "delete_default_internet_gateway_routes" {
9899
google_compute_route.route,
99100
]
100101
}
101-

0 commit comments

Comments
 (0)