Merge remote-tracking branch 'origin/master' into fast-dev

This commit is contained in:
Ludo
2025-06-21 17:37:53 +02:00
26 changed files with 197 additions and 140 deletions

View File

@@ -34,7 +34,7 @@ Currently available modules:
- **networking** - [DNS](./modules/dns), [DNS Response Policy](./modules/dns-response-policy/), [Cloud Endpoints](./modules/endpoints), [address reservation](./modules/net-address), [NAT](./modules/net-cloudnat), [VLAN Attachment](./modules/net-vlan-attachment/), [External Application LB](./modules/net-lb-app-ext/), [External Passthrough Network LB](./modules/net-lb-ext), [External Regional Application Load Balancer](./modules/net-lb-app-ext-regional/), [Firewall policy](./modules/net-firewall-policy), [Internal Application LB](./modules/net-lb-app-int), [Cross-region Internal Application LB](./modules/net-lb-app-int-cross-region), [Internal Passthrough Network LB](./modules/net-lb-int), [Internal Proxy Network LB](./modules/net-lb-proxy-int), [IPSec over Interconnect](./modules/net-ipsec-over-interconnect), [VPC](./modules/net-vpc), [VPC factory](./modules/net-vpc-factory/README.md), [VPC firewall](./modules/net-vpc-firewall), [VPC peering](./modules/net-vpc-peering), [VPN dynamic](./modules/net-vpn-dynamic), [HA VPN](./modules/net-vpn-ha), [VPN static](./modules/net-vpn-static), [Service Directory](./modules/service-directory), [Secure Web Proxy](./modules/net-swp)
- **compute** - [VM/VM group](./modules/compute-vm), [MIG](./modules/compute-mig), [COS container](./modules/cloud-config-container/cos-generic-metadata/) (coredns, mysql, onprem, squid), [GKE cluster](./modules/gke-cluster-standard), [GKE hub](./modules/gke-hub), [GKE nodepool](./modules/gke-nodepool), [GCVE private cloud](./modules/gcve-private-cloud)
- **data** - [AlloyDB instance](./modules/alloydb), [Analytics Hub](./modules/analytics-hub), [BigQuery dataset](./modules/bigquery-dataset), [Biglake Catalog](./modules/biglake-catalog), [Bigtable instance](./modules/bigtable-instance), [Dataplex](./modules/dataplex), [Dataplex Aspect Types](./modules/dataplex-aspect-types/), [Dataplex DataScan](./modules/dataplex-datascan), [Cloud SQL instance](./modules/cloudsql-instance), [Spanner instance](./modules/spanner-instance), [Firestore](./modules/firestore), [Data Catalog Policy Tag](./modules/data-catalog-policy-tag), [Data Catalog Tag](./modules/data-catalog-tag), [Data Catalog Tag Template](./modules/data-catalog-tag-template), [Datafusion](./modules/datafusion), [Dataproc](./modules/dataproc), [GCS](./modules/gcs), [Pub/Sub](./modules/pubsub), [Dataform Repository](./modules/dataform-repository/), [Looker Core](./modules/looker-core)
- **AI** - [Agentspace](./modules/agentspace/README.md)
- **AI** - [AI Applications](./modules/ai-applications/README.md)
- **development** - [API Gateway](./modules/api-gateway), [Apigee](./modules/apigee), [Artifact Registry](./modules/artifact-registry), [Container Registry](./modules/container-registry), [Cloud Source Repository](./modules/source-repository), [Secure Source Manager instance](./modules/secure-source-manager-instance), [Workstation cluster](./modules/workstation-cluster)
- **security** - [Binauthz](./modules/binauthz/), [Certificate Authority Service (CAS)](./modules/certificate-authority-service), [KMS](./modules/kms), [SecretManager](./modules/secret-manager), [VPC Service Control](./modules/vpc-sc), [Certificate Manager](./modules/certificate-manager/)
- **serverless** - [Cloud Function v1](./modules/cloud-function-v1), [Cloud Function v2](./modules/cloud-function-v2), [Cloud Run](./modules/cloud-run), [Cloud Run v2](./modules/cloud-run-v2)

View File

@@ -54,7 +54,7 @@ iam.serviceAccountKeyExposureResponse:
rules:
- allow:
values:
- DISABLE_KEY
- is:DISABLE_KEY
iam.workloadIdentityPoolAwsAccounts:
rules:

View File

@@ -114,7 +114,7 @@ compute.restrictProtocolForwardingCreationForTypes:
rules:
- allow:
values:
- INTERNAL
- is:INTERNAL
# compute.restrictSharedVpcHostProjects:
# rules:

View File

@@ -22,7 +22,7 @@ iam.allowedPolicyMemberDomains:
rules:
- allow:
values:
- ${organization.customer_id}
- is:${organization.customer_id}
condition:
title: Restrict member domains
expression: |
@@ -54,7 +54,7 @@ iam.serviceAccountKeyExposureResponse:
rules:
- allow:
values:
- DISABLE_KEY
- is:DISABLE_KEY
iam.workloadIdentityPoolAwsAccounts:
rules:

