1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. networkmanagement
  5. getConnectivityTests
Google Cloud v9.4.0 published on Tuesday, Nov 4, 2025 by Pulumi

gcp.networkmanagement.getConnectivityTests

Start a Neo task
Explain and create a gcp.networkmanagement.getConnectivityTests resource
gcp logo
Google Cloud v9.4.0 published on Tuesday, Nov 4, 2025 by Pulumi

    A connectivity test is 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. This data source allows you to list connectivity tests in a project.

    To get more information about connectivity tests, see:

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const tests = gcp.networkmanagement.getConnectivityTests({
        filter: "name:projects/project-id/locations/global/connectivityTests/my-tests",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    tests = gcp.networkmanagement.get_connectivity_tests(filter="name:projects/project-id/locations/global/connectivityTests/my-tests")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/networkmanagement"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := networkmanagement.GetConnectivityTests(ctx, &networkmanagement.GetConnectivityTestsArgs{
    			Filter: pulumi.StringRef("name:projects/project-id/locations/global/connectivityTests/my-tests"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var tests = Gcp.NetworkManagement.GetConnectivityTests.Invoke(new()
        {
            Filter = "name:projects/project-id/locations/global/connectivityTests/my-tests",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.networkmanagement.NetworkmanagementFunctions;
    import com.pulumi.gcp.networkmanagement.inputs.GetConnectivityTestsArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var tests = NetworkmanagementFunctions.getConnectivityTests(GetConnectivityTestsArgs.builder()
                .filter("name:projects/project-id/locations/global/connectivityTests/my-tests")
                .build());
    
        }
    }
    
    variables:
      tests:
        fn::invoke:
          function: gcp:networkmanagement:getConnectivityTests
          arguments:
            filter: name:projects/project-id/locations/global/connectivityTests/my-tests
    

    Using getConnectivityTests

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getConnectivityTests(args: GetConnectivityTestsArgs, opts?: InvokeOptions): Promise<GetConnectivityTestsResult>
    function getConnectivityTestsOutput(args: GetConnectivityTestsOutputArgs, opts?: InvokeOptions): Output<GetConnectivityTestsResult>
    def get_connectivity_tests(filter: Optional[str] = None,
                               project: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetConnectivityTestsResult
    def get_connectivity_tests_output(filter: Optional[pulumi.Input[str]] = None,
                               project: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetConnectivityTestsResult]
    func GetConnectivityTests(ctx *Context, args *GetConnectivityTestsArgs, opts ...InvokeOption) (*GetConnectivityTestsResult, error)
    func GetConnectivityTestsOutput(ctx *Context, args *GetConnectivityTestsOutputArgs, opts ...InvokeOption) GetConnectivityTestsResultOutput

    > Note: This function is named GetConnectivityTests in the Go SDK.

    public static class GetConnectivityTests 
    {
        public static Task<GetConnectivityTestsResult> InvokeAsync(GetConnectivityTestsArgs args, InvokeOptions? opts = null)
        public static Output<GetConnectivityTestsResult> Invoke(GetConnectivityTestsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetConnectivityTestsResult> getConnectivityTests(GetConnectivityTestsArgs args, InvokeOptions options)
    public static Output<GetConnectivityTestsResult> getConnectivityTests(GetConnectivityTestsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:networkmanagement/getConnectivityTests:getConnectivityTests
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filter string
    Lists the ConnectivityTests that match the filter expression. A filter expression filters the resources listed in the response.
    Project string
    The ID of the project.
    Filter string
    Lists the ConnectivityTests that match the filter expression. A filter expression filters the resources listed in the response.
    Project string
    The ID of the project.
    filter String
    Lists the ConnectivityTests that match the filter expression. A filter expression filters the resources listed in the response.
    project String
    The ID of the project.
    filter string
    Lists the ConnectivityTests that match the filter expression. A filter expression filters the resources listed in the response.
    project string
    The ID of the project.
    filter str
    Lists the ConnectivityTests that match the filter expression. A filter expression filters the resources listed in the response.
    project str
    The ID of the project.
    filter String
    Lists the ConnectivityTests that match the filter expression. A filter expression filters the resources listed in the response.
    project String
    The ID of the project.

    getConnectivityTests Result

    The following output properties are available:

    ConnectivityTests List<GetConnectivityTestsConnectivityTest>
    A list of connectivity tests in the selected project matching the filter. Structure is defined below.
    Id string
    The provider-assigned unique ID for this managed resource.
    Project string
    The ID of the project in which the resource belongs.
    Filter string
    ConnectivityTests []GetConnectivityTestsConnectivityTest
    A list of connectivity tests in the selected project matching the filter. Structure is defined below.
    Id string
    The provider-assigned unique ID for this managed resource.
    Project string
    The ID of the project in which the resource belongs.
    Filter string
    connectivityTests List<GetConnectivityTestsConnectivityTest>
    A list of connectivity tests in the selected project matching the filter. Structure is defined below.
    id String
    The provider-assigned unique ID for this managed resource.
    project String
    The ID of the project in which the resource belongs.
    filter String
    connectivityTests GetConnectivityTestsConnectivityTest[]
    A list of connectivity tests in the selected project matching the filter. Structure is defined below.
    id string
    The provider-assigned unique ID for this managed resource.
    project string
    The ID of the project in which the resource belongs.
    filter string
    connectivity_tests Sequence[GetConnectivityTestsConnectivityTest]
    A list of connectivity tests in the selected project matching the filter. Structure is defined below.
    id str
    The provider-assigned unique ID for this managed resource.
    project str
    The ID of the project in which the resource belongs.
    filter str
    connectivityTests List<Property Map>
    A list of connectivity tests in the selected project matching the filter. Structure is defined below.
    id String
    The provider-assigned unique ID for this managed resource.
    project String
    The ID of the project in which the resource belongs.
    filter String

    Supporting Types

    GetConnectivityTestsConnectivityTest

    BypassFirewallChecks bool
    Whether the analysis should skip firewall checking.
    Description string
    The user-supplied description of the Connectivity Test.
    Destinations List<GetConnectivityTestsConnectivityTestDestination>
    Destination specification of the Connectivity Test. Structure is documented below.
    EffectiveLabels Dictionary<string, string>
    Labels Dictionary<string, string>
    Resource labels to represent user-provided metadata.
    Name string
    Unique name for the connectivity test.
    Project string
    The ID of the project.
    Protocol string
    IP Protocol of the test.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    RelatedProjects List<string>
    Other projects that may be relevant for reachability analysis.
    RoundTrip bool
    Whether run analysis for the return path from destination to source.
    Sources List<GetConnectivityTestsConnectivityTestSource>
    Source specification of the Connectivity Test. Structure is documented below.
    BypassFirewallChecks bool
    Whether the analysis should skip firewall checking.
    Description string
    The user-supplied description of the Connectivity Test.
    Destinations []GetConnectivityTestsConnectivityTestDestination
    Destination specification of the Connectivity Test. Structure is documented below.
    EffectiveLabels map[string]string
    Labels map[string]string
    Resource labels to represent user-provided metadata.
    Name string
    Unique name for the connectivity test.
    Project string
    The ID of the project.
    Protocol string
    IP Protocol of the test.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    RelatedProjects []string
    Other projects that may be relevant for reachability analysis.
    RoundTrip bool
    Whether run analysis for the return path from destination to source.
    Sources []GetConnectivityTestsConnectivityTestSource
    Source specification of the Connectivity Test. Structure is documented below.
    bypassFirewallChecks Boolean
    Whether the analysis should skip firewall checking.
    description String
    The user-supplied description of the Connectivity Test.
    destinations List<GetConnectivityTestsConnectivityTestDestination>
    Destination specification of the Connectivity Test. Structure is documented below.
    effectiveLabels Map<String,String>
    labels Map<String,String>
    Resource labels to represent user-provided metadata.
    name String
    Unique name for the connectivity test.
    project String
    The ID of the project.
    protocol String
    IP Protocol of the test.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    relatedProjects List<String>
    Other projects that may be relevant for reachability analysis.
    roundTrip Boolean
    Whether run analysis for the return path from destination to source.
    sources List<GetConnectivityTestsConnectivityTestSource>
    Source specification of the Connectivity Test. Structure is documented below.
    bypassFirewallChecks boolean
    Whether the analysis should skip firewall checking.
    description string
    The user-supplied description of the Connectivity Test.
    destinations GetConnectivityTestsConnectivityTestDestination[]
    Destination specification of the Connectivity Test. Structure is documented below.
    effectiveLabels {[key: string]: string}
    labels {[key: string]: string}
    Resource labels to represent user-provided metadata.
    name string
    Unique name for the connectivity test.
    project string
    The ID of the project.
    protocol string
    IP Protocol of the test.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    relatedProjects string[]
    Other projects that may be relevant for reachability analysis.
    roundTrip boolean
    Whether run analysis for the return path from destination to source.
    sources GetConnectivityTestsConnectivityTestSource[]
    Source specification of the Connectivity Test. Structure is documented below.
    bypass_firewall_checks bool
    Whether the analysis should skip firewall checking.
    description str
    The user-supplied description of the Connectivity Test.
    destinations Sequence[GetConnectivityTestsConnectivityTestDestination]
    Destination specification of the Connectivity Test. Structure is documented below.
    effective_labels Mapping[str, str]
    labels Mapping[str, str]
    Resource labels to represent user-provided metadata.
    name str
    Unique name for the connectivity test.
    project str
    The ID of the project.
    protocol str
    IP Protocol of the test.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    related_projects Sequence[str]
    Other projects that may be relevant for reachability analysis.
    round_trip bool
    Whether run analysis for the return path from destination to source.
    sources Sequence[GetConnectivityTestsConnectivityTestSource]
    Source specification of the Connectivity Test. Structure is documented below.
    bypassFirewallChecks Boolean
    Whether the analysis should skip firewall checking.
    description String
    The user-supplied description of the Connectivity Test.
    destinations List<Property Map>
    Destination specification of the Connectivity Test. Structure is documented below.
    effectiveLabels Map<String>
    labels Map<String>
    Resource labels to represent user-provided metadata.
    name String
    Unique name for the connectivity test.
    project String
    The ID of the project.
    protocol String
    IP Protocol of the test.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    relatedProjects List<String>
    Other projects that may be relevant for reachability analysis.
    roundTrip Boolean
    Whether run analysis for the return path from destination to source.
    sources List<Property Map>
    Source specification of the Connectivity Test. Structure is documented below.

    GetConnectivityTestsConnectivityTestDestination

    CloudSqlInstance string
    A Cloud SQL instance URI.
    ForwardingRule string
    Forwarding rule URI. Forwarding rules are frontends for load balancers, PSC endpoints, and Protocol Forwarding.
    Fqdn string
    A DNS endpoint of Google Kubernetes Engine cluster control plane.
    GkeMasterCluster string
    A cluster URI for Google Kubernetes Engine cluster control plane.
    Instance string
    A Compute Engine instance URI.
    IpAddress string
    The IP address of the endpoint.
    Network string
    A VPC network URI.
    Port int
    The IP protocol port of the endpoint.
    ProjectId string
    Project ID where the endpoint is located.
    RedisCluster string
    A Redis Cluster URI.
    RedisInstance string
    A Redis Instance URI.
    CloudSqlInstance string
    A Cloud SQL instance URI.
    ForwardingRule string
    Forwarding rule URI. Forwarding rules are frontends for load balancers, PSC endpoints, and Protocol Forwarding.
    Fqdn string
    A DNS endpoint of Google Kubernetes Engine cluster control plane.
    GkeMasterCluster string
    A cluster URI for Google Kubernetes Engine cluster control plane.
    Instance string
    A Compute Engine instance URI.
    IpAddress string
    The IP address of the endpoint.
    Network string
    A VPC network URI.
    Port int
    The IP protocol port of the endpoint.
    ProjectId string
    Project ID where the endpoint is located.
    RedisCluster string
    A Redis Cluster URI.
    RedisInstance string
    A Redis Instance URI.
    cloudSqlInstance String
    A Cloud SQL instance URI.
    forwardingRule String
    Forwarding rule URI. Forwarding rules are frontends for load balancers, PSC endpoints, and Protocol Forwarding.
    fqdn String
    A DNS endpoint of Google Kubernetes Engine cluster control plane.
    gkeMasterCluster String
    A cluster URI for Google Kubernetes Engine cluster control plane.
    instance String
    A Compute Engine instance URI.
    ipAddress String
    The IP address of the endpoint.
    network String
    A VPC network URI.
    port Integer
    The IP protocol port of the endpoint.
    projectId String
    Project ID where the endpoint is located.
    redisCluster String
    A Redis Cluster URI.
    redisInstance String
    A Redis Instance URI.
    cloudSqlInstance string
    A Cloud SQL instance URI.
    forwardingRule string
    Forwarding rule URI. Forwarding rules are frontends for load balancers, PSC endpoints, and Protocol Forwarding.
    fqdn string
    A DNS endpoint of Google Kubernetes Engine cluster control plane.
    gkeMasterCluster string
    A cluster URI for Google Kubernetes Engine cluster control plane.
    instance string
    A Compute Engine instance URI.
    ipAddress string
    The IP address of the endpoint.
    network string
    A VPC network URI.
    port number
    The IP protocol port of the endpoint.
    projectId string
    Project ID where the endpoint is located.
    redisCluster string
    A Redis Cluster URI.
    redisInstance string
    A Redis Instance URI.
    cloud_sql_instance str
    A Cloud SQL instance URI.
    forwarding_rule str
    Forwarding rule URI. Forwarding rules are frontends for load balancers, PSC endpoints, and Protocol Forwarding.
    fqdn str
    A DNS endpoint of Google Kubernetes Engine cluster control plane.
    gke_master_cluster str
    A cluster URI for Google Kubernetes Engine cluster control plane.
    instance str
    A Compute Engine instance URI.
    ip_address str
    The IP address of the endpoint.
    network str
    A VPC network URI.
    port int
    The IP protocol port of the endpoint.
    project_id str
    Project ID where the endpoint is located.
    redis_cluster str
    A Redis Cluster URI.
    redis_instance str
    A Redis Instance URI.
    cloudSqlInstance String
    A Cloud SQL instance URI.
    forwardingRule String
    Forwarding rule URI. Forwarding rules are frontends for load balancers, PSC endpoints, and Protocol Forwarding.
    fqdn String
    A DNS endpoint of Google Kubernetes Engine cluster control plane.
    gkeMasterCluster String
    A cluster URI for Google Kubernetes Engine cluster control plane.
    instance String
    A Compute Engine instance URI.
    ipAddress String
    The IP address of the endpoint.
    network String
    A VPC network URI.
    port Number
    The IP protocol port of the endpoint.
    projectId String
    Project ID where the endpoint is located.
    redisCluster String
    A Redis Cluster URI.
    redisInstance String
    A Redis Instance URI.

    GetConnectivityTestsConnectivityTestSource

    AppEngineVersions List<GetConnectivityTestsConnectivityTestSourceAppEngineVersion>
    An App Engine service version. Structure is documented below.
    CloudFunctions List<GetConnectivityTestsConnectivityTestSourceCloudFunction>
    A Cloud Function. Structure is documented below.
    CloudRunRevisions List<GetConnectivityTestsConnectivityTestSourceCloudRunRevision>
    A Cloud Run revision. Structure is documented below.
    CloudSqlInstance string
    A Cloud SQL instance URI.
    GkeMasterCluster string
    A cluster URI for Google Kubernetes Engine cluster control plane.
    Instance string
    A Compute Engine instance URI.
    IpAddress string
    The IP address of the endpoint.
    Network string
    A VPC network URI.
    NetworkType string
    Type of the network where the endpoint is located.
    Port int
    The IP protocol port of the endpoint.
    ProjectId string
    Project ID where the endpoint is located.
    AppEngineVersions []GetConnectivityTestsConnectivityTestSourceAppEngineVersion
    An App Engine service version. Structure is documented below.
    CloudFunctions []GetConnectivityTestsConnectivityTestSourceCloudFunction
    A Cloud Function. Structure is documented below.
    CloudRunRevisions []GetConnectivityTestsConnectivityTestSourceCloudRunRevision
    A Cloud Run revision. Structure is documented below.
    CloudSqlInstance string
    A Cloud SQL instance URI.
    GkeMasterCluster string
    A cluster URI for Google Kubernetes Engine cluster control plane.
    Instance string
    A Compute Engine instance URI.
    IpAddress string
    The IP address of the endpoint.
    Network string
    A VPC network URI.
    NetworkType string
    Type of the network where the endpoint is located.
    Port int
    The IP protocol port of the endpoint.
    ProjectId string
    Project ID where the endpoint is located.
    appEngineVersions List<GetConnectivityTestsConnectivityTestSourceAppEngineVersion>
    An App Engine service version. Structure is documented below.
    cloudFunctions List<GetConnectivityTestsConnectivityTestSourceCloudFunction>
    A Cloud Function. Structure is documented below.
    cloudRunRevisions List<GetConnectivityTestsConnectivityTestSourceCloudRunRevision>
    A Cloud Run revision. Structure is documented below.
    cloudSqlInstance String
    A Cloud SQL instance URI.
    gkeMasterCluster String
    A cluster URI for Google Kubernetes Engine cluster control plane.
    instance String
    A Compute Engine instance URI.
    ipAddress String
    The IP address of the endpoint.
    network String
    A VPC network URI.
    networkType String
    Type of the network where the endpoint is located.
    port Integer
    The IP protocol port of the endpoint.
    projectId String
    Project ID where the endpoint is located.
    appEngineVersions GetConnectivityTestsConnectivityTestSourceAppEngineVersion[]
    An App Engine service version. Structure is documented below.
    cloudFunctions GetConnectivityTestsConnectivityTestSourceCloudFunction[]
    A Cloud Function. Structure is documented below.
    cloudRunRevisions GetConnectivityTestsConnectivityTestSourceCloudRunRevision[]
    A Cloud Run revision. Structure is documented below.
    cloudSqlInstance string
    A Cloud SQL instance URI.
    gkeMasterCluster string
    A cluster URI for Google Kubernetes Engine cluster control plane.
    instance string
    A Compute Engine instance URI.
    ipAddress string
    The IP address of the endpoint.
    network string
    A VPC network URI.
    networkType string
    Type of the network where the endpoint is located.
    port number
    The IP protocol port of the endpoint.
    projectId string
    Project ID where the endpoint is located.
    app_engine_versions Sequence[GetConnectivityTestsConnectivityTestSourceAppEngineVersion]
    An App Engine service version. Structure is documented below.
    cloud_functions Sequence[GetConnectivityTestsConnectivityTestSourceCloudFunction]
    A Cloud Function. Structure is documented below.
    cloud_run_revisions Sequence[GetConnectivityTestsConnectivityTestSourceCloudRunRevision]
    A Cloud Run revision. Structure is documented below.
    cloud_sql_instance str
    A Cloud SQL instance URI.
    gke_master_cluster str
    A cluster URI for Google Kubernetes Engine cluster control plane.
    instance str
    A Compute Engine instance URI.
    ip_address str
    The IP address of the endpoint.
    network str
    A VPC network URI.
    network_type str
    Type of the network where the endpoint is located.
    port int
    The IP protocol port of the endpoint.
    project_id str
    Project ID where the endpoint is located.
    appEngineVersions List<Property Map>
    An App Engine service version. Structure is documented below.
    cloudFunctions List<Property Map>
    A Cloud Function. Structure is documented below.
    cloudRunRevisions List<Property Map>
    A Cloud Run revision. Structure is documented below.
    cloudSqlInstance String
    A Cloud SQL instance URI.
    gkeMasterCluster String
    A cluster URI for Google Kubernetes Engine cluster control plane.
    instance String
    A Compute Engine instance URI.
    ipAddress String
    The IP address of the endpoint.
    network String
    A VPC network URI.
    networkType String
    Type of the network where the endpoint is located.
    port Number
    The IP protocol port of the endpoint.
    projectId String
    Project ID where the endpoint is located.

    GetConnectivityTestsConnectivityTestSourceAppEngineVersion

    Uri string
    A Cloud Run revision URI.
    Uri string
    A Cloud Run revision URI.
    uri String
    A Cloud Run revision URI.
    uri string
    A Cloud Run revision URI.
    uri str
    A Cloud Run revision URI.
    uri String
    A Cloud Run revision URI.

    GetConnectivityTestsConnectivityTestSourceCloudFunction

    Uri string
    A Cloud Run revision URI.
    Uri string
    A Cloud Run revision URI.
    uri String
    A Cloud Run revision URI.
    uri string
    A Cloud Run revision URI.
    uri str
    A Cloud Run revision URI.
    uri String
    A Cloud Run revision URI.

    GetConnectivityTestsConnectivityTestSourceCloudRunRevision

    Uri string
    A Cloud Run revision URI.
    Uri string
    A Cloud Run revision URI.
    uri String
    A Cloud Run revision URI.
    uri string
    A Cloud Run revision URI.
    uri str
    A Cloud Run revision URI.
    uri String
    A Cloud Run revision URI.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud v9.4.0 published on Tuesday, Nov 4, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate