add support for custom description in net-address (#1499)
This commit is contained in:
parent
0b224a7f55
commit
973a8594b6
|
@ -83,12 +83,12 @@ module "addresses" {
|
||||||
|
|
||||||
| name | description | type | required | default |
|
| name | description | type | required | default |
|
||||||
|---|---|:---:|:---:|:---:|
|
|---|---|:---:|:---:|:---:|
|
||||||
| [project_id](variables.tf#L54) | Project where the addresses will be created. | <code>string</code> | ✓ | |
|
| [project_id](variables.tf#L55) | Project where the addresses will be created. | <code>string</code> | ✓ | |
|
||||||
| [external_addresses](variables.tf#L17) | Map of external address regions, keyed by name. | <code>map(string)</code> | | <code>{}</code> |
|
| [external_addresses](variables.tf#L17) | Map of external address regions, keyed by name. | <code>map(string)</code> | | <code>{}</code> |
|
||||||
| [global_addresses](variables.tf#L29) | List of global addresses to create. | <code>list(string)</code> | | <code>[]</code> |
|
| [global_addresses](variables.tf#L29) | List of global addresses to create. | <code>list(string)</code> | | <code>[]</code> |
|
||||||
| [internal_addresses](variables.tf#L35) | Map of internal addresses to create, keyed by name. | <code title="map(object({ region = string subnetwork = string address = optional(string) labels = optional(map(string)) purpose = optional(string) tier = optional(string) }))">map(object({…}))</code> | | <code>{}</code> |
|
| [internal_addresses](variables.tf#L35) | Map of internal addresses to create, keyed by name. | <code title="map(object({ region = string subnetwork = string address = optional(string) description = optional(string, "Terraform managed.") labels = optional(map(string)) purpose = optional(string) tier = optional(string) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||||
| [psa_addresses](variables.tf#L59) | Map of internal addresses used for Private Service Access. | <code title="map(object({ address = string network = string prefix_length = number }))">map(object({…}))</code> | | <code>{}</code> |
|
| [psa_addresses](variables.tf#L60) | Map of internal addresses used for Private Service Access. | <code title="map(object({ address = string network = string description = optional(string, "Terraform managed.") prefix_length = number }))">map(object({…}))</code> | | <code>{}</code> |
|
||||||
| [psc_addresses](variables.tf#L69) | Map of internal addresses used for Private Service Connect. | <code title="map(object({ address = string network = string }))">map(object({…}))</code> | | <code>{}</code> |
|
| [psc_addresses](variables.tf#L71) | Map of internal addresses used for Private Service Connect. | <code title="map(object({ address = string network = string description = optional(string, "Terraform managed.") }))">map(object({…}))</code> | | <code>{}</code> |
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ resource "google_compute_address" "internal" {
|
||||||
for_each = var.internal_addresses
|
for_each = var.internal_addresses
|
||||||
project = var.project_id
|
project = var.project_id
|
||||||
name = each.key
|
name = each.key
|
||||||
description = "Terraform managed."
|
description = each.value.description
|
||||||
address_type = "INTERNAL"
|
address_type = "INTERNAL"
|
||||||
region = each.value.region
|
region = each.value.region
|
||||||
subnetwork = each.value.subnetwork
|
subnetwork = each.value.subnetwork
|
||||||
|
@ -49,7 +49,7 @@ resource "google_compute_global_address" "psc" {
|
||||||
for_each = var.psc_addresses
|
for_each = var.psc_addresses
|
||||||
project = var.project_id
|
project = var.project_id
|
||||||
name = each.key
|
name = each.key
|
||||||
description = "Terraform managed."
|
description = each.value.description
|
||||||
address = try(each.value.address, null)
|
address = try(each.value.address, null)
|
||||||
address_type = "INTERNAL"
|
address_type = "INTERNAL"
|
||||||
network = each.value.network
|
network = each.value.network
|
||||||
|
@ -61,7 +61,7 @@ resource "google_compute_global_address" "psa" {
|
||||||
for_each = var.psa_addresses
|
for_each = var.psa_addresses
|
||||||
project = var.project_id
|
project = var.project_id
|
||||||
name = each.key
|
name = each.key
|
||||||
description = "Terraform managed."
|
description = each.value.description
|
||||||
address = each.value.address
|
address = each.value.address
|
||||||
address_type = "INTERNAL"
|
address_type = "INTERNAL"
|
||||||
network = each.value.network
|
network = each.value.network
|
||||||
|
|
|
@ -35,12 +35,13 @@ variable "global_addresses" {
|
||||||
variable "internal_addresses" {
|
variable "internal_addresses" {
|
||||||
description = "Map of internal addresses to create, keyed by name."
|
description = "Map of internal addresses to create, keyed by name."
|
||||||
type = map(object({
|
type = map(object({
|
||||||
region = string
|
region = string
|
||||||
subnetwork = string
|
subnetwork = string
|
||||||
address = optional(string)
|
address = optional(string)
|
||||||
labels = optional(map(string))
|
description = optional(string, "Terraform managed.")
|
||||||
purpose = optional(string)
|
labels = optional(map(string))
|
||||||
tier = optional(string)
|
purpose = optional(string)
|
||||||
|
tier = optional(string)
|
||||||
}))
|
}))
|
||||||
default = {}
|
default = {}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +62,7 @@ variable "psa_addresses" {
|
||||||
type = map(object({
|
type = map(object({
|
||||||
address = string
|
address = string
|
||||||
network = string
|
network = string
|
||||||
|
description = optional(string, "Terraform managed.")
|
||||||
prefix_length = number
|
prefix_length = number
|
||||||
}))
|
}))
|
||||||
default = {}
|
default = {}
|
||||||
|
@ -69,8 +71,9 @@ variable "psa_addresses" {
|
||||||
variable "psc_addresses" {
|
variable "psc_addresses" {
|
||||||
description = "Map of internal addresses used for Private Service Connect."
|
description = "Map of internal addresses used for Private Service Connect."
|
||||||
type = map(object({
|
type = map(object({
|
||||||
address = string
|
address = string
|
||||||
network = string
|
network = string
|
||||||
|
description = optional(string, "Terraform managed.")
|
||||||
}))
|
}))
|
||||||
default = {}
|
default = {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue