disable googleapi routes creation when vpc is not created (#1489)
This commit is contained in:
parent
aeaf1f66fd
commit
86cc6eee4c
|
@ -482,7 +482,7 @@ module "vpc" {
|
||||||
| [name](variables.tf#L83) | The name of the network being created. | <code>string</code> | ✓ | |
|
| [name](variables.tf#L83) | The name of the network being created. | <code>string</code> | ✓ | |
|
||||||
| [project_id](variables.tf#L99) | The ID of the project where this VPC will be created. | <code>string</code> | ✓ | |
|
| [project_id](variables.tf#L99) | The ID of the project where this VPC will be created. | <code>string</code> | ✓ | |
|
||||||
| [auto_create_subnetworks](variables.tf#L17) | Set to true to create an auto mode subnet, defaults to custom mode. | <code>bool</code> | | <code>false</code> |
|
| [auto_create_subnetworks](variables.tf#L17) | Set to true to create an auto mode subnet, defaults to custom mode. | <code>bool</code> | | <code>false</code> |
|
||||||
| [create_googleapis_routes](variables.tf#L23) | Toggle creation of googleapis private/restricted routes. Set to null to disable creation. | <code title="object({ private = optional(bool, true) private-6 = optional(bool, false) restricted = optional(bool, true) restricted-6 = optional(bool, false) })">object({…})</code> | | <code>{}</code> |
|
| [create_googleapis_routes](variables.tf#L23) | Toggle creation of googleapis private/restricted routes. Disabled when vpc creation is turned off, or when set to null. | <code title="object({ private = optional(bool, true) private-6 = optional(bool, false) restricted = optional(bool, true) restricted-6 = optional(bool, false) })">object({…})</code> | | <code>{}</code> |
|
||||||
| [data_folder](variables.tf#L34) | An optional folder containing the subnet configurations in YaML format. | <code>string</code> | | <code>null</code> |
|
| [data_folder](variables.tf#L34) | An optional folder containing the subnet configurations in YaML format. | <code>string</code> | | <code>null</code> |
|
||||||
| [delete_default_routes_on_create](variables.tf#L40) | Set to true to delete the default routes at creation time. | <code>bool</code> | | <code>false</code> |
|
| [delete_default_routes_on_create](variables.tf#L40) | Set to true to delete the default routes at creation time. | <code>bool</code> | | <code>false</code> |
|
||||||
| [description](variables.tf#L46) | An optional description of this resource (triggers recreation on change). | <code>string</code> | | <code>"Terraform-managed."</code> |
|
| [description](variables.tf#L46) | An optional description of this resource (triggers recreation on change). | <code>string</code> | | <code>"Terraform-managed."</code> |
|
||||||
|
|
|
@ -31,7 +31,10 @@ locals {
|
||||||
priority = 1000
|
priority = 1000
|
||||||
tags = null
|
tags = null
|
||||||
}
|
}
|
||||||
if lookup(coalesce(var.create_googleapis_routes, {}), k, false)
|
if(
|
||||||
|
var.vpc_create &&
|
||||||
|
lookup(coalesce(var.create_googleapis_routes, {}), k, false)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
_routes = merge(local._googleapis_routes, coalesce(var.routes, {}))
|
_routes = merge(local._googleapis_routes, coalesce(var.routes, {}))
|
||||||
routes = {
|
routes = {
|
||||||
|
|
|
@ -21,7 +21,7 @@ variable "auto_create_subnetworks" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "create_googleapis_routes" {
|
variable "create_googleapis_routes" {
|
||||||
description = "Toggle creation of googleapis private/restricted routes. Set to null to disable creation."
|
description = "Toggle creation of googleapis private/restricted routes. Disabled when vpc creation is turned off, or when set to null."
|
||||||
type = object({
|
type = object({
|
||||||
private = optional(bool, true)
|
private = optional(bool, true)
|
||||||
private-6 = optional(bool, false)
|
private-6 = optional(bool, false)
|
||||||
|
|
Loading…
Reference in New Issue