Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f8c1855
Added L2 interconnect attachment changes
abhijeetkjha-google Dec 22, 2025
c330885
added create test for l2 dedicated interconnect attachment
abhijeetkjha-google Dec 22, 2025
7df8790
updated bandwidth
abhijeetkjha-google Dec 22, 2025
0dc2b0b
added coverage for requested_feature
abhijeetkjha-google Dec 22, 2025
27cf2fb
correcting default value of encryption
abhijeetkjha-google Dec 22, 2025
43af4d4
reducing the bandwidth further
abhijeetkjha-google Dec 22, 2025
8085052
lint fix
abhijeetkjha-google Dec 22, 2025
e921262
broken test fix
abhijeetkjha-google Dec 23, 2025
d867d76
test(pubsub): Use unique service account IDs in BQ and GCS subscripti…
michaelpri10 Dec 22, 2025
e21b78b
Update enrolled_teams.yml (#16016)
shuyama1 Dec 22, 2025
ff76d1b
Multicast consumer association documentation update (#15897)
jgforsberg Dec 22, 2025
7c3e234
Make defaultLanguage consistent across Dialogflow Agents (#16006)
shang-jason Dec 22, 2025
0610274
tgc-revival: set the value to unknown for required fields missing in …
zli82016 Dec 22, 2025
6006d9e
Promote DNS Threat Detector to GA. (#16010)
rosmo Dec 22, 2025
9021f61
Add documentation missing from PR #15679. (#16015)
hankfreund Dec 23, 2025
2f0997a
fix TestAccIAMBetaWorkloadIdentityPool_beta_update (#16019)
shuyama1 Dec 23, 2025
cf9ad84
Added IAM support for the IcebergCatalog resource. (#15950)
nika-qubit Dec 23, 2025
5a03546
Add support for labels for Memorystore Redis clusters (#15991)
nshah-google Dec 23, 2025
7f48b0a
Add new resource Boundary for AppHub (#15891)
diegomguzman-google Dec 23, 2025
34cbb96
tgc: remove the automatic support of IAM resources (#16004)
zli82016 Dec 23, 2025
2d89e23
Skip scratch disks in disk delete checks (#16023)
rileykarson Dec 23, 2025
aa266fe
Create Interconnect in other z2z Location to fix TestAccComputeInterc…
NandiniAgrawal15 Dec 23, 2025
8995a9e
Bump Cloud Armor Hierchical Policies - Security Policy Associations …
maxi-cit Dec 23, 2025
2fa165c
Creating dev environment to be used by product (#16022)
rickygodoy Dec 23, 2025
9a0fb43
tgc-revival: add google_memcache_instance to TGC (#16025)
zli82016 Dec 24, 2025
d2d7660
Update dataset id in Entry.yaml to fix TestAccDataplexEntry_dataplexE…
sushilchaskar28 Dec 29, 2025
ee2a0b4
Allow empty fields for serviceDiscovery, userInfo, groupInfo and dev…
Chi-Pin Dec 29, 2025
b59bc95
Add `prefix_length` to `google_compute_addresses` plural data source …
bestefreund Dec 29, 2025
7c5a65e
Refactor GCS force delete to separate object and anywhere cache delet…
rileykarson Dec 29, 2025
547e7a5
Add support for hard delete in Workforce Pool Provider SCIM Tenant De…
jaideoka Dec 29, 2025
eed1550
Correcting strict cipher (#15866)
Gorlami96 Dec 29, 2025
122f364
Update looker_instance PSC example for service_attachments (#15799)
shubhechha-google Dec 30, 2025
0c33724
feat: add support for zip deploys to cloudrunv2 services (beta) (#16005)
akerekes Dec 30, 2025
c193659
Agent Engine: add source based deployment documentation. (#16011)
LucaPrete Dec 30, 2025
c6e399b
Lustre increase timeout for update and delete async operations (#16046)
stephanecharite Dec 30, 2025
4e2684f
tgc-revival: Add more handwritten tests (#15937)
trodge Dec 30, 2025
d3942b2
Introduce Destination resource (#16002)
sreemoyee-basu Dec 30, 2025
c3bb9ba
Support x-google-lro (#16028)
nicdumz Dec 30, 2025
6f1de8b
Merge branch 'GoogleCloudPlatform:main' into abhijeetkjha-b-399700899
abhijeetkjha-google Jan 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions mmv1/products/compute/Interconnect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,10 @@ properties:
interconnects.list of features requested for this Interconnect connection. Options: IF_MACSEC (
If specified then the connection is created on MACsec capable hardware ports. If not
specified, the default value is false, which allocates non-MACsec capable ports first if
available). Note that MACSEC is still technically allowed for compatibility reasons, but it
does not work with the API, and will be removed in an upcoming major version.
available). IF_L2_FORWARDING ( If specified then the connection is created for L2 traffic forwarding.
If not specified, the default value is false for regular L3 traffic forwarding) .Note that MACSEC
is still technically allowed for compatibility reasons, but it does not work with the API, and
will be removed in an upcoming major version.
immutable: true
item_type:
type: Enum
Expand All @@ -417,20 +419,24 @@ properties:
- 'MACSEC'
- 'CROSS_SITE_NETWORK'
- 'IF_MACSEC'
- 'IF_L2_FORWARDING'
- name: 'availableFeatures'
type: Array
description: |
interconnects.list of features available for this Interconnect connection. Can take the value:
MACSEC. If present then the Interconnect connection is provisioned on MACsec capable hardware
MACSEC, If present then the Interconnect connection is provisioned on MACsec capable hardware
ports. If not present then the Interconnect connection is provisioned on non-MACsec capable
ports and MACsec isn't supported and enabling MACsec fails).
ports and MACsec isn't supported and enabling MACsec fails). IF_L2_FORWARDING, If present then
the Interconnect connection can be used for L2 traffic forwarding. If not present then then
Interconnect connection cannot be used with L2 forwarding attachments.
output: true
item_type:
type: Enum
enum_values:
- 'IF_CROSS_SITE_NETWORK'
- 'IF_MACSEC'
- 'MACSEC'
- 'IF_L2_FORWARDING'
- name: 'wireGroups'
type: Array
description: |
Expand Down
57 changes: 56 additions & 1 deletion mmv1/products/compute/InterconnectAttachment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ properties:
- 'DEDICATED'
- 'PARTNER'
- 'PARTNER_PROVIDER'
- 'L2_DEDICATED'
- name: 'state'
type: Enum
description: |
Expand All @@ -215,7 +216,6 @@ properties:
the same region as this InterconnectAttachment. The InterconnectAttachment will
automatically connect the Interconnect to the network & region within which the
Cloud Router is configured.
required: true
immutable: true
diff_suppress_func: 'tpgresource.CompareSelfLinkOrResourceName'
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl'
Expand Down Expand Up @@ -304,6 +304,7 @@ properties:
attachment must be created with this option.
immutable: true
custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.tmpl'
custom_expand: 'templates/terraform/custom_expand/interconnect_attachment_encryption_mapping.tmpl'
default_value: "NONE"
enum_values:
- 'NONE'
Expand Down Expand Up @@ -389,3 +390,57 @@ properties:
description: |
URL of the AttachmentGroup that includes this Attachment.
output: true
- name: 'l2Forwarding'
type: NestedObject
description: 'L2 Interconnect Attachment related configuration.'
properties:
- name: 'network'
type: ResourceRef
description: 'URL of the network to which this attachment belongs.'
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl'
resource: 'Network'
imports: 'selfLink'
- name: 'tunnelEndpointIpAddress'
type: String
description: 'The tunnel endpoint IP address.'
- name: 'defaultApplianceIpAddress'
type: String
description: 'The default appliance IP address.'
- name: 'geneveHeader'
type: NestedObject
description: 'GeneveHeader related configurations.'
properties:
- name: 'vni'
type: Integer
description: 'VNI is a 24-bit unique virtual network identifier.'
- name: 'applianceMappings'
type: Array
description: 'A map of VLAN tags to appliances and optional inner mapping rules.'
custom_flatten: 'templates/terraform/custom_flatten/interconnect_attachment_application_mapping.tmpl'
custom_expand: 'templates/terraform/custom_expand/interconnect_attachment_application_mapping.tmpl'
item_type:
type: NestedObject
properties:
- name: 'vlanId' # Represents the map key (VLAN tag)
type: String
description: 'The VLAN tag.'
- name: 'name'
type: String
description: 'The name of this appliance mapping rule.'
- name: 'applianceIpAddress'
type: String
description: 'The appliance IP address.'
- name: 'innerVlanToApplianceMappings'
type: Array
item_type:
type: NestedObject
description: 'The inner VLAN-to-Appliance mapping.'
properties:
- name: 'innerVlanTags'
description: 'List of inner VLAN tags.'
type: Array
item_type:
type: String
- name: 'innerApplianceIpAddress'
type: String
description: 'The inner appliance IP address.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
func expand{{$.GetPrefix}}{{$.TitlelizeProperty}}(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
l := v.([]interface{})
m := make(map[string]interface{}, len(l))
for _, raw := range l {
if raw == nil {
continue
}
original := raw.(map[string]interface{})
transformed := make(map[string]interface{})

vlanID := original["vlan_id"].(string)
if vlanID == "" {
continue
}

if v, ok := original["name"]; ok {
transformed["name"] = v
}
if v, ok := original["appliance_ip_address"]; ok {
transformed["applianceIpAddress"] = v
}

if v, ok := original["inner_vlan_to_appliance_mappings"]; ok {
innerList := v.([]interface{})
transformedInnerList := make([]interface{}, 0, len(innerList))
for _, itemRaw := range innerList {
item := itemRaw.(map[string]interface{})
transformedItem := make(map[string]interface{})
if ip, ok := item["inner_appliance_ip_address"]; ok {
transformedItem["innerApplianceIpAddress"] = ip
}
if tags, ok := item["inner_vlan_tags"]; ok {
transformedItem["innerVlanTags"] = tags
}
transformedInnerList = append(transformedInnerList, transformedItem)
}
transformed["innerVlanToApplianceMappings"] = transformedInnerList
}
m[vlanID] = transformed
}
return m, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{/*
This custom expander for InterconnectAttachment encryption checks the attachment type.
If the type is L2_DEDICATED, it returns nil to prevent sending the encryption field in the API request.
Otherwise, it returns the provided encryption value.
*/}}
func expand{{$.GetPrefix}}{{$.TitlelizeProperty}}(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
// v is the value of the 'encryption' field from the Terraform state.
// d is the TerraformResourceData, allowing access to other fields like 'type'.

attachmentType, ok := d.GetOk("type")

if ok && attachmentType.(string) == "L2_DEDICATED" {
// If the attachment type is L2_DEDICATED, do not send the encryption field.
// Returning nil will cause the field to be omitted in the API request payload,
// assuming the field in the generated Go API client struct is a pointer type (e.g., *string),
// which is standard for optional fields.
return nil, nil
}

// For all other attachment types, return the configured value of 'encryption'.
// Since 'encryption' is an Enum, v is expected to be a string.
return v, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{/*
The license inside this block applies to this file
Copyright 2024 Google Inc.
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.
*/ -}}
func flatten{{$.GetPrefix}}{{$.TitlelizeProperty}}(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
if v == nil {
return v
}
m := v.(map[string]interface{})
l := make([]interface{}, 0, len(m))
for key, raw := range m {
original := raw.(map[string]interface{})
transformed := make(map[string]interface{})

transformed["vlan_id"] = key

if v, ok := original["name"]; ok {
transformed["name"] = v
}
if v, ok := original["applianceIpAddress"]; ok {
transformed["appliance_ip_address"] = v
}

if v, ok := original["innerVlanToApplianceMappings"]; ok {
innerList := v.([]interface{})
transformedInnerList := make([]interface{}, 0, len(innerList))
for _, itemRaw := range innerList {
item := itemRaw.(map[string]interface{})
transformedItem := make(map[string]interface{})
if ip, ok := item["innerApplianceIpAddress"]; ok {
transformedItem["inner_appliance_ip_address"] = ip
}
if tags, ok := item["innerVlanTags"]; ok {
transformedItem["inner_vlan_tags"] = tags
}
transformedInnerList = append(transformedInnerList, transformedItem)
}
transformed["inner_vlan_to_appliance_mappings"] = transformedInnerList
}
l = append(l, transformed)
}
return l
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package compute_test

import (
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"

"github.com/hashicorp/terraform-provider-google/google/acctest"
)

func TestAccComputeInterconnectAttachment_l2DedicatedExample(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": acctest.RandString(t, 10),
}

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckComputeInterconnectAttachmentDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccComputeInterconnectAttachment_l2DedicatedExample(context),
},
{
ResourceName: "google_compute_interconnect_attachment.attachment",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"labels", "location", "terraform_labels"},
},
},
})
}

func testAccComputeInterconnectAttachment_l2DedicatedExample(context map[string]interface{}) string {
return acctest.Nprintf(`
data "google_project" "project" {}

resource "google_compute_network" "network" {
name = "tf-test-network-%{random_suffix}"
auto_create_subnetworks = false
}

resource "google_compute_interconnect" "interconnect" {
name = "tf-test-interconnect-%{random_suffix}"
customer_name = "internal_customer"
interconnect_type = "DEDICATED"
link_type = "LINK_TYPE_ETHERNET_100G_LR"
location = "https://www.googleapis.com/compute/v1/projects/${data.google_project.project.name}/global/interconnectLocations/z2z-us-east4-zone1-pniada-a"
requested_link_count = 1
admin_enabled = true
description = "example description"
macsec_enabled = false
noc_contact_email = "user@example.com"
requested_features = ["IF_L2_FORWARDING"]
}

resource "google_compute_interconnect_attachment" "attachment" {
name = "tf-test-attachment-%{random_suffix}"
interconnect = google_compute_interconnect.interconnect.id
type = "L2_DEDICATED"
bandwidth = "BPS_50M"
vlan_tag8021q = 1000
region = "https://www.googleapis.com/compute/v1/projects/${data.google_project.project.name}/regions/us-east4"
l2_forwarding {
appliance_mappings {
vlan_id = "100"
name = "customer-1"
appliance_ip_address = "10.11.12.13"
inner_vlan_to_appliance_mappings {
inner_vlan_tags = ["1000", "1500-1699"]
inner_appliance_ip_address = "10.12.0.1"
}
inner_vlan_to_appliance_mappings {
inner_vlan_tags = ["2000", "2500-2699"]
inner_appliance_ip_address = "24.25.26.27"
}
}
network = google_compute_network.network.id
geneve_header {
vni = 10000
}
default_appliance_ip_address = "10.0.0.4"
tunnel_endpoint_ip_address = "172.16.0.1"
}
lifecycle {
ignore_changes = [
vlan_tag8021q
]
}
}
`, context)
}
Loading