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
-
descriptionoptional - string
The user-supplied description of the Connectivity Test. Maximum of 512 characters.
Resource labels to represent user-provided metadata.
-
namerequired - string
Unique name for the connectivity test.
IP Protocol of the test. When not provided, "TCP" is assumed.
-
related_projectsoptional - list of string
Other projects that may be relevant for reachability analysis. This is applicable to scenarios where a test can cross project boundaries.
-
destinationlist block-
instanceoptional - string
A Compute Engine instance URI.
-
ip_addressoptional - 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.
-
networkoptional - string
A Compute Engine network URI.
-
portoptional - number
The IP protocol port of the endpoint. Only applicable when protocol is TCP or UDP.
-
project_idoptional - 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.
-
-
sourcelist block-
instanceoptional - string
A Compute Engine instance URI.
-
ip_addressoptional - 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.
-
networkoptional - string
A Compute Engine network URI.
-
network_typeoptional - string
Type of the network where the endpoint is located. Possible values: ["GCP_NETWORK", "NON_GCP_NETWORK"]
-
portoptional - number
The IP protocol port of the endpoint. Only applicable when protocol is TCP or UDP.
-
project_idoptional - 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.
-
-
timeoutssingle 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.