Google NetworkManagement Connectivity Test
This page shows how to write Terraform for NetworkManagement Connectivity Test and write them securely.
google_network_management_connectivity_test (Terraform)
The Connectivity Test in NetworkManagement can be configured in Terraform with the resource name google_network_management_connectivity_test
. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "google_network_management_connectivity_test" "r4-1-4" {
name = "r4-1-4-ba-CANNOT-ping-aa"
source {
instance = "projects/principal-truck-309700/zones/us-east1-b/instances/vm-ba"
}
resource "google_network_management_connectivity_test" "r4-1-3" {
name = "r4-1-3-aa-can-ping-ba"
source {
instance = "projects/org-a-309016/zones/us-east1-b/instances/vm-aa"
}
resource "google_network_management_connectivity_test" "instance-test" {
name = "conn-test-instances"
source {
instance = google_compute_instance.source.id
}
resource "google_network_management_connectivity_test" "this" {
description = var.description
labels = var.labels
name = var.name
project = var.project
protocol = var.protocol
Parameters
-
description
optional - string
The user-supplied description of the Connectivity Test. Maximum of 512 characters.
Resource labels to represent user-provided metadata.
-
name
required - string
Unique name for the connectivity test.
IP Protocol of the test. When not provided, "TCP" is assumed.
-
related_projects
optional - list of string
Other projects that may be relevant for reachability analysis. This is applicable to scenarios where a test can cross project boundaries.
-
destination
list block-
instance
optional - string
A Compute Engine instance URI.
-
ip_address
optional - string
The IP address of the endpoint, which can be an external or internal IP. An IPv6 address is only allowed when the test's destination is a global load balancer VIP.
-
network
optional - string
A Compute Engine network URI.
-
port
optional - number
The IP protocol port of the endpoint. Only applicable when protocol is TCP or UDP.
-
project_id
optional - string
Project ID where the endpoint is located. The Project ID can be derived from the URI if you provide a VM instance or network URI. The following are two cases where you must provide the project ID: 1. Only the IP address is specified, and the IP address is within a GCP project. 2. When you are using Shared VPC and the IP address that you provide is from the service project. In this case, the network that the IP address resides in is defined in the host project.
-
-
source
list block-
instance
optional - string
A Compute Engine instance URI.
-
ip_address
optional - string
The IP address of the endpoint, which can be an external or internal IP. An IPv6 address is only allowed when the test's destination is a global load balancer VIP.
-
network
optional - string
A Compute Engine network URI.
-
network_type
optional - string
Type of the network where the endpoint is located. Possible values: ["GCP_NETWORK", "NON_GCP_NETWORK"]
-
port
optional - number
The IP protocol port of the endpoint. Only applicable when protocol is TCP or UDP.
-
project_id
optional - string
Project ID where the endpoint is located. The Project ID can be derived from the URI if you provide a VM instance or network URI. The following are two cases where you must provide the project ID: 1. Only the IP address is specified, and the IP address is within a GCP project. 2. When you are using Shared VPC and the IP address that you provide is from the service project. In this case, the network that the IP address resides in is defined in the host project.
-
-
timeouts
single block
Explanation in Terraform Registry
A connectivity test are a static analysis of your resource configurations that enables you to evaluate connectivity to and from Google Cloud resources in your Virtual Private Cloud (VPC) network. To get more information about ConnectivityTest, see:
- API documentation
- How-to Guides
Frequently asked questions
What is Google NetworkManagement Connectivity Test?
Google NetworkManagement Connectivity Test is a resource for NetworkManagement of Google Cloud Platform. Settings can be wrote in Terraform.
Where can I find the example code for the Google NetworkManagement Connectivity Test?
For Terraform, the sohnya/cloud-project, sohnya/cloud-project and tier940/gke-test source code examples are useful. See the Terraform Example section for further details.