View File

@@ -43,13 +43,13 @@ module "organization" {
# they are managed authoritatively and will break multitenant stages
tags = merge(local.tags, {
(var.tag_names.context) = {
description = "Resource management context."
iam = try(local.tags.context.iam, {})
description = try(local.tags[var.tag_names.context].description, "Resource management context.")
iam = try(local.tags[var.tag_names.context].iam, {})
values = local.context_tag_values
},
(var.tag_names.environment) = {
description = "Environment definition."
iam = try(local.tags.environment.iam, {})
description = try(local.tags[var.tag_names.environment].description, "Environment definition.")
iam = try(local.tags[var.tag_names.environment].iam, {})
values = local.environment_tag_values
}
})

View File

@@ -199,7 +199,7 @@ module "stage2-folder" {
}
org_policies = each.value.folder_config.org_policies
tag_bindings = merge({
context = local.tag_values["context/${each.key}"].id
(var.tag_names.context) = local.tag_values["${var.tag_names.context}/${each.key}"].id
}, {
for k, v in each.value.folder_config.tag_bindings : k => try(
local.tag_values[v].id, v
@@ -216,7 +216,7 @@ module "stage2-folder-env" {
parent = module.stage2-folder[each.value.stage].id
name = each.value.name
tag_bindings = {
environment = try(
(var.tag_names.environment) = try(
local.tag_values["${var.tag_names.environment}/${each.value.tag_name}"].id,
null
)

View File

@@ -154,7 +154,7 @@ module "stage3-folder" {
org_policies = each.value.folder_config.org_policies
tag_bindings = merge(
{
environment = local.tag_values["environment/${var.environments[each.value.environment].tag_name}"].id
(var.tag_names.environment) = local.tag_values["${var.tag_names.environment}/${var.environments[each.value.environment].tag_name}"].id
},
{
for k, v in each.value.folder_config.tag_bindings : k => try(

View File

@@ -1,4 +1,4 @@
# Shared security resources and VPC Service Controls
# Shared security resources
This stage sets up an area dedicated to hosting security resources and configurations which impact the whole organization, or are shared across the hierarchy to other projects and teams.

View File

@@ -1,88 +0,0 @@
# skip boilerplate check
- accessapproval.googleapis.com
- adsdatahub.googleapis.com
- aiplatform.googleapis.com
- alpha-documentai.googleapis.com
- apigee.googleapis.com
- apigeeconnect.googleapis.com
- artifactregistry.googleapis.com
- assuredworkloads.googleapis.com
- automl.googleapis.com
- bigquery.googleapis.com
- bigquerydatatransfer.googleapis.com
- bigtable.googleapis.com
- binaryauthorization.googleapis.com
- cloudasset.googleapis.com
- cloudbuild.googleapis.com
- cloudfunctions.googleapis.com
- cloudkms.googleapis.com
- cloudprofiler.googleapis.com
- cloudresourcemanager.googleapis.com
- cloudsearch.googleapis.com
- cloudtrace.googleapis.com
- composer.googleapis.com
- compute.googleapis.com
- connectgateway.googleapis.com
- contactcenterinsights.googleapis.com
- container.googleapis.com
- containeranalysis.googleapis.com
- containerregistry.googleapis.com
- containerthreatdetection.googleapis.com
- datacatalog.googleapis.com
- dataflow.googleapis.com
- datafusion.googleapis.com
- dataproc.googleapis.com
- datastream.googleapis.com
- dialogflow.googleapis.com
- dlp.googleapis.com
- dns.googleapis.com
- documentai.googleapis.com
- eventarc.googleapis.com
- file.googleapis.com
- gameservices.googleapis.com
- gkeconnect.googleapis.com
- gkehub.googleapis.com
- healthcare.googleapis.com
- iam.googleapis.com
- iaptunnel.googleapis.com
- language.googleapis.com
- lifesciences.googleapis.com
- logging.googleapis.com
- managedidentities.googleapis.com
- memcache.googleapis.com
- meshca.googleapis.com
- metastore.googleapis.com
- ml.googleapis.com
- monitoring.googleapis.com
- networkconnectivity.googleapis.com
- networkmanagement.googleapis.com
- networksecurity.googleapis.com
- networkservices.googleapis.com
- notebooks.googleapis.com
- opsconfigmonitoring.googleapis.com
- osconfig.googleapis.com
- oslogin.googleapis.com
- privateca.googleapis.com
- pubsub.googleapis.com
- pubsublite.googleapis.com
- recaptchaenterprise.googleapis.com
- recommender.googleapis.com
- redis.googleapis.com
- run.googleapis.com
- secretmanager.googleapis.com
- servicecontrol.googleapis.com
- servicedirectory.googleapis.com
- spanner.googleapis.com
- speakerid.googleapis.com
- speech.googleapis.com
- sqladmin.googleapis.com
- storage.googleapis.com
- storagetransfer.googleapis.com
- texttospeech.googleapis.com
- tpu.googleapis.com
- trafficdirector.googleapis.com
- transcoder.googleapis.com
- translate.googleapis.com
- videointelligence.googleapis.com
- vision.googleapis.com
- vpcaccess.googleapis.com

View File

@@ -103,7 +103,7 @@ These modules are used in the examples included in this repository. If you are u
## AI
- [Agentspace](./agentspace/README.md)
- [AI Applications](./ai-applications/README.md)
## Development

View File

@@ -1,9 +1,9 @@
# Agentspace
# AI Applications
This module handles the creation of Agentspace data sources, engines and related configurations.
This module handles the creation of [AI Applications](https://cloud.google.com/generative-ai-app-builder/docs/introduction) data sources, engines and related configurations.
<!-- TOC -->
* [Agentspace module](#agentspace)
* [AI Applications module](#ai-applications)
* [APIs](#apis)
* [Quota Project](#quota-project)
* [Examples](#examples)
@@ -38,8 +38,8 @@ export USER_PROJECT_OVERRIDE=true
This is a minimal example to create a Chat Engine agent.
```hcl
module "agentspace" {
source = "./fabric/modules/agentspace"
module "ai-applications" {
source = "./fabric/modules/ai-applications"
name = "my-chat-app"
project_id = var.project_id
data_stores_configs = {
@@ -66,8 +66,8 @@ module "agentspace" {
This is a minimal example to create a Search Engine agent.
```hcl
module "agentspace" {
source = "./fabric/modules/agentspace"
module "ai-applications" {
source = "./fabric/modules/ai-applications"
name = "my-search-app"
project_id = var.project_id
data_stores_configs = {
@@ -90,8 +90,8 @@ module "agentspace" {
By default services are deployed globally. You optionally specify a region where to deploy them.
```hcl
module "agentspace" {
source = "./fabric/modules/agentspace"
module "ai-applications" {
source = "./fabric/modules/ai-applications"
name = "my-chat-app"
project_id = var.project_id
location = var.region
@@ -119,8 +119,8 @@ module "agentspace" {
You can reference from engines existing data sources created outside this module, by passing their ids. In this case, you'll need to configure in the engine valid `industry_vertical` and `location`.
```hcl
module "agentspace" {
source = "./fabric/modules/agentspace"
module "ai-applications" {
source = "./fabric/modules/ai-applications"
name = "my-search-app"
project_id = var.project_id
engines_configs = {
@@ -141,8 +141,8 @@ module "agentspace" {
You can create and connect from your engines multiple data stores.
```hcl
module "agentspace" {
source = "./fabric/modules/agentspace"
module "ai-applications" {
source = "./fabric/modules/ai-applications"
name = "my-chat-app"
project_id = var.project_id
data_stores_configs = {
@@ -176,8 +176,8 @@ module "agentspace" {
You can configure JSON data store schema definitions directly in your data store configuration.
```hcl
module "agentspace" {
source = "./fabric/modules/agentspace"
module "ai-applications" {
source = "./fabric/modules/ai-applications"
name = "my-search-app"
project_id = var.project_id
data_stores_configs = {
@@ -195,8 +195,8 @@ module "agentspace" {
You can make data stores point to multiple websites and optionally specify their sitemap.
```hcl
module "agentspace" {
source = "./fabric/modules/agentspace"
module "ai-applications" {
source = "./fabric/modules/ai-applications"
name = "my-search-app"
project_id = var.project_id
data_stores_configs = {
@@ -210,7 +210,7 @@ module "agentspace" {
}
exclude-one-page = {
exact_match = true
provided_uri_pattern = "https://cloud.google.com/agentspace"
provided_uri_pattern = "https://cloud.google.com/ai-applications"
type = "EXCLUDE"
}
}
@@ -236,8 +236,8 @@ module "agentspace" {
|---|---|:---:|:---:|:---:|
| [name](variables.tf#L159) | The name of the resources. | <code>string</code> | ✓ | |
| [project_id](variables.tf#L165) | The ID of the project where the data stores and the agents will be created. | <code>string</code> | ✓ | |
| [data_stores_configs](variables.tf#L17) | The Agentspace datastore configurations. | <code title="map&#40;object&#40;&#123;&#10; advanced_site_search_config &#61; optional&#40;object&#40;&#123;&#10; disable_initial_index &#61; optional&#40;bool&#41;&#10; disable_automatic_refresh &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; content_config &#61; optional&#40;string, &#34;NO_CONTENT&#34;&#41;&#10; create_advanced_site_search &#61; optional&#40;bool&#41;&#10; display_name &#61; optional&#40;string, &#34;Terraform managed.&#34;&#41;&#10; document_processing_config &#61; optional&#40;object&#40;&#123;&#10; chunking_config &#61; optional&#40;object&#40;&#123;&#10; layout_based_chunking_config &#61; optional&#40;object&#40;&#123;&#10; chunk_size &#61; optional&#40;number&#41;&#10; include_ancestor_headings &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; default_parsing_config &#61; optional&#40;object&#40;&#123;&#10; digital_parsing_config &#61; optional&#40;bool&#41;&#10; layout_parsing_config &#61; optional&#40;bool&#41;&#10; ocr_parsing_config &#61; optional&#40;object&#40;&#123;&#10; use_native_text &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; parsing_config_overrides &#61; map&#40;object&#40;&#123;&#10; digital_parsing_config &#61; optional&#40;bool&#41;&#10; layout_parsing_config &#61; optional&#40;bool&#41;&#10; ocr_parsing_config &#61; optional&#40;object&#40;&#123;&#10; use_native_text &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; industry_vertical &#61; optional&#40;string, &#34;GENERIC&#34;&#41;&#10; json_schema &#61; optional&#40;string&#41;&#10; location &#61; optional&#40;string&#41;&#10; skip_default_schema_creation &#61; optional&#40;bool&#41;&#10; solution_types &#61; optional&#40;list&#40;string&#41;&#41;&#10; sites_search_config &#61; optional&#40;object&#40;&#123;&#10; sitemap_uri &#61; optional&#40;string&#41;&#10; target_sites &#61; map&#40;object&#40;&#123;&#10; provided_uri_pattern &#61; string&#10; exact_match &#61; optional&#40;bool, false&#41;&#10; type &#61; optional&#40;string, &#34;INCLUDE&#34;&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [engines_configs](variables.tf#L112) | The Agentspace engines configurations. | <code title="map&#40;object&#40;&#123;&#10; data_store_ids &#61; list&#40;string&#41;&#10; collection_id &#61; optional&#40;string, &#34;default_collection&#34;&#41;&#10; chat_engine_config &#61; optional&#40;object&#40;&#123;&#10; allow_cross_region &#61; optional&#40;bool&#41;&#10; business &#61; optional&#40;string&#41;&#10; company_name &#61; optional&#40;string&#41;&#10; default_language_code &#61; optional&#40;string&#41;&#10; dialogflow_agent_to_link &#61; optional&#40;string&#41;&#10; time_zone &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; industry_vertical &#61; optional&#40;string&#41;&#10; location &#61; optional&#40;string&#41;&#10; search_engine_config &#61; optional&#40;object&#40;&#123;&#10; search_add_ons &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; search_tier &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [data_stores_configs](variables.tf#L17) | The ai-applications datastore configurations. | <code title="map&#40;object&#40;&#123;&#10; advanced_site_search_config &#61; optional&#40;object&#40;&#123;&#10; disable_initial_index &#61; optional&#40;bool&#41;&#10; disable_automatic_refresh &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; content_config &#61; optional&#40;string, &#34;NO_CONTENT&#34;&#41;&#10; create_advanced_site_search &#61; optional&#40;bool&#41;&#10; display_name &#61; optional&#40;string&#41;&#10; document_processing_config &#61; optional&#40;object&#40;&#123;&#10; chunking_config &#61; optional&#40;object&#40;&#123;&#10; layout_based_chunking_config &#61; optional&#40;object&#40;&#123;&#10; chunk_size &#61; optional&#40;number&#41;&#10; include_ancestor_headings &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; default_parsing_config &#61; optional&#40;object&#40;&#123;&#10; digital_parsing_config &#61; optional&#40;bool&#41;&#10; layout_parsing_config &#61; optional&#40;bool&#41;&#10; ocr_parsing_config &#61; optional&#40;object&#40;&#123;&#10; use_native_text &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; parsing_config_overrides &#61; map&#40;object&#40;&#123;&#10; digital_parsing_config &#61; optional&#40;bool&#41;&#10; layout_parsing_config &#61; optional&#40;bool&#41;&#10; ocr_parsing_config &#61; optional&#40;object&#40;&#123;&#10; use_native_text &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; industry_vertical &#61; optional&#40;string, &#34;GENERIC&#34;&#41;&#10; json_schema &#61; optional&#40;string&#41;&#10; location &#61; optional&#40;string&#41;&#10; skip_default_schema_creation &#61; optional&#40;bool&#41;&#10; solution_types &#61; optional&#40;list&#40;string&#41;&#41;&#10; sites_search_config &#61; optional&#40;object&#40;&#123;&#10; sitemap_uri &#61; optional&#40;string&#41;&#10; target_sites &#61; map&#40;object&#40;&#123;&#10; provided_uri_pattern &#61; string&#10; exact_match &#61; optional&#40;bool, false&#41;&#10; type &#61; optional&#40;string, &#34;INCLUDE&#34;&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [engines_configs](variables.tf#L112) | The ai-applications engines configurations. | <code title="map&#40;object&#40;&#123;&#10; data_store_ids &#61; list&#40;string&#41;&#10; collection_id &#61; optional&#40;string, &#34;default_collection&#34;&#41;&#10; chat_engine_config &#61; optional&#40;object&#40;&#123;&#10; allow_cross_region &#61; optional&#40;bool&#41;&#10; business &#61; optional&#40;string&#41;&#10; company_name &#61; optional&#40;string&#41;&#10; default_language_code &#61; optional&#40;string&#41;&#10; dialogflow_agent_to_link &#61; optional&#40;string&#41;&#10; time_zone &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; industry_vertical &#61; optional&#40;string&#41;&#10; location &#61; optional&#40;string&#41;&#10; search_engine_config &#61; optional&#40;object&#40;&#123;&#10; search_add_ons &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; search_tier &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [location](variables.tf#L153) | Location where the data stores and agents will be created. | <code>string</code> | | <code>&#34;global&#34;</code> |
## Outputs

View File

@@ -35,12 +35,14 @@ resource "google_discovery_engine_data_store" "default" {
data_store_id = "${var.name}-${each.key}"
project = var.project_id
location = coalesce(each.value.location, var.location)
display_name = each.value.display_name
industry_vertical = each.value.industry_vertical
content_config = each.value.content_config
solution_types = each.value.solution_types
create_advanced_site_search = each.value.create_advanced_site_search
skip_default_schema_creation = each.value.skip_default_schema_creation
display_name = coalesce(
each.value.display_name, "${var.name}-${each.key}"
)
dynamic "advanced_site_search_config" {
for_each = (

View File

@@ -15,7 +15,7 @@
*/
variable "data_stores_configs" {
description = "The Agentspace datastore configurations."
description = "The ai-applications datastore configurations."
type = map(object({
advanced_site_search_config = optional(object({
disable_initial_index = optional(bool)
@@ -23,7 +23,7 @@ variable "data_stores_configs" {
}))
content_config = optional(string, "NO_CONTENT")
create_advanced_site_search = optional(bool)
display_name = optional(string, "Terraform managed.")
display_name = optional(string)
document_processing_config = optional(object({
chunking_config = optional(object({
layout_based_chunking_config = optional(object({
@@ -110,7 +110,7 @@ variable "data_stores_configs" {
}
variable "engines_configs" {
description = "The Agentspace engines configurations."
description = "The ai-applications engines configurations."
type = map(object({
data_store_ids = list(string)
collection_id = optional(string, "default_collection")

View File

@@ -23,6 +23,7 @@ This module allows creation and management of VPC networks including subnetworks
- [Private Google Access routes](#private-google-access-routes)
- [Allow Firewall Policy to be evaluated before Firewall Rules](#allow-firewall-policy-to-be-evaluated-before-firewall-rules)
- [IPv6](#ipv6)
- [IPv6-Only and IP Collections](#ipv6-only-and-ip-collections)
- [Variables](#variables)
- [Outputs](#outputs)
<!-- END TOC -->
@@ -712,6 +713,47 @@ module "vpc" {
}
# tftest modules=1 resources=6 inventory=ipv6.yaml e2e
```
### IPv6-Only and IP Collections
An IPv6-only subnetwork can be specified by setting `ipv6_only` to `true` and
setting `ip_cidr_range` to `null`. An IP Collection may be specified with
`ip_collection` and a
[reference](https://cloud.google.com/compute/docs/reference/rest/v1/subnetworks/insert)
to a collection source, like a PublicDelegatedPrefix (PDP) for BYOIPv6. The PDP
must be a sub-PDP in `EXTERNAL_IPV6_SUBNETWORK_CREATION` mode.
```hcl
module "vpc" {
source = "./fabric/modules/net-vpc"
project_id = var.project_id
name = "my-network"
ipv6_config = {
enable_ula_internal = true
}
subnets = [
{
ip_cidr_range = null
name = "test-v6only"
region = "europe-west1"
ipv6 = {
ipv6_only = true
}
},
{
ip_cidr_range = null
name = "test-v6only"
region = "europe-west3"
ipv6 = {
access_type = "EXTERNAL"
ipv6_only = true
}
ip_collection = "https://www.googleapis.com/compute/v1/projects/project-id/regions/europe-west3/publicDelegatedPrefixes/test-sub-pdp"
}
]
}
# tftest modules=1 resources=6 inventory=ipv6_only.yaml e2e
```
<!-- BEGIN TFDOC -->
## Variables
@@ -736,11 +778,11 @@ module "vpc" {
| [routing_mode](variables.tf#L234) | The network routing mode (default 'GLOBAL'). | <code>string</code> | | <code>&#34;GLOBAL&#34;</code> |
| [shared_vpc_host](variables.tf#L244) | Enable shared VPC for this project. | <code>bool</code> | | <code>false</code> |
| [shared_vpc_service_projects](variables.tf#L250) | Shared VPC service projects to register with this host. | <code>list&#40;string&#41;</code> | | <code>&#91;&#93;</code> |
| [subnets](variables.tf#L256) | Subnet configuration. | <code title="list&#40;object&#40;&#123;&#10; name &#61; string&#10; ip_cidr_range &#61; string&#10; region &#61; string&#10; description &#61; optional&#40;string&#41;&#10; enable_private_access &#61; optional&#40;bool, true&#41;&#10; allow_subnet_cidr_routes_overlap &#61; optional&#40;bool, null&#41;&#10; flow_logs_config &#61; optional&#40;object&#40;&#123;&#10; aggregation_interval &#61; optional&#40;string&#41;&#10; filter_expression &#61; optional&#40;string&#41;&#10; flow_sampling &#61; optional&#40;number&#41;&#10; metadata &#61; optional&#40;string&#41;&#10; metadata_fields &#61; optional&#40;list&#40;string&#41;&#41;&#10; &#125;&#41;&#41;&#10; ipv6 &#61; optional&#40;object&#40;&#123;&#10; access_type &#61; optional&#40;string, &#34;INTERNAL&#34;&#41;&#10; &#125;&#41;&#41;&#10; secondary_ip_ranges &#61; optional&#40;map&#40;string&#41;&#41;&#10; iam &#61; optional&#40;map&#40;list&#40;string&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings &#61; optional&#40;map&#40;object&#40;&#123;&#10; role &#61; string&#10; members &#61; list&#40;string&#41;&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings_additive &#61; optional&#40;map&#40;object&#40;&#123;&#10; member &#61; string&#10; role &#61; string&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;&#41;">list&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#91;&#93;</code> |
| [subnets_private_nat](variables.tf#L303) | List of private NAT subnets. | <code title="list&#40;object&#40;&#123;&#10; name &#61; string&#10; ip_cidr_range &#61; string&#10; region &#61; string&#10; description &#61; optional&#40;string&#41;&#10;&#125;&#41;&#41;">list&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#91;&#93;</code> |
| [subnets_proxy_only](variables.tf#L315) | List of proxy-only subnets for Regional HTTPS or Internal HTTPS load balancers. Note: Only one proxy-only subnet for each VPC network in each region can be active. | <code title="list&#40;object&#40;&#123;&#10; name &#61; string&#10; ip_cidr_range &#61; string&#10; region &#61; string&#10; description &#61; optional&#40;string&#41;&#10; active &#61; optional&#40;bool, true&#41;&#10; global &#61; optional&#40;bool, false&#41;&#10;&#10;&#10; iam &#61; optional&#40;map&#40;list&#40;string&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings &#61; optional&#40;map&#40;object&#40;&#123;&#10; role &#61; string&#10; members &#61; list&#40;string&#41;&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings_additive &#61; optional&#40;map&#40;object&#40;&#123;&#10; member &#61; string&#10; role &#61; string&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;&#41;">list&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#91;&#93;</code> |
| [subnets_psc](variables.tf#L349) | List of subnets for Private Service Connect service producers. | <code title="list&#40;object&#40;&#123;&#10; name &#61; string&#10; ip_cidr_range &#61; string&#10; region &#61; string&#10; description &#61; optional&#40;string&#41;&#10;&#10;&#10; iam &#61; optional&#40;map&#40;list&#40;string&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings &#61; optional&#40;map&#40;object&#40;&#123;&#10; role &#61; string&#10; members &#61; list&#40;string&#41;&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings_additive &#61; optional&#40;map&#40;object&#40;&#123;&#10; member &#61; string&#10; role &#61; string&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;&#41;">list&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#91;&#93;</code> |
| [vpc_create](variables.tf#L381) | Create VPC. When set to false, uses a data source to reference existing VPC. | <code>bool</code> | | <code>true</code> |
| [subnets](variables.tf#L256) | Subnet configuration. | <code title="list&#40;object&#40;&#123;&#10; name &#61; string&#10; ip_cidr_range &#61; string&#10; region &#61; string&#10; description &#61; optional&#40;string&#41;&#10; enable_private_access &#61; optional&#40;bool, true&#41;&#10; allow_subnet_cidr_routes_overlap &#61; optional&#40;bool, null&#41;&#10; flow_logs_config &#61; optional&#40;object&#40;&#123;&#10; aggregation_interval &#61; optional&#40;string&#41;&#10; filter_expression &#61; optional&#40;string&#41;&#10; flow_sampling &#61; optional&#40;number&#41;&#10; metadata &#61; optional&#40;string&#41;&#10; metadata_fields &#61; optional&#40;list&#40;string&#41;&#41;&#10; &#125;&#41;&#41;&#10; ipv6 &#61; optional&#40;object&#40;&#123;&#10; access_type &#61; optional&#40;string, &#34;INTERNAL&#34;&#41;&#10; ipv6_only &#61; optional&#40;bool, false&#41;&#10; &#125;&#41;&#41;&#10; ip_collection &#61; optional&#40;string, null&#41;&#10; secondary_ip_ranges &#61; optional&#40;map&#40;string&#41;&#41;&#10; iam &#61; optional&#40;map&#40;list&#40;string&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings &#61; optional&#40;map&#40;object&#40;&#123;&#10; role &#61; string&#10; members &#61; list&#40;string&#41;&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings_additive &#61; optional&#40;map&#40;object&#40;&#123;&#10; member &#61; string&#10; role &#61; string&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;&#41;">list&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#91;&#93;</code> |
| [subnets_private_nat](variables.tf#L305) | List of private NAT subnets. | <code title="list&#40;object&#40;&#123;&#10; name &#61; string&#10; ip_cidr_range &#61; string&#10; region &#61; string&#10; description &#61; optional&#40;string&#41;&#10;&#125;&#41;&#41;">list&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#91;&#93;</code> |
| [subnets_proxy_only](variables.tf#L317) | List of proxy-only subnets for Regional HTTPS or Internal HTTPS load balancers. Note: Only one proxy-only subnet for each VPC network in each region can be active. | <code title="list&#40;object&#40;&#123;&#10; name &#61; string&#10; ip_cidr_range &#61; string&#10; region &#61; string&#10; description &#61; optional&#40;string&#41;&#10; active &#61; optional&#40;bool, true&#41;&#10; global &#61; optional&#40;bool, false&#41;&#10;&#10;&#10; iam &#61; optional&#40;map&#40;list&#40;string&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings &#61; optional&#40;map&#40;object&#40;&#123;&#10; role &#61; string&#10; members &#61; list&#40;string&#41;&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings_additive &#61; optional&#40;map&#40;object&#40;&#123;&#10; member &#61; string&#10; role &#61; string&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;&#41;">list&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#91;&#93;</code> |
| [subnets_psc](variables.tf#L351) | List of subnets for Private Service Connect service producers. | <code title="list&#40;object&#40;&#123;&#10; name &#61; string&#10; ip_cidr_range &#61; string&#10; region &#61; string&#10; description &#61; optional&#40;string&#41;&#10;&#10;&#10; iam &#61; optional&#40;map&#40;list&#40;string&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings &#61; optional&#40;map&#40;object&#40;&#123;&#10; role &#61; string&#10; members &#61; list&#40;string&#41;&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings_additive &#61; optional&#40;map&#40;object&#40;&#123;&#10; member &#61; string&#10; role &#61; string&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;&#41;">list&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#91;&#93;</code> |
| [vpc_create](variables.tf#L383) | Create VPC. When set to false, uses a data source to reference existing VPC. | <code>bool</code> | | <code>true</code> |
## Outputs

View File

@@ -56,9 +56,15 @@
"properties": {
"access_type": {
"type": "string"
},
"ipv6_only": {
"type": "boolean"
}
}
},
"ip_collection": {
"type": "string"
},
"name": {
"type": "string"
},

View File

@@ -23,6 +23,8 @@
- **ipv6**: *object*
<br>*additional properties: false*
- **access_type**: *string*
- +**ipv6_only**: *boolean*
- ⁺**ip_collection**: *string*
- **name**: *string*
- ⁺**region**: *string*
- **psc**: *boolean*

View File

@@ -43,7 +43,9 @@ locals {
ip_cidr_range = v.ip_cidr_range
ipv6 = !can(v.ipv6) ? null : {
access_type = try(v.ipv6.access_type, "INTERNAL")
ipv6_only = try(v.ipv6.ipv6_only, false)
}
ip_collection = try(v.ip_collection, null)
name = try(v.name, k)
region = v.region_computed
secondary_ip_ranges = try(v.secondary_ip_ranges, null)
@@ -145,7 +147,7 @@ resource "google_compute_subnetwork" "subnetwork" {
network = local.network.name
name = each.value.name
region = each.value.region
ip_cidr_range = each.value.ip_cidr_range
ip_cidr_range = try(each.value.ipv6.ipv6_only, false) ? null : each.value.ip_cidr_range
allow_subnet_cidr_routes_overlap = each.value.allow_subnet_cidr_routes_overlap
description = (
each.value.description == null
@@ -154,12 +156,19 @@ resource "google_compute_subnetwork" "subnetwork" {
)
private_ip_google_access = each.value.enable_private_access
stack_type = (
try(each.value.ipv6, null) != null ? "IPV4_IPV6" : null
try(each.value.ipv6, null) != null
? (
try(each.value.ipv6.ipv6_only, false)
? "IPV6_ONLY"
: "IPV4_IPV6"
)
: null
)
ipv6_access_type = (
try(each.value.ipv6, null) != null ? each.value.ipv6.access_type : null
)
private_ipv6_google_access = try(each.value.ipv6.enable_private_access, null)
ip_collection = each.value.ip_collection
send_secondary_ip_range_if_empty = true
dynamic "secondary_ip_range" {

View File

@@ -274,7 +274,9 @@ variable "subnets" {
access_type = optional(string, "INTERNAL")
# this field is marked for internal use in the API documentation
# enable_private_access = optional(string)
ipv6_only = optional(bool, false)
}))
ip_collection = optional(string, null)
secondary_ip_ranges = optional(map(string))
iam = optional(map(list(string)), {})
iam_bindings = optional(map(object({

View File

@@ -1318,7 +1318,7 @@ values:
parameters: null
values:
- allowed_values:
- INTERNAL
- is:INTERNAL
denied_values: null
timeouts: null
module.organization.google_org_policy_policy.default["compute.setNewProjectDefaultToZonalDNSOnly"]:
@@ -1493,7 +1493,7 @@ values:
parameters: null
values:
- allowed_values:
- C00000000
- is:C00000000
denied_values: null
- allow_all: 'TRUE'
condition:
@@ -1583,7 +1583,7 @@ values:
parameters: null
values:
- allowed_values:
- DISABLE_KEY
- is:DISABLE_KEY
denied_values: null
timeouts: null
module.organization.google_org_policy_policy.default["iam.workloadIdentityPoolAwsAccounts"]:

View File

@@ -430,7 +430,7 @@ values:
parameters: null
values:
- allowed_values:
- DISABLE_KEY
- is:DISABLE_KEY
denied_values: null
timeouts: null
module.organization.google_org_policy_policy.default["iam.workloadIdentityPoolAwsAccounts"]:

View File

@@ -166,7 +166,7 @@ values:
parameters: null
values:
- allowed_values:
- INTERNAL
- is:INTERNAL
denied_values: null
timeouts: null
module.organization.google_org_policy_policy.default["compute.setNewProjectDefaultToZonalDNSOnly"]:
@@ -341,7 +341,7 @@ values:
parameters: null
values:
- allowed_values:
- C00000000
- is:C00000000
denied_values: null
- allow_all: 'TRUE'
condition:
@@ -431,7 +431,7 @@ values:
parameters: null
values:
- allowed_values:
- DISABLE_KEY
- is:DISABLE_KEY
denied_values: null
timeouts: null
module.organization.google_org_policy_policy.default["iam.workloadIdentityPoolAwsAccounts"]:

View File

@@ -0,0 +1,82 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
values:
module.vpc.google_compute_network.network[0]:
auto_create_subnetworks: false
delete_default_routes_on_create: false
description: Terraform-managed.
enable_ula_internal_ipv6: true
# internal_ipv6_range: fd20:6b2:27e5:0:0:0:0:0/48
name: my-network
network_firewall_policy_enforcement_order: AFTER_CLASSIC_FIREWALL
project: project-id
routing_mode: GLOBAL
timeouts: null
module.vpc.google_compute_route.gateway["private-googleapis"]:
description: Terraform-managed.
dest_range: 199.36.153.8/30
name: my-network-private-googleapis
next_hop_gateway: default-internet-gateway
next_hop_ilb: null
next_hop_instance: null
next_hop_vpn_tunnel: null
priority: 1000
project: project-id
tags: null
timeouts: null
module.vpc.google_compute_route.gateway["restricted-googleapis"]:
description: Terraform-managed.
dest_range: 199.36.153.4/30
name: my-network-restricted-googleapis
next_hop_gateway: default-internet-gateway
next_hop_ilb: null
next_hop_instance: null
next_hop_vpn_tunnel: null
priority: 1000
project: project-id
tags: null
timeouts: null
module.vpc.google_compute_subnetwork.subnetwork["europe-west1/test-v6only"]:
description: Terraform-managed.
ipv6_access_type: INTERNAL
log_config: []
name: test-v6only
private_ip_google_access: true
project: project-id
region: europe-west1
role: null
stack_type: IPV6_ONLY
timeouts: null
module.vpc.google_compute_subnetwork.subnetwork["europe-west3/test-v6only"]:
description: Terraform-managed.
ipv6_access_type: EXTERNAL
log_config: []
name: test-v6only
private_ip_google_access: true
project: project-id
region: europe-west3
role: null
stack_type: IPV6_ONLY
timeouts: null
ip_collection: "https://www.googleapis.com/compute/v1/projects/project-id/regions/europe-west3/publicDelegatedPrefixes/test-sub-pdp"
counts:
google_compute_network: 1
google_compute_route: 3
google_compute_subnetwork: 2
modules: 1
resources: 6
outputs: {}