Added validation for edge_availability_domain value
This commit is contained in:
parent
2f7f5ff904
commit
ad25b1a31c
|
@ -503,16 +503,16 @@ module "example-va-b" {
|
||||||
| [description](variables.tf#L35) | VLAN attachment description. | <code>string</code> | ✓ | |
|
| [description](variables.tf#L35) | VLAN attachment description. | <code>string</code> | ✓ | |
|
||||||
| [name](variables.tf#L52) | The common resources name, used after resource type prefix and suffix. | <code>string</code> | ✓ | |
|
| [name](variables.tf#L52) | The common resources name, used after resource type prefix and suffix. | <code>string</code> | ✓ | |
|
||||||
| [network](variables.tf#L57) | The VPC name to which resources are associated to. | <code>string</code> | ✓ | |
|
| [network](variables.tf#L57) | The VPC name to which resources are associated to. | <code>string</code> | ✓ | |
|
||||||
| [peer_asn](variables.tf#L70) | The on-premises underlay router ASN. | <code>string</code> | ✓ | |
|
| [peer_asn](variables.tf#L74) | The on-premises underlay router ASN. | <code>string</code> | ✓ | |
|
||||||
| [project_id](variables.tf#L75) | The project id where resources are created. | <code>string</code> | ✓ | |
|
| [project_id](variables.tf#L79) | The project id where resources are created. | <code>string</code> | ✓ | |
|
||||||
| [region](variables.tf#L80) | The region where resources are created. | <code>string</code> | ✓ | |
|
| [region](variables.tf#L84) | The region where resources are created. | <code>string</code> | ✓ | |
|
||||||
| [router_config](variables.tf#L85) | Cloud Router configuration for the VPN. If you want to reuse an existing router, set create to false and use name to specify the desired router. | <code title="object({ create = optional(bool, true) asn = optional(number, 65001) name = optional(string, "router") keepalive = optional(number) custom_advertise = optional(object({ all_subnets = bool ip_ranges = map(string) })) bfd = optional(object({ session_initialization_mode = optional(string, "ACTIVE") min_receive_interval = optional(number) min_transmit_interval = optional(number) multiplier = optional(number) })) })">object({…})</code> | ✓ | |
|
| [router_config](variables.tf#L89) | Cloud Router configuration for the VPN. If you want to reuse an existing router, set create to false and use name to specify the desired router. | <code title="object({ create = optional(bool, true) asn = optional(number, 65001) name = optional(string, "router") keepalive = optional(number) custom_advertise = optional(object({ all_subnets = bool ip_ranges = map(string) })) bfd = optional(object({ session_initialization_mode = optional(string, "ACTIVE") min_receive_interval = optional(number) min_transmit_interval = optional(number) multiplier = optional(number) })) })">object({…})</code> | ✓ | |
|
||||||
| [admin_enabled](variables.tf#L17) | Whether the VLAN attachment is enabled. | <code>bool</code> | | <code>true</code> |
|
| [admin_enabled](variables.tf#L17) | Whether the VLAN attachment is enabled. | <code>bool</code> | | <code>true</code> |
|
||||||
| [dedicated_interconnect_config](variables.tf#L23) | Partner interconnect configuration. | <code title="object({ bandwidth = optional(string, "BPS_10G") bgp_range = optional(string, "169.254.128.0/29") interconnect = string vlan_tag = string })">object({…})</code> | | <code>null</code> |
|
| [dedicated_interconnect_config](variables.tf#L23) | Partner interconnect configuration. | <code title="object({ bandwidth = optional(string, "BPS_10G") bgp_range = optional(string, "169.254.128.0/29") interconnect = string vlan_tag = string })">object({…})</code> | | <code>null</code> |
|
||||||
| [ipsec_gateway_ip_ranges](variables.tf#L40) | IPSec Gateway IP Ranges. | <code>map(string)</code> | | <code>{}</code> |
|
| [ipsec_gateway_ip_ranges](variables.tf#L40) | IPSec Gateway IP Ranges. | <code>map(string)</code> | | <code>{}</code> |
|
||||||
| [mtu](variables.tf#L46) | The MTU associated to the VLAN attachment (1440 / 1500). | <code>number</code> | | <code>1500</code> |
|
| [mtu](variables.tf#L46) | The MTU associated to the VLAN attachment (1440 / 1500). | <code>number</code> | | <code>1500</code> |
|
||||||
| [partner_interconnect_config](variables.tf#L62) | Partner interconnect configuration. | <code title="object({ edge_availability_domain = optional(string, "AVAILABILITY_DOMAIN_ANY") })">object({…})</code> | | <code>null</code> |
|
| [partner_interconnect_config](variables.tf#L62) | Partner interconnect configuration. | <code title="object({ edge_availability_domain = string })">object({…})</code> | | <code>null</code> |
|
||||||
| [vlan_tag](variables.tf#L106) | The VLAN id to be used for this VLAN attachment. | <code>number</code> | | <code>null</code> |
|
| [vlan_tag](variables.tf#L110) | The VLAN id to be used for this VLAN attachment. | <code>number</code> | | <code>null</code> |
|
||||||
| [vpn_gateways_ip_range](variables.tf#L112) | The IP range (cidr notation) to be used for the GCP VPN gateways. If null IPSec over Interconnect is not enabled. | <code>string</code> | | <code>null</code> |
|
| [vpn_gateways_ip_range](variables.tf#L116) | The IP range (cidr notation) to be used for the GCP VPN gateways. If null IPSec over Interconnect is not enabled. | <code>string</code> | | <code>null</code> |
|
||||||
|
|
||||||
<!-- END TFDOC -->
|
<!-- END TFDOC -->
|
||||||
|
|
|
@ -62,8 +62,12 @@ variable "network" {
|
||||||
variable "partner_interconnect_config" {
|
variable "partner_interconnect_config" {
|
||||||
description = "Partner interconnect configuration."
|
description = "Partner interconnect configuration."
|
||||||
type = object({
|
type = object({
|
||||||
edge_availability_domain = optional(string, "AVAILABILITY_DOMAIN_ANY")
|
edge_availability_domain = string
|
||||||
})
|
})
|
||||||
|
validation {
|
||||||
|
condition = var.partner_interconnect_config == null ? true : contains(["AVAILABILITY_DOMAIN_1", "AVAILABILITY_DOMAIN_2", "AVAILABILITY_DOMAIN_ANY"], var.partner_interconnect_config.edge_availability_domain)
|
||||||
|
error_message = "The edge_availability_domain must have one of these values: AVAILABILITY_DOMAIN_1, AVAILABILITY_DOMAIN_2, AVAILABILITY_DOMAIN_ANY."
|
||||||
|
}
|
||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue