UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

166 lines 6.16 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getConnectivityTestRunOutput = exports.getConnectivityTestRun = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * !> This datasource triggers side effects on the target resource. It will take a long time to refresh (i.e. `pulumi preview` will take much longer than usual) and may modify the state of the parent resource or other copies of the resource copying the same parent. * * 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 trigger a rerun operation on a connectivity test and return the results. * * To get more information about connectivity tests, see: * * * [API documentation](https://cloud.google.com/network-intelligence-center/docs/reference/networkmanagement/rest/v1/projects.locations.global.connectivityTests/rerun) * * How-to Guides * * [Official Documentation](https://cloud.google.com/network-intelligence-center/docs) * * ## Example Usage * * ### Network Management Connectivity Test Run Instances * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const vpc = new gcp.compute.Network("vpc", {name: "conn-test-net"}); * const debian9 = gcp.compute.getImage({ * family: "debian-11", * project: "debian-cloud", * }); * const source = new gcp.compute.Instance("source", { * networkInterfaces: [{ * accessConfigs: [{}], * network: vpc.id, * }], * name: "source-vm", * machineType: "e2-medium", * bootDisk: { * initializeParams: { * image: debian9.then(debian9 => debian9.id), * }, * }, * }); * const destination = new gcp.compute.Instance("destination", { * networkInterfaces: [{ * accessConfigs: [{}], * network: vpc.id, * }], * name: "dest-vm", * machineType: "e2-medium", * bootDisk: { * initializeParams: { * image: debian9.then(debian9 => debian9.id), * }, * }, * }); * const instance_test = new gcp.networkmanagement.ConnectivityTest("instance-test", { * name: "conn-test-instances", * source: { * instance: source.id, * }, * destination: { * instance: destination.id, * }, * protocol: "TCP", * labels: { * env: "test", * }, * }); * const instance_test_run = gcp.networkmanagement.getConnectivityTestRunOutput({ * name: instance_test.name, * }); * ``` */ function getConnectivityTestRun(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("gcp:networkmanagement/getConnectivityTestRun:getConnectivityTestRun", { "name": args.name, "project": args.project, }, opts); } exports.getConnectivityTestRun = getConnectivityTestRun; /** * !> This datasource triggers side effects on the target resource. It will take a long time to refresh (i.e. `pulumi preview` will take much longer than usual) and may modify the state of the parent resource or other copies of the resource copying the same parent. * * 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 trigger a rerun operation on a connectivity test and return the results. * * To get more information about connectivity tests, see: * * * [API documentation](https://cloud.google.com/network-intelligence-center/docs/reference/networkmanagement/rest/v1/projects.locations.global.connectivityTests/rerun) * * How-to Guides * * [Official Documentation](https://cloud.google.com/network-intelligence-center/docs) * * ## Example Usage * * ### Network Management Connectivity Test Run Instances * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const vpc = new gcp.compute.Network("vpc", {name: "conn-test-net"}); * const debian9 = gcp.compute.getImage({ * family: "debian-11", * project: "debian-cloud", * }); * const source = new gcp.compute.Instance("source", { * networkInterfaces: [{ * accessConfigs: [{}], * network: vpc.id, * }], * name: "source-vm", * machineType: "e2-medium", * bootDisk: { * initializeParams: { * image: debian9.then(debian9 => debian9.id), * }, * }, * }); * const destination = new gcp.compute.Instance("destination", { * networkInterfaces: [{ * accessConfigs: [{}], * network: vpc.id, * }], * name: "dest-vm", * machineType: "e2-medium", * bootDisk: { * initializeParams: { * image: debian9.then(debian9 => debian9.id), * }, * }, * }); * const instance_test = new gcp.networkmanagement.ConnectivityTest("instance-test", { * name: "conn-test-instances", * source: { * instance: source.id, * }, * destination: { * instance: destination.id, * }, * protocol: "TCP", * labels: { * env: "test", * }, * }); * const instance_test_run = gcp.networkmanagement.getConnectivityTestRunOutput({ * name: instance_test.name, * }); * ``` */ function getConnectivityTestRunOutput(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("gcp:networkmanagement/getConnectivityTestRun:getConnectivityTestRun", { "name": args.name, "project": args.project, }, opts); } exports.getConnectivityTestRunOutput = getConnectivityTestRunOutput; //# sourceMappingURL=getConnectivityTestRun.js.map