Compare commits
19 Commits
d36c53bbae
...
4c64c15871
Author | SHA1 | Date |
---|---|---|
Luca Prete | 4c64c15871 | |
Carlo Maria Valla | befbd190a3 | |
Julio Castillo | e4a33b56e0 | |
Ludovico Magnocavallo | 44a65f79e5 | |
Julio Castillo | 5b43ed270d | |
Julio Castillo | 44c1cec041 | |
Julio Castillo | 25aa29e463 | |
Julio Castillo | 9188603365 | |
Julio Castillo | 2d3dae1aea | |
Julio Castillo | d50355b01a | |
Julio Castillo | 67c2597bcc | |
Julio Castillo | add1ac2dcc | |
Julio Castillo | 57d5e05d69 | |
Julio Castillo | bff5e46460 | |
Julio Castillo | 1adfb9fb32 | |
Julio Castillo | 3fdf0dfe99 | |
Rob Heckel | 6c33d34c28 | |
Richard Olson | 10aeb6615a | |
Richard Olson | 35aae372b2 |
|
@ -105,5 +105,5 @@ module "test" {
|
||||||
europe-west1 = "10.0.0.0/28"
|
europe-west1 = "10.0.0.0/28"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=10 resources=65
|
# tftest modules=10 resources=64
|
||||||
```
|
```
|
||||||
|
|
|
@ -80,5 +80,5 @@ module "test" {
|
||||||
project_id = "my-project"
|
project_id = "my-project"
|
||||||
hostname = "test.myorg.org"
|
hostname = "test.myorg.org"
|
||||||
}
|
}
|
||||||
# tftest modules=18 resources=62
|
# tftest modules=18 resources=61
|
||||||
```
|
```
|
||||||
|
|
|
@ -79,5 +79,5 @@ module "test" {
|
||||||
onprem_project_id = "my-onprem-project"
|
onprem_project_id = "my-onprem-project"
|
||||||
hostname = "test.myorg.org"
|
hostname = "test.myorg.org"
|
||||||
}
|
}
|
||||||
# tftest modules=14 resources=78
|
# tftest modules=14 resources=77
|
||||||
```
|
```
|
||||||
|
|
|
@ -88,9 +88,8 @@ module "organization" {
|
||||||
)
|
)
|
||||||
# delegated role grant for resource manager service account
|
# delegated role grant for resource manager service account
|
||||||
iam_bindings = {
|
iam_bindings = {
|
||||||
sa_resman_delegated_iam = {
|
(module.organization.custom_role_id[var.custom_role_names.organization_iam_admin]) = {
|
||||||
members = [module.automation-tf-resman-sa.iam_email]
|
members = [module.automation-tf-resman-sa.iam_email]
|
||||||
role = module.organization.custom_role_id[var.custom_role_names.organization_iam_admin]
|
|
||||||
condition = {
|
condition = {
|
||||||
expression = format(
|
expression = format(
|
||||||
"api.getAttribute('iam.googleapis.com/modifiedGrantsByRole', []).hasOnly([%s])",
|
"api.getAttribute('iam.googleapis.com/modifiedGrantsByRole', []).hasOnly([%s])",
|
||||||
|
|
|
@ -84,4 +84,5 @@ module "landing-nat-primary" {
|
||||||
router_create = true
|
router_create = true
|
||||||
router_name = "prod-nat-${local.region_shortnames[var.regions.primary]}"
|
router_name = "prod-nat-${local.region_shortnames[var.regions.primary]}"
|
||||||
router_network = module.landing-vpc.name
|
router_network = module.landing-vpc.name
|
||||||
|
router_asn = 4200001024
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,7 @@ module "dev-spoke-cloudnat" {
|
||||||
name = "dev-nat-${local.region_shortnames[each.value]}"
|
name = "dev-nat-${local.region_shortnames[each.value]}"
|
||||||
router_create = true
|
router_create = true
|
||||||
router_network = module.dev-spoke-vpc.name
|
router_network = module.dev-spoke-vpc.name
|
||||||
|
router_asn = 4200001024
|
||||||
logging_filter = "ERRORS_ONLY"
|
logging_filter = "ERRORS_ONLY"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,7 @@ module "prod-spoke-cloudnat" {
|
||||||
name = "prod-nat-${local.region_shortnames[each.value]}"
|
name = "prod-nat-${local.region_shortnames[each.value]}"
|
||||||
router_create = true
|
router_create = true
|
||||||
router_network = module.prod-spoke-vpc.name
|
router_network = module.prod-spoke-vpc.name
|
||||||
|
router_asn = 4200001024
|
||||||
logging_filter = "ERRORS_ONLY"
|
logging_filter = "ERRORS_ONLY"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,4 +84,5 @@ module "landing-nat-primary" {
|
||||||
router_create = true
|
router_create = true
|
||||||
router_name = "prod-nat-${local.region_shortnames[var.regions.primary]}"
|
router_name = "prod-nat-${local.region_shortnames[var.regions.primary]}"
|
||||||
router_network = module.landing-vpc.name
|
router_network = module.landing-vpc.name
|
||||||
|
router_asn = 4200001024
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,7 @@ module "dev-spoke-cloudnat" {
|
||||||
name = "dev-nat-${local.region_shortnames[each.value]}"
|
name = "dev-nat-${local.region_shortnames[each.value]}"
|
||||||
router_create = true
|
router_create = true
|
||||||
router_network = module.dev-spoke-vpc.name
|
router_network = module.dev-spoke-vpc.name
|
||||||
|
router_asn = 4200001024
|
||||||
logging_filter = "ERRORS_ONLY"
|
logging_filter = "ERRORS_ONLY"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,7 @@ module "prod-spoke-cloudnat" {
|
||||||
name = "prod-nat-${local.region_shortnames[each.value]}"
|
name = "prod-nat-${local.region_shortnames[each.value]}"
|
||||||
router_create = true
|
router_create = true
|
||||||
router_network = module.prod-spoke-vpc.name
|
router_network = module.prod-spoke-vpc.name
|
||||||
|
router_asn = 4200001024
|
||||||
logging_filter = "ERRORS_ONLY"
|
logging_filter = "ERRORS_ONLY"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,7 @@ module "landing-nat-primary" {
|
||||||
router_create = true
|
router_create = true
|
||||||
router_name = "prod-nat-${local.region_shortnames[var.regions.primary]}"
|
router_name = "prod-nat-${local.region_shortnames[var.regions.primary]}"
|
||||||
router_network = module.landing-untrusted-vpc.name
|
router_network = module.landing-untrusted-vpc.name
|
||||||
|
router_asn = 4200001024
|
||||||
}
|
}
|
||||||
|
|
||||||
moved {
|
moved {
|
||||||
|
@ -100,6 +101,7 @@ module "landing-nat-secondary" {
|
||||||
router_create = true
|
router_create = true
|
||||||
router_name = "prod-nat-${local.region_shortnames[var.regions.secondary]}"
|
router_name = "prod-nat-${local.region_shortnames[var.regions.secondary]}"
|
||||||
router_network = module.landing-untrusted-vpc.name
|
router_network = module.landing-untrusted-vpc.name
|
||||||
|
router_asn = 4200001024
|
||||||
}
|
}
|
||||||
|
|
||||||
# Trusted VPC
|
# Trusted VPC
|
||||||
|
|
|
@ -80,6 +80,7 @@ module "dev-spoke-cloudnat" {
|
||||||
name = "dev-nat-${local.region_shortnames[each.value]}"
|
name = "dev-nat-${local.region_shortnames[each.value]}"
|
||||||
router_create = true
|
router_create = true
|
||||||
router_network = module.dev-spoke-vpc.name
|
router_network = module.dev-spoke-vpc.name
|
||||||
|
router_asn = 4200001024
|
||||||
logging_filter = "ERRORS_ONLY"
|
logging_filter = "ERRORS_ONLY"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,7 @@ module "prod-spoke-cloudnat" {
|
||||||
name = "prod-nat-${local.region_shortnames[each.value]}"
|
name = "prod-nat-${local.region_shortnames[each.value]}"
|
||||||
router_create = true
|
router_create = true
|
||||||
router_network = module.prod-spoke-vpc.name
|
router_network = module.prod-spoke-vpc.name
|
||||||
|
router_asn = 4200001024
|
||||||
logging_filter = "ERRORS_ONLY"
|
logging_filter = "ERRORS_ONLY"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,7 @@ module "landing-nat-primary" {
|
||||||
router_create = true
|
router_create = true
|
||||||
router_name = "prod-nat-${local.region_shortnames[var.regions.primary]}"
|
router_name = "prod-nat-${local.region_shortnames[var.regions.primary]}"
|
||||||
router_network = module.landing-untrusted-vpc.name
|
router_network = module.landing-untrusted-vpc.name
|
||||||
|
router_asn = 4200001024
|
||||||
}
|
}
|
||||||
|
|
||||||
moved {
|
moved {
|
||||||
|
@ -101,6 +102,7 @@ module "landing-nat-secondary" {
|
||||||
router_create = true
|
router_create = true
|
||||||
router_name = "prod-nat-${local.region_shortnames[var.regions.secondary]}"
|
router_name = "prod-nat-${local.region_shortnames[var.regions.secondary]}"
|
||||||
router_network = module.landing-untrusted-vpc.name
|
router_network = module.landing-untrusted-vpc.name
|
||||||
|
router_asn = 4200001024
|
||||||
}
|
}
|
||||||
|
|
||||||
# Trusted VPC
|
# Trusted VPC
|
||||||
|
|
|
@ -48,6 +48,7 @@ module "apigee" {
|
||||||
europe-west3 = {
|
europe-west3 = {
|
||||||
runtime_ip_cidr_range = "10.0.8.0/22"
|
runtime_ip_cidr_range = "10.0.8.0/22"
|
||||||
troubleshooting_ip_cidr_range = "10.1.16.0/28"
|
troubleshooting_ip_cidr_range = "10.1.16.0/28"
|
||||||
|
enable_nat = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
endpoint_attachments = {
|
endpoint_attachments = {
|
||||||
|
@ -96,7 +97,7 @@ module "apigee" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=1 resources=9
|
# tftest modules=1 resources=8
|
||||||
```
|
```
|
||||||
|
|
||||||
### New environment group
|
### New environment group
|
||||||
|
@ -109,7 +110,7 @@ module "apigee" {
|
||||||
test = ["test.example.com"]
|
test = ["test.example.com"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=1 resources=2
|
# tftest modules=1 resources=1
|
||||||
```
|
```
|
||||||
|
|
||||||
### New environment
|
### New environment
|
||||||
|
@ -125,7 +126,7 @@ module "apigee" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=1 resources=2
|
# tftest modules=1 resources=1
|
||||||
```
|
```
|
||||||
|
|
||||||
### New instance
|
### New instance
|
||||||
|
@ -141,7 +142,7 @@ module "apigee" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=1 resources=2
|
# tftest modules=1 resources=1
|
||||||
```
|
```
|
||||||
|
|
||||||
### New endpoint attachment
|
### New endpoint attachment
|
||||||
|
@ -159,7 +160,7 @@ module "apigee" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# tftest modules=1 resources=2
|
# tftest modules=1 resources=1
|
||||||
```
|
```
|
||||||
|
|
||||||
### Apigee add-ons
|
### Apigee add-ons
|
||||||
|
@ -179,13 +180,13 @@ module "apigee" {
|
||||||
|
|
||||||
| name | description | type | required | default |
|
| name | description | type | required | default |
|
||||||
|---|---|:---:|:---:|:---:|
|
|---|---|:---:|:---:|:---:|
|
||||||
| [project_id](variables.tf#L90) | Project ID. | <code>string</code> | ✓ | |
|
| [project_id](variables.tf#L95) | Project ID. | <code>string</code> | ✓ | |
|
||||||
| [addons_config](variables.tf#L17) | Addons configuration. | <code title="object({ advanced_api_ops = optional(bool, false) api_security = optional(bool, false) connectors_platform = optional(bool, false) integration = optional(bool, false) monetization = optional(bool, false) })">object({…})</code> | | <code>null</code> |
|
| [addons_config](variables.tf#L17) | Addons configuration. | <code title="object({ advanced_api_ops = optional(bool, false) api_security = optional(bool, false) connectors_platform = optional(bool, false) integration = optional(bool, false) monetization = optional(bool, false) })">object({…})</code> | | <code>null</code> |
|
||||||
| [endpoint_attachments](variables.tf#L29) | Endpoint attachments. | <code title="map(object({ region = string service_attachment = string }))">map(object({…}))</code> | | <code>null</code> |
|
| [endpoint_attachments](variables.tf#L29) | Endpoint attachments. | <code title="map(object({ region = string service_attachment = string }))">map(object({…}))</code> | | <code>{}</code> |
|
||||||
| [envgroups](variables.tf#L38) | Environment groups (NAME => [HOSTNAMES]). | <code>map(list(string))</code> | | <code>null</code> |
|
| [envgroups](variables.tf#L39) | Environment groups (NAME => [HOSTNAMES]). | <code>map(list(string))</code> | | <code>{}</code> |
|
||||||
| [environments](variables.tf#L44) | Environments. | <code title="map(object({ display_name = optional(string) description = optional(string, "Terraform-managed") deployment_type = optional(string) api_proxy_type = optional(string) node_config = optional(object({ min_node_count = optional(number) max_node_count = optional(number) })) iam = optional(map(list(string))) envgroups = optional(list(string)) regions = optional(list(string)) }))">map(object({…}))</code> | | <code>null</code> |
|
| [environments](variables.tf#L46) | Environments. | <code title="map(object({ display_name = optional(string) description = optional(string, "Terraform-managed") deployment_type = optional(string) api_proxy_type = optional(string) node_config = optional(object({ min_node_count = optional(number) max_node_count = optional(number) })) iam = optional(map(list(string))) envgroups = optional(list(string)) regions = optional(list(string)) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||||
| [instances](variables.tf#L62) | Instances ([REGION] => [INSTANCE]). | <code title="map(object({ display_name = optional(string) description = optional(string, "Terraform-managed") runtime_ip_cidr_range = string troubleshooting_ip_cidr_range = string disk_encryption_key = optional(string) consumer_accept_list = optional(list(string)) }))">map(object({…}))</code> | | <code>null</code> |
|
| [instances](variables.tf#L65) | Instances ([REGION] => [INSTANCE]). | <code title="map(object({ display_name = optional(string) description = optional(string, "Terraform-managed") runtime_ip_cidr_range = string troubleshooting_ip_cidr_range = string disk_encryption_key = optional(string) consumer_accept_list = optional(list(string)) enable_nat = optional(bool, false) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||||
| [organization](variables.tf#L75) | Apigee organization. If set to null the organization must already exist. | <code title="object({ display_name = optional(string) description = optional(string, "Terraform-managed") authorized_network = optional(string) runtime_type = optional(string, "CLOUD") billing_type = optional(string) database_encryption_key = optional(string) analytics_region = optional(string, "europe-west1") retention = optional(string) })">object({…})</code> | | <code>null</code> |
|
| [organization](variables.tf#L80) | Apigee organization. If set to null the organization must already exist. | <code title="object({ display_name = optional(string) description = optional(string, "Terraform-managed") authorized_network = optional(string) runtime_type = optional(string, "CLOUD") billing_type = optional(string) database_encryption_key = optional(string) analytics_region = optional(string, "europe-west1") retention = optional(string) })">object({…})</code> | | <code>null</code> |
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
|
@ -195,8 +196,9 @@ module "apigee" {
|
||||||
| [envgroups](outputs.tf#L22) | Environment groups. | |
|
| [envgroups](outputs.tf#L22) | Environment groups. | |
|
||||||
| [environments](outputs.tf#L27) | Environment. | |
|
| [environments](outputs.tf#L27) | Environment. | |
|
||||||
| [instances](outputs.tf#L32) | Instances. | |
|
| [instances](outputs.tf#L32) | Instances. | |
|
||||||
| [org_id](outputs.tf#L37) | Organization ID. | |
|
| [nat_ips](outputs.tf#L37) | NAT IP addresses used in instances. | |
|
||||||
| [org_name](outputs.tf#L42) | Organization name. | |
|
| [org_id](outputs.tf#L45) | Organization ID. | |
|
||||||
| [organization](outputs.tf#L47) | Organization. | |
|
| [org_name](outputs.tf#L50) | Organization name. | |
|
||||||
| [service_attachments](outputs.tf#L52) | Service attachments. | |
|
| [organization](outputs.tf#L55) | Organization. | |
|
||||||
|
| [service_attachments](outputs.tf#L60) | Service attachments. | |
|
||||||
<!-- END TFDOC -->
|
<!-- END TFDOC -->
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright 2022 Google LLC
|
* Copyright 2023 Google LLC
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -17,10 +17,6 @@
|
||||||
locals {
|
locals {
|
||||||
org_id = try(google_apigee_organization.organization[0].id, "organizations/${var.project_id}")
|
org_id = try(google_apigee_organization.organization[0].id, "organizations/${var.project_id}")
|
||||||
org_name = try(google_apigee_organization.organization[0].name, var.project_id)
|
org_name = try(google_apigee_organization.organization[0].name, var.project_id)
|
||||||
envgroups = coalesce(var.envgroups, {})
|
|
||||||
environments = coalesce(var.environments, {})
|
|
||||||
instances = coalesce(var.instances, {})
|
|
||||||
endpoint_attachments = coalesce(var.endpoint_attachments, {})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "google_apigee_organization" "organization" {
|
resource "google_apigee_organization" "organization" {
|
||||||
|
@ -35,14 +31,14 @@ resource "google_apigee_organization" "organization" {
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "google_apigee_envgroup" "envgroups" {
|
resource "google_apigee_envgroup" "envgroups" {
|
||||||
for_each = local.envgroups
|
for_each = var.envgroups
|
||||||
name = each.key
|
name = each.key
|
||||||
hostnames = each.value
|
hostnames = each.value
|
||||||
org_id = local.org_id
|
org_id = local.org_id
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "google_apigee_environment" "environments" {
|
resource "google_apigee_environment" "environments" {
|
||||||
for_each = local.environments
|
for_each = var.environments
|
||||||
name = each.key
|
name = each.key
|
||||||
display_name = each.value.display_name
|
display_name = each.value.display_name
|
||||||
description = each.value.description
|
description = each.value.description
|
||||||
|
@ -64,7 +60,7 @@ resource "google_apigee_environment" "environments" {
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "google_apigee_envgroup_attachment" "envgroup_attachments" {
|
resource "google_apigee_envgroup_attachment" "envgroup_attachments" {
|
||||||
for_each = merge(concat([for k1, v1 in local.environments : {
|
for_each = merge(concat([for k1, v1 in var.environments : {
|
||||||
for v2 in coalesce(v1.envgroups, []) : "${k1}-${v2}" => {
|
for v2 in coalesce(v1.envgroups, []) : "${k1}-${v2}" => {
|
||||||
environment = k1
|
environment = k1
|
||||||
envgroup = v2
|
envgroup = v2
|
||||||
|
@ -75,7 +71,7 @@ resource "google_apigee_envgroup_attachment" "envgroup_attachments" {
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "google_apigee_environment_iam_binding" "binding" {
|
resource "google_apigee_environment_iam_binding" "binding" {
|
||||||
for_each = merge(concat([for k1, v1 in local.environments : {
|
for_each = merge(concat([for k1, v1 in var.environments : {
|
||||||
for k2, v2 in coalesce(v1.iam, {}) : "${k1}-${k2}" => {
|
for k2, v2 in coalesce(v1.iam, {}) : "${k1}-${k2}" => {
|
||||||
environment = "${k1}"
|
environment = "${k1}"
|
||||||
role = k2
|
role = k2
|
||||||
|
@ -89,7 +85,7 @@ resource "google_apigee_environment_iam_binding" "binding" {
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "google_apigee_instance" "instances" {
|
resource "google_apigee_instance" "instances" {
|
||||||
for_each = local.instances
|
for_each = var.instances
|
||||||
name = "instance-${each.key}"
|
name = "instance-${each.key}"
|
||||||
display_name = each.value.display_name
|
display_name = each.value.display_name
|
||||||
description = each.value.description
|
description = each.value.description
|
||||||
|
@ -100,8 +96,18 @@ resource "google_apigee_instance" "instances" {
|
||||||
consumer_accept_list = each.value.consumer_accept_list
|
consumer_accept_list = each.value.consumer_accept_list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "google_apigee_nat_address" "apigee_nat" {
|
||||||
|
for_each = {
|
||||||
|
for k, v in var.instances :
|
||||||
|
k => google_apigee_instance.instances[k].id
|
||||||
|
if v.enable_nat
|
||||||
|
}
|
||||||
|
name = each.key
|
||||||
|
instance_id = each.value
|
||||||
|
}
|
||||||
|
|
||||||
resource "google_apigee_instance_attachment" "instance_attachments" {
|
resource "google_apigee_instance_attachment" "instance_attachments" {
|
||||||
for_each = merge(concat([for k1, v1 in local.environments : {
|
for_each = merge(concat([for k1, v1 in var.environments : {
|
||||||
for v2 in coalesce(v1.regions, []) :
|
for v2 in coalesce(v1.regions, []) :
|
||||||
"${k1}-${v2}" => {
|
"${k1}-${v2}" => {
|
||||||
environment = k1
|
environment = k1
|
||||||
|
@ -114,7 +120,7 @@ resource "google_apigee_instance_attachment" "instance_attachments" {
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "google_apigee_endpoint_attachment" "endpoint_attachments" {
|
resource "google_apigee_endpoint_attachment" "endpoint_attachments" {
|
||||||
for_each = local.endpoint_attachments
|
for_each = var.endpoint_attachments
|
||||||
org_id = local.org_id
|
org_id = local.org_id
|
||||||
endpoint_attachment_id = each.key
|
endpoint_attachment_id = each.key
|
||||||
location = each.value.region
|
location = each.value.region
|
||||||
|
@ -122,10 +128,9 @@ resource "google_apigee_endpoint_attachment" "endpoint_attachments" {
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "google_apigee_addons_config" "test_organization" {
|
resource "google_apigee_addons_config" "test_organization" {
|
||||||
|
for_each = toset(var.addons_config == null ? [] : [""])
|
||||||
org = local.org_name
|
org = local.org_name
|
||||||
dynamic "addons_config" {
|
addons_config {
|
||||||
for_each = var.addons_config == null ? [] : [""]
|
|
||||||
content {
|
|
||||||
dynamic "advanced_api_ops_config" {
|
dynamic "advanced_api_ops_config" {
|
||||||
for_each = var.addons_config.advanced_api_ops ? [] : [""]
|
for_each = var.addons_config.advanced_api_ops ? [] : [""]
|
||||||
content {
|
content {
|
||||||
|
@ -157,5 +162,4 @@ resource "google_apigee_addons_config" "test_organization" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright 2022 Google LLC
|
* Copyright 2023 Google LLC
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -34,6 +34,14 @@ output "instances" {
|
||||||
value = try(google_apigee_instance.instances, null)
|
value = try(google_apigee_instance.instances, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output "nat_ips" {
|
||||||
|
description = "NAT IP addresses used in instances."
|
||||||
|
value = {
|
||||||
|
for k, v in google_apigee_nat_address.apigee_nat :
|
||||||
|
k => v.ip_address
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
output "org_id" {
|
output "org_id" {
|
||||||
description = "Organization ID."
|
description = "Organization ID."
|
||||||
value = local.org_id
|
value = local.org_id
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright 2022 Google LLC
|
* Copyright 2023 Google LLC
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -32,13 +32,15 @@ variable "endpoint_attachments" {
|
||||||
region = string
|
region = string
|
||||||
service_attachment = string
|
service_attachment = string
|
||||||
}))
|
}))
|
||||||
default = null
|
default = {}
|
||||||
|
nullable = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "envgroups" {
|
variable "envgroups" {
|
||||||
description = "Environment groups (NAME => [HOSTNAMES])."
|
description = "Environment groups (NAME => [HOSTNAMES])."
|
||||||
type = map(list(string))
|
type = map(list(string))
|
||||||
default = null
|
default = {}
|
||||||
|
nullable = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "environments" {
|
variable "environments" {
|
||||||
|
@ -56,7 +58,8 @@ variable "environments" {
|
||||||
envgroups = optional(list(string))
|
envgroups = optional(list(string))
|
||||||
regions = optional(list(string))
|
regions = optional(list(string))
|
||||||
}))
|
}))
|
||||||
default = null
|
default = {}
|
||||||
|
nullable = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "instances" {
|
variable "instances" {
|
||||||
|
@ -68,8 +71,10 @@ variable "instances" {
|
||||||
troubleshooting_ip_cidr_range = string
|
troubleshooting_ip_cidr_range = string
|
||||||
disk_encryption_key = optional(string)
|
disk_encryption_key = optional(string)
|
||||||
consumer_accept_list = optional(list(string))
|
consumer_accept_list = optional(list(string))
|
||||||
|
enable_nat = optional(bool, false)
|
||||||
}))
|
}))
|
||||||
default = null
|
default = {}
|
||||||
|
nullable = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "organization" {
|
variable "organization" {
|
||||||
|
|
|
@ -183,36 +183,36 @@ module "db" {
|
||||||
# tftest modules=1 resources=1 inventory=insights.yaml
|
# tftest modules=1 resources=1 inventory=insights.yaml
|
||||||
```
|
```
|
||||||
<!-- BEGIN TFDOC -->
|
<!-- BEGIN TFDOC -->
|
||||||
|
|
||||||
## Variables
|
## Variables
|
||||||
|
|
||||||
| name | description | type | required | default |
|
| name | description | type | required | default |
|
||||||
|---|---|:---:|:---:|:---:|
|
|---|---|:---:|:---:|:---:|
|
||||||
| [database_version](variables.tf#L61) | Database type and version to create. | <code>string</code> | ✓ | |
|
| [database_version](variables.tf#L71) | Database type and version to create. | <code>string</code> | ✓ | |
|
||||||
| [name](variables.tf#L125) | Name of primary instance. | <code>string</code> | ✓ | |
|
| [name](variables.tf#L135) | Name of primary instance. | <code>string</code> | ✓ | |
|
||||||
| [network](variables.tf#L130) | VPC self link where the instances will be deployed. Private Service Networking must be enabled and configured in this VPC. | <code>string</code> | ✓ | |
|
| [network](variables.tf#L140) | VPC self link where the instances will be deployed. Private Service Networking must be enabled and configured in this VPC. | <code>string</code> | ✓ | |
|
||||||
| [project_id](variables.tf#L151) | The ID of the project where this instances will be created. | <code>string</code> | ✓ | |
|
| [project_id](variables.tf#L161) | The ID of the project where this instances will be created. | <code>string</code> | ✓ | |
|
||||||
| [region](variables.tf#L156) | Region of the primary instance. | <code>string</code> | ✓ | |
|
| [region](variables.tf#L166) | Region of the primary instance. | <code>string</code> | ✓ | |
|
||||||
| [tier](variables.tf#L182) | The machine type to use for the instances. | <code>string</code> | ✓ | |
|
| [tier](variables.tf#L192) | The machine type to use for the instances. | <code>string</code> | ✓ | |
|
||||||
| [allocated_ip_ranges](variables.tf#L17) | (Optional)The name of the allocated ip range for the private ip CloudSQL instance. For example: \"google-managed-services-default\". If set, the instance ip will be created in the allocated range. The range name must comply with RFC 1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z?. | <code title="object({ primary = optional(string) replica = optional(string) })">object({…})</code> | | <code>{}</code> |
|
| [activation_policy](variables.tf#L16) | This variable specifies when the instance should be active. Can be either ALWAYS, NEVER or ON_DEMAND. Default is ALWAYS. | <code>string</code> | | <code>"ALWAYS"</code> |
|
||||||
| [authorized_networks](variables.tf#L26) | Map of NAME=>CIDR_RANGE to allow to connect to the database(s). | <code>map(string)</code> | | <code>null</code> |
|
| [allocated_ip_ranges](variables.tf#L27) | (Optional)The name of the allocated ip range for the private ip CloudSQL instance. For example: \"google-managed-services-default\". If set, the instance ip will be created in the allocated range. The range name must comply with RFC 1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z?. | <code title="object({ primary = optional(string) replica = optional(string) })">object({…})</code> | | <code>{}</code> |
|
||||||
| [availability_type](variables.tf#L32) | Availability type for the primary replica. Either `ZONAL` or `REGIONAL`. | <code>string</code> | | <code>"ZONAL"</code> |
|
| [authorized_networks](variables.tf#L36) | Map of NAME=>CIDR_RANGE to allow to connect to the database(s). | <code>map(string)</code> | | <code>null</code> |
|
||||||
| [backup_configuration](variables.tf#L38) | Backup settings for primary instance. Will be automatically enabled if using MySQL with one or more replicas. | <code title="object({ enabled = optional(bool, false) binary_log_enabled = optional(bool, false) start_time = optional(string, "23:00") location = optional(string) log_retention_days = optional(number, 7) point_in_time_recovery_enabled = optional(bool) retention_count = optional(number, 7) })">object({…})</code> | | <code title="{ enabled = false binary_log_enabled = false start_time = "23:00" location = null log_retention_days = 7 point_in_time_recovery_enabled = null retention_count = 7 }">{…}</code> |
|
| [availability_type](variables.tf#L42) | Availability type for the primary replica. Either `ZONAL` or `REGIONAL`. | <code>string</code> | | <code>"ZONAL"</code> |
|
||||||
| [databases](variables.tf#L66) | Databases to create once the primary instance is created. | <code>list(string)</code> | | <code>null</code> |
|
| [backup_configuration](variables.tf#L48) | Backup settings for primary instance. Will be automatically enabled if using MySQL with one or more replicas. | <code title="object({ enabled = optional(bool, false) binary_log_enabled = optional(bool, false) start_time = optional(string, "23:00") location = optional(string) log_retention_days = optional(number, 7) point_in_time_recovery_enabled = optional(bool) retention_count = optional(number, 7) })">object({…})</code> | | <code title="{ enabled = false binary_log_enabled = false start_time = "23:00" location = null log_retention_days = 7 point_in_time_recovery_enabled = null retention_count = 7 }">{…}</code> |
|
||||||
| [deletion_protection](variables.tf#L72) | Allow terraform to delete instances. | <code>bool</code> | | <code>false</code> |
|
| [databases](variables.tf#L76) | Databases to create once the primary instance is created. | <code>list(string)</code> | | <code>null</code> |
|
||||||
| [disk_size](variables.tf#L78) | Disk size in GB. Set to null to enable autoresize. | <code>number</code> | | <code>null</code> |
|
| [deletion_protection](variables.tf#L82) | Allow terraform to delete instances. | <code>bool</code> | | <code>false</code> |
|
||||||
| [disk_type](variables.tf#L84) | The type of data disk: `PD_SSD` or `PD_HDD`. | <code>string</code> | | <code>"PD_SSD"</code> |
|
| [disk_size](variables.tf#L88) | Disk size in GB. Set to null to enable autoresize. | <code>number</code> | | <code>null</code> |
|
||||||
| [encryption_key_name](variables.tf#L90) | The full path to the encryption key used for the CMEK disk encryption of the primary instance. | <code>string</code> | | <code>null</code> |
|
| [disk_type](variables.tf#L94) | The type of data disk: `PD_SSD` or `PD_HDD`. | <code>string</code> | | <code>"PD_SSD"</code> |
|
||||||
| [flags](variables.tf#L96) | Map FLAG_NAME=>VALUE for database-specific tuning. | <code>map(string)</code> | | <code>null</code> |
|
| [encryption_key_name](variables.tf#L100) | The full path to the encryption key used for the CMEK disk encryption of the primary instance. | <code>string</code> | | <code>null</code> |
|
||||||
| [insights_config](variables.tf#L102) | Query Insights configuration. Defaults to null which disables Query Insights. | <code title="object({ query_string_length = optional(number, 1024) record_application_tags = optional(bool, false) record_client_address = optional(bool, false) query_plans_per_minute = optional(number, 5) })">object({…})</code> | | <code>null</code> |
|
| [flags](variables.tf#L106) | Map FLAG_NAME=>VALUE for database-specific tuning. | <code>map(string)</code> | | <code>null</code> |
|
||||||
| [ipv4_enabled](variables.tf#L113) | Add a public IP address to database instance. | <code>bool</code> | | <code>false</code> |
|
| [insights_config](variables.tf#L112) | Query Insights configuration. Defaults to null which disables Query Insights. | <code title="object({ query_string_length = optional(number, 1024) record_application_tags = optional(bool, false) record_client_address = optional(bool, false) query_plans_per_minute = optional(number, 5) })">object({…})</code> | | <code>null</code> |
|
||||||
| [labels](variables.tf#L119) | Labels to be attached to all instances. | <code>map(string)</code> | | <code>null</code> |
|
| [ipv4_enabled](variables.tf#L123) | Add a public IP address to database instance. | <code>bool</code> | | <code>false</code> |
|
||||||
| [postgres_client_certificates](variables.tf#L135) | Map of cert keys connect to the application(s) using public IP. | <code>list(string)</code> | | <code>null</code> |
|
| [labels](variables.tf#L129) | Labels to be attached to all instances. | <code>map(string)</code> | | <code>null</code> |
|
||||||
| [prefix](variables.tf#L141) | Optional prefix used to generate instance names. | <code>string</code> | | <code>null</code> |
|
| [postgres_client_certificates](variables.tf#L145) | Map of cert keys connect to the application(s) using public IP. | <code>list(string)</code> | | <code>null</code> |
|
||||||
| [replicas](variables.tf#L161) | Map of NAME=> {REGION, KMS_KEY} for additional read replicas. Set to null to disable replica creation. | <code title="map(object({ region = string encryption_key_name = string }))">map(object({…}))</code> | | <code>{}</code> |
|
| [prefix](variables.tf#L151) | Optional prefix used to generate instance names. | <code>string</code> | | <code>null</code> |
|
||||||
| [require_ssl](variables.tf#L170) | Enable SSL connections only. | <code>bool</code> | | <code>null</code> |
|
| [replicas](variables.tf#L171) | Map of NAME=> {REGION, KMS_KEY} for additional read replicas. Set to null to disable replica creation. | <code title="map(object({ region = string encryption_key_name = string }))">map(object({…}))</code> | | <code>{}</code> |
|
||||||
| [root_password](variables.tf#L176) | Root password of the Cloud SQL instance. Required for MS SQL Server. | <code>string</code> | | <code>null</code> |
|
| [require_ssl](variables.tf#L180) | Enable SSL connections only. | <code>bool</code> | | <code>null</code> |
|
||||||
| [users](variables.tf#L187) | Map of users to create in the primary instance (and replicated to other replicas) in the format USER=>PASSWORD. For MySQL, anything afterr the first `@` (if persent) will be used as the user's host. Set PASSWORD to null if you want to get an autogenerated password. | <code>map(string)</code> | | <code>null</code> |
|
| [root_password](variables.tf#L186) | Root password of the Cloud SQL instance. Required for MS SQL Server. | <code>string</code> | | <code>null</code> |
|
||||||
|
| [users](variables.tf#L197) | Map of users to create in the primary instance (and replicated to other replicas) in the format USER=>PASSWORD. For MySQL, anything afterr the first `@` (if persent) will be used as the user's host. Set PASSWORD to null if you want to get an autogenerated password. | <code>map(string)</code> | | <code>null</code> |
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
|
@ -231,5 +231,4 @@ module "db" {
|
||||||
| [self_link](outputs.tf#L88) | Self link of the primary instance. | |
|
| [self_link](outputs.tf#L88) | Self link of the primary instance. | |
|
||||||
| [self_links](outputs.tf#L93) | Self links of all instances. | |
|
| [self_links](outputs.tf#L93) | Self links of all instances. | |
|
||||||
| [user_passwords](outputs.tf#L101) | Map of containing the password of all users created through terraform. | ✓ |
|
| [user_passwords](outputs.tf#L101) | Map of containing the password of all users created through terraform. | ✓ |
|
||||||
|
|
||||||
<!-- END TFDOC -->
|
<!-- END TFDOC -->
|
||||||
|
|
|
@ -59,6 +59,7 @@ resource "google_sql_database_instance" "primary" {
|
||||||
disk_type = var.disk_type
|
disk_type = var.disk_type
|
||||||
availability_type = var.availability_type
|
availability_type = var.availability_type
|
||||||
user_labels = var.labels
|
user_labels = var.labels
|
||||||
|
activation_policy = var.activation_policy
|
||||||
|
|
||||||
ip_configuration {
|
ip_configuration {
|
||||||
ipv4_enabled = var.ipv4_enabled
|
ipv4_enabled = var.ipv4_enabled
|
||||||
|
@ -138,6 +139,7 @@ resource "google_sql_database_instance" "replicas" {
|
||||||
disk_type = var.disk_type
|
disk_type = var.disk_type
|
||||||
# availability_type = var.availability_type
|
# availability_type = var.availability_type
|
||||||
user_labels = var.labels
|
user_labels = var.labels
|
||||||
|
activation_policy = var.activation_policy
|
||||||
|
|
||||||
ip_configuration {
|
ip_configuration {
|
||||||
ipv4_enabled = var.ipv4_enabled
|
ipv4_enabled = var.ipv4_enabled
|
||||||
|
|
|
@ -13,6 +13,16 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
variable "activation_policy" {
|
||||||
|
description = "This variable specifies when the instance should be active. Can be either ALWAYS, NEVER or ON_DEMAND. Default is ALWAYS."
|
||||||
|
type = string
|
||||||
|
default = "ALWAYS"
|
||||||
|
validation {
|
||||||
|
condition = var.activation_policy == "NEVER" || var.activation_policy == "ON_DEMAND" || var.activation_policy == "ALWAYS"
|
||||||
|
error_message = "The variable activation_policy must be ALWAYS, NEVER or ON_DEMAND."
|
||||||
|
}
|
||||||
|
nullable = false
|
||||||
|
}
|
||||||
|
|
||||||
variable "allocated_ip_ranges" {
|
variable "allocated_ip_ranges" {
|
||||||
description = "(Optional)The name of the allocated ip range for the private ip CloudSQL instance. For example: \"google-managed-services-default\". If set, the instance ip will be created in the allocated range. The range name must comply with RFC 1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z?."
|
description = "(Optional)The name of the allocated ip range for the private ip CloudSQL instance. For example: \"google-managed-services-default\". If set, the instance ip will be created in the allocated range. The range name must comply with RFC 1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z?."
|
||||||
|
@ -189,3 +199,4 @@ variable "users" {
|
||||||
type = map(string)
|
type = map(string)
|
||||||
default = null
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -235,14 +235,14 @@ icmp:
|
||||||
|
|
||||||
| name | description | type | required | default |
|
| name | description | type | required | default |
|
||||||
|---|---|:---:|:---:|:---:|
|
|---|---|:---:|:---:|:---:|
|
||||||
| [name](variables.tf#L113) | Policy name. | <code>string</code> | ✓ | |
|
| [name](variables.tf#L100) | Policy name. | <code>string</code> | ✓ | |
|
||||||
| [parent_id](variables.tf#L119) | Parent node where the policy will be created, `folders/nnn` or `organizations/nnn` for hierarchical policy, project id for a network policy. | <code>string</code> | ✓ | |
|
| [parent_id](variables.tf#L106) | Parent node where the policy will be created, `folders/nnn` or `organizations/nnn` for hierarchical policy, project id for a network policy. | <code>string</code> | ✓ | |
|
||||||
| [attachments](variables.tf#L17) | Ids of the resources to which this policy will be attached, in descriptive name => self link format. Specify folders or organization for hierarchical policy, VPCs for network policy. | <code>map(string)</code> | | <code>{}</code> |
|
| [attachments](variables.tf#L17) | Ids of the resources to which this policy will be attached, in descriptive name => self link format. Specify folders or organization for hierarchical policy, VPCs for network policy. | <code>map(string)</code> | | <code>{}</code> |
|
||||||
| [description](variables.tf#L24) | Policy description. | <code>string</code> | | <code>null</code> |
|
| [description](variables.tf#L24) | Policy description. | <code>string</code> | | <code>null</code> |
|
||||||
| [egress_rules](variables.tf#L30) | List of egress rule definitions, action can be 'allow', 'deny', 'goto_next'. The match.layer4configs map is in protocol => optional [ports] format. | <code title="map(object({ priority = number action = optional(string, "deny") description = optional(string) disabled = optional(bool, false) enable_logging = optional(bool) target_service_accounts = optional(list(string)) target_tags = optional(list(string)) match = object({ address_groups = optional(list(string)) fqdns = optional(list(string)) region_codes = optional(list(string)) threat_intelligences = optional(list(string)) destination_ranges = optional(list(string)) source_ranges = optional(list(string)) source_tags = optional(list(string)) layer4_configs = optional(list(object({ protocol = optional(string, "all") ports = optional(list(string)) })), [{}]) }) }))">map(object({…}))</code> | | <code>{}</code> |
|
| [egress_rules](variables.tf#L30) | List of egress rule definitions, action can be 'allow', 'deny', 'goto_next'. The match.layer4configs map is in protocol => optional [ports] format. | <code title="map(object({ priority = number action = optional(string, "deny") description = optional(string) disabled = optional(bool, false) enable_logging = optional(bool) target_service_accounts = optional(list(string)) target_tags = optional(list(string)) match = object({ address_groups = optional(list(string)) fqdns = optional(list(string)) region_codes = optional(list(string)) threat_intelligences = optional(list(string)) destination_ranges = optional(list(string)) source_ranges = optional(list(string)) source_tags = optional(list(string)) layer4_configs = optional(list(object({ protocol = optional(string, "all") ports = optional(list(string)) })), [{}]) }) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||||
| [ingress_rules](variables.tf#L71) | List of ingress rule definitions, action can be 'allow', 'deny', 'goto_next'. | <code title="map(object({ priority = number action = optional(string, "allow") description = optional(string) disabled = optional(bool, false) enable_logging = optional(bool) target_service_accounts = optional(list(string)) target_tags = optional(list(string)) match = object({ address_groups = optional(list(string)) fqdns = optional(list(string)) region_codes = optional(list(string)) threat_intelligences = optional(list(string)) destination_ranges = optional(list(string)) source_ranges = optional(list(string)) source_tags = optional(list(string)) layer4_configs = optional(list(object({ protocol = optional(string, "all") ports = optional(list(string)) })), [{}]) }) }))">map(object({…}))</code> | | <code>{}</code> |
|
| [ingress_rules](variables.tf#L65) | List of ingress rule definitions, action can be 'allow', 'deny', 'goto_next'. | <code title="map(object({ priority = number action = optional(string, "allow") description = optional(string) disabled = optional(bool, false) enable_logging = optional(bool) target_service_accounts = optional(list(string)) target_tags = optional(list(string)) match = object({ address_groups = optional(list(string)) fqdns = optional(list(string)) region_codes = optional(list(string)) threat_intelligences = optional(list(string)) destination_ranges = optional(list(string)) source_ranges = optional(list(string)) source_tags = optional(list(string)) layer4_configs = optional(list(object({ protocol = optional(string, "all") ports = optional(list(string)) })), [{}]) }) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||||
| [region](variables.tf#L125) | Policy region. Leave null for hierarchical policy, set to 'global' for a global network policy. | <code>string</code> | | <code>null</code> |
|
| [region](variables.tf#L112) | Policy region. Leave null for hierarchical policy, set to 'global' for a global network policy. | <code>string</code> | | <code>null</code> |
|
||||||
| [rules_factory_config](variables.tf#L131) | Configuration for the optional rules factory. | <code title="object({ cidr_file_path = optional(string) egress_rules_file_path = optional(string) ingress_rules_file_path = optional(string) })">object({…})</code> | | <code>{}</code> |
|
| [rules_factory_config](variables.tf#L118) | Configuration for the optional rules factory. | <code title="object({ cidr_file_path = optional(string) egress_rules_file_path = optional(string) ingress_rules_file_path = optional(string) })">object({…})</code> | | <code>{}</code> |
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
|
|
|
@ -53,12 +53,6 @@ variable "egress_rules" {
|
||||||
}))
|
}))
|
||||||
default = {}
|
default = {}
|
||||||
nullable = false
|
nullable = false
|
||||||
validation {
|
|
||||||
condition = alltrue([
|
|
||||||
for k, v in var.egress_rules : v.match.destination_ranges != null
|
|
||||||
])
|
|
||||||
error_message = "Engress rules need destination ranges."
|
|
||||||
}
|
|
||||||
validation {
|
validation {
|
||||||
condition = alltrue([
|
condition = alltrue([
|
||||||
for k, v in var.egress_rules :
|
for k, v in var.egress_rules :
|
||||||
|
@ -94,13 +88,6 @@ variable "ingress_rules" {
|
||||||
}))
|
}))
|
||||||
default = {}
|
default = {}
|
||||||
nullable = false
|
nullable = false
|
||||||
validation {
|
|
||||||
condition = alltrue([
|
|
||||||
for k, v in var.ingress_rules :
|
|
||||||
v.match.source_ranges != null || v.match.source_tags != null
|
|
||||||
])
|
|
||||||
error_message = "Ingress rules need source ranges or tags."
|
|
||||||
}
|
|
||||||
validation {
|
validation {
|
||||||
condition = alltrue([
|
condition = alltrue([
|
||||||
for k, v in var.ingress_rules :
|
for k, v in var.ingress_rules :
|
||||||
|
|
Loading…
Reference in New Issue