Skip to content

Commit 48f0718

Browse files
authored
Update google_network_management_connectivity_test (GoogleCloudPlatform#13387)
1 parent 09134ef commit 48f0718

File tree

2 files changed

+157
-69
lines changed

2 files changed

+157
-69
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google Inc.
1+
# Copyright 2025 Google Inc.
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -28,9 +28,9 @@ create_url: 'projects/{{project}}/locations/global/connectivityTests?testId={{na
2828
update_verb: 'PATCH'
2929
update_mask: true
3030
timeouts:
31-
insert_minutes: 20
32-
update_minutes: 20
33-
delete_minutes: 20
31+
insert_minutes: 5
32+
update_minutes: 5
33+
delete_minutes: 5
3434
autogen_async: true
3535
async:
3636
actions: ['create', 'delete', 'update']
@@ -56,6 +56,10 @@ examples:
5656
network: 'connectivity-vpc'
5757
source_addr: 'src-addr'
5858
dest_addr: 'dest-addr'
59+
- name: 'network_management_connectivity_test_endpoints'
60+
primary_resource_id: 'endpoints-test'
61+
vars:
62+
primary_resource_name: 'conn-test-endpoints'
5963
parameters:
6064
properties:
6165
- name: 'name'
@@ -76,55 +80,81 @@ properties:
7680
description: |
7781
Required. Source specification of the Connectivity Test.
7882
79-
You can use a combination of source IP address, virtual machine
80-
(VM) instance, or Compute Engine network to uniquely identify the
81-
source location.
82-
83-
Examples: If the source IP address is an internal IP address within
84-
a Google Cloud Virtual Private Cloud (VPC) network, then you must
85-
also specify the VPC network. Otherwise, specify the VM instance,
86-
which already contains its internal IP address and VPC network
87-
information.
88-
89-
If the source of the test is within an on-premises network, then
90-
you must provide the destination VPC network.
91-
92-
If the source endpoint is a Compute Engine VM instance with multiple
93-
network interfaces, the instance itself is not sufficient to
94-
identify the endpoint. So, you must also specify the source IP
95-
address or VPC network.
83+
You can use a combination of source IP address, URI of a supported
84+
endpoint, project ID, or VPC network to identify the source location.
9685
97-
A reachability analysis proceeds even if the source location is
98-
ambiguous. However, the test result may include endpoints that
99-
you don't intend to test.
86+
Reachability analysis might proceed even if the source location is
87+
ambiguous. However, the test result might include endpoints or use a source
88+
that you don't intend to test.
10089
required: true
10190
update_mask_fields:
10291
- 'source.ipAddress'
10392
- 'source.port'
10493
- 'source.instance'
94+
- 'source.gkeMasterCluster'
95+
- 'source.cloudSqlInstance'
96+
- 'source.cloudFunction'
97+
- 'source.appEngineVersion'
98+
- 'source.cloudRunRevision'
10599
- 'source.network'
106100
- 'source.networkType'
107101
- 'source.projectId'
108102
properties:
109103
- name: 'ipAddress'
110104
type: String
111105
description: |-
112-
The IP address of the endpoint, which can be an external or
113-
internal IP. An IPv6 address is only allowed when the test's
114-
destination is a global load balancer VIP.
106+
The IP address of the endpoint, which can be an external or internal IP.
115107
- name: 'port'
116108
type: Integer
117109
description: |-
118-
The IP protocol port of the endpoint. Only applicable when
119-
protocol is TCP or UDP.
110+
The IP protocol port of the endpoint. Only applicable when protocol is
111+
TCP or UDP.
120112
- name: 'instance'
121113
type: String
122114
description: |-
123115
A Compute Engine instance URI.
116+
- name: 'gkeMasterCluster'
117+
type: String
118+
description: |-
119+
A cluster URI for Google Kubernetes Engine cluster control plane.
120+
- name: 'cloudSqlInstance'
121+
type: String
122+
description: |-
123+
A Cloud SQL instance URI.
124+
- name: 'cloudFunction'
125+
type: NestedObject
126+
description: |-
127+
A Cloud Function.
128+
immutable: true
129+
properties:
130+
- name: 'uri'
131+
type: String
132+
description: |-
133+
A Cloud Function name.
134+
- name: 'appEngineVersion'
135+
type: NestedObject
136+
immutable: true
137+
description: |-
138+
An App Engine service version.
139+
properties:
140+
- name: 'uri'
141+
type: String
142+
description: |-
143+
An App Engine service version name.
144+
- name: 'cloudRunRevision'
145+
type: NestedObject
146+
immutable: true
147+
description: |-
148+
A Cloud Run revision.
149+
properties:
150+
- name: 'uri'
151+
type: String
152+
description: |-
153+
A Cloud Run revision URI.
124154
- name: 'network'
125155
type: String
126156
description: |-
127-
A Compute Engine network URI.
157+
A VPC network URI.
128158
- name: 'networkType'
129159
type: Enum
130160
description: |-
@@ -135,75 +165,96 @@ properties:
135165
- name: 'projectId'
136166
type: String
137167
description: |-
138-
Project ID where the endpoint is located. The Project ID can be
139-
derived from the URI if you provide a VM instance or network URI.
140-
The following are two cases where you must provide the project ID:
141-
142-
1. Only the IP address is specified, and the IP address is
143-
within a GCP project.
144-
2. When you are using Shared VPC and the IP address
145-
that you provide is from the service project. In this case,
146-
the network that the IP address resides in is defined in the
147-
host project.
168+
Project ID where the endpoint is located.
169+
The project ID can be derived from the URI if you provide a endpoint or
170+
network URI.
171+
The following are two cases where you may need to provide the project ID:
172+
1. Only the IP address is specified, and the IP address is within a Google
173+
Cloud project.
174+
2. When you are using Shared VPC and the IP address that you provide is
175+
from the service project. In this case, the network that the IP address
176+
resides in is defined in the host project.
148177
- name: 'destination'
149178
type: NestedObject
150179
description: |
151180
Required. Destination specification of the Connectivity Test.
152181
153-
You can use a combination of destination IP address, Compute
154-
Engine VM instance, or VPC network to uniquely identify the
155-
destination location.
156-
157-
Even if the destination IP address is not unique, the source IP
158-
location is unique. Usually, the analysis can infer the destination
159-
endpoint from route information.
160-
161-
If the destination you specify is a VM instance and the instance has
162-
multiple network interfaces, then you must also specify either a
163-
destination IP address or VPC network to identify the destination
164-
interface.
182+
You can use a combination of destination IP address, URI of a supported
183+
endpoint, project ID, or VPC network to identify the destination location.
165184
166-
A reachability analysis proceeds even if the destination location
167-
is ambiguous. However, the result can include endpoints that you
168-
don't intend to test.
185+
Reachability analysis proceeds even if the destination location is
186+
ambiguous. However, the test result might include endpoints or use a
187+
destination that you don't intend to test.
169188
required: true
170189
update_mask_fields:
171190
- 'destination.ipAddress'
172191
- 'destination.port'
173192
- 'destination.instance'
193+
- 'destination.forwardingRule'
194+
- 'destination.gkeMasterCluster'
195+
- 'destination.fqdn'
196+
- 'destination.cloudSqlInstance'
197+
- 'destination.redisInstance'
198+
- 'destination.redisCluster'
174199
- 'destination.network'
175200
- 'destination.projectId'
176201
properties:
177202
- name: 'ipAddress'
178203
type: String
179204
description: |-
180-
The IP address of the endpoint, which can be an external or
181-
internal IP. An IPv6 address is only allowed when the test's
182-
destination is a global load balancer VIP.
205+
The IP address of the endpoint, which can be an external or internal IP.
183206
- name: 'port'
184207
type: Integer
185208
description: |-
186-
The IP protocol port of the endpoint. Only applicable when
187-
protocol is TCP or UDP.
209+
The IP protocol port of the endpoint. Only applicable when protocol is
210+
TCP or UDP.
188211
- name: 'instance'
189212
type: String
190213
description: |-
191214
A Compute Engine instance URI.
215+
- name: 'forwardingRule'
216+
type: String
217+
description: |-
218+
Forwarding rule URI. Forwarding rules are frontends for load balancers,
219+
PSC endpoints, and Protocol Forwarding.
220+
- name: 'gkeMasterCluster'
221+
type: String
222+
description: |-
223+
A cluster URI for Google Kubernetes Engine cluster control plane.
224+
- name: 'fqdn'
225+
type: String
226+
description: |-
227+
A DNS endpoint of Google Kubernetes Engine cluster control plane.
228+
Requires gke_master_cluster to be set, can't be used simultaneoulsly with
229+
ip_address or network. Applicable only to destination endpoint.
230+
- name: 'cloudSqlInstance'
231+
type: String
232+
description: |-
233+
A Cloud SQL instance URI.
234+
- name: 'redisInstance'
235+
type: String
236+
description: |-
237+
A Redis Instance URI.
238+
- name: 'redisCluster'
239+
type: String
240+
description: |-
241+
A Redis Cluster URI.
192242
- name: 'network'
193243
type: String
194244
description: |-
195-
A Compute Engine network URI.
245+
A VPC network URI.
196246
- name: 'projectId'
197247
type: String
198248
description: |-
199-
Project ID where the endpoint is located. The Project ID can be
200-
derived from the URI if you provide a VM instance or network URI.
201-
The following are two cases where you must provide the project ID:
202-
1. Only the IP address is specified, and the IP address is within
203-
a GCP project. 2. When you are using Shared VPC and the IP address
204-
that you provide is from the service project. In this case, the
205-
network that the IP address resides in is defined in the host
206-
project.
249+
Project ID where the endpoint is located.
250+
The project ID can be derived from the URI if you provide a endpoint or
251+
network URI.
252+
The following are two cases where you may need to provide the project ID:
253+
1. Only the IP address is specified, and the IP address is within a Google
254+
Cloud project.
255+
2. When you are using Shared VPC and the IP address that you provide is
256+
from the service project. In this case, the network that the IP address
257+
resides in is defined in the host project.
207258
- name: 'protocol'
208259
type: String
209260
description: |-
@@ -221,3 +272,12 @@ properties:
221272
type: KeyValueLabels
222273
description: |
223274
Resource labels to represent user-provided metadata.
275+
- name: 'roundTrip'
276+
type: Boolean
277+
description: |-
278+
Whether run analysis for the return path from destination to source.
279+
Default value is false.
280+
- name: 'bypassFirewallChecks'
281+
type: Boolean
282+
description: |-
283+
Whether the analysis should skip firewall checking. Default value is false.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
resource "google_network_management_connectivity_test" "{{$.PrimaryResourceId}}" {
2+
name = "{{index $.Vars "primary_resource_name"}}"
3+
source {
4+
gke_master_cluster = "projects/test-project/locations/us-central1/clusters/name"
5+
cloud_sql_instance = "projects/test-project/instances/name"
6+
app_engine_version {
7+
uri = "apps/test-project/services/default/versions/name"
8+
}
9+
cloud_function {
10+
uri = "projects/test-project/locations/us-central1/functions/name"
11+
}
12+
cloud_run_revision {
13+
uri = "projects/test-project/locations/us-central1/revisions/name"
14+
}
15+
port = 80
16+
}
17+
destination {
18+
port = 443
19+
forwarding_rule = "projects/test-project/regions/us-central1/forwardingRules/name"
20+
gke_master_cluster = "projects/test-project/locations/us-central1/clusters/name"
21+
fqdn = "name.us-central1.gke.goog"
22+
cloud_sql_instance = "projects/test-project/instances/name"
23+
redis_instance = "projects/test-project/locations/us-central1/instances/name"
24+
redis_cluster = "projects/test-project/locations/us-central1/clusters/name"
25+
}
26+
bypass_firewall_checks = true
27+
round_trip = true
28+
}

0 commit comments

Comments
 (0)