"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.ConnectivityTest = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * 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](https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/reference/networkmanagement/rest/v1/projects.locations.global.connectivityTests)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/network-intelligence-center/docs)
 *
 * ## Example Usage
 *
 * ### Network Management Connectivity Test 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",
 *     },
 * });
 * ```
 * ### Network Management Connectivity Test Addresses
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const vpc = new gcp.compute.Network("vpc", {name: "connectivity-vpc"});
 * const subnet = new gcp.compute.Subnetwork("subnet", {
 *     name: "connectivity-vpc-subnet",
 *     ipCidrRange: "10.0.0.0/16",
 *     region: "us-central1",
 *     network: vpc.id,
 * });
 * const source_addr = new gcp.compute.Address("source-addr", {
 *     name: "src-addr",
 *     subnetwork: subnet.id,
 *     addressType: "INTERNAL",
 *     address: "10.0.42.42",
 *     region: "us-central1",
 * });
 * const dest_addr = new gcp.compute.Address("dest-addr", {
 *     name: "dest-addr",
 *     subnetwork: subnet.id,
 *     addressType: "INTERNAL",
 *     address: "10.0.43.43",
 *     region: "us-central1",
 * });
 * const address_test = new gcp.networkmanagement.ConnectivityTest("address-test", {
 *     name: "conn-test-addr",
 *     source: {
 *         ipAddress: source_addr.address,
 *         projectId: source_addr.project,
 *         network: vpc.id,
 *         networkType: "GCP_NETWORK",
 *     },
 *     destination: {
 *         ipAddress: dest_addr.address,
 *         projectId: dest_addr.project,
 *         network: vpc.id,
 *     },
 *     protocol: "UDP",
 * });
 * ```
 * ### Network Management Connectivity Test Endpoints
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const endpoints_test = new gcp.networkmanagement.ConnectivityTest("endpoints-test", {
 *     name: "conn-test-endpoints",
 *     source: {
 *         gkeMasterCluster: "projects/test-project/locations/us-central1/clusters/name",
 *         cloudSqlInstance: "projects/test-project/instances/name",
 *         appEngineVersion: {
 *             uri: "apps/test-project/services/default/versions/name",
 *         },
 *         cloudFunction: {
 *             uri: "projects/test-project/locations/us-central1/functions/name",
 *         },
 *         cloudRunRevision: {
 *             uri: "projects/test-project/locations/us-central1/revisions/name",
 *         },
 *         port: 80,
 *     },
 *     destination: {
 *         port: 443,
 *         forwardingRule: "projects/test-project/regions/us-central1/forwardingRules/name",
 *         gkeMasterCluster: "projects/test-project/locations/us-central1/clusters/name",
 *         fqdn: "name.us-central1.gke.goog",
 *         cloudSqlInstance: "projects/test-project/instances/name",
 *         redisInstance: "projects/test-project/locations/us-central1/instances/name",
 *         redisCluster: "projects/test-project/locations/us-central1/clusters/name",
 *     },
 *     bypassFirewallChecks: true,
 *     roundTrip: true,
 * });
 * ```
 *
 * ## Import
 *
 * ConnectivityTest can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/global/connectivityTests/{{name}}`
 *
 * * `{{project}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, ConnectivityTest can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:networkmanagement/connectivityTest:ConnectivityTest default projects/{{project}}/locations/global/connectivityTests/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:networkmanagement/connectivityTest:ConnectivityTest default {{project}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:networkmanagement/connectivityTest:ConnectivityTest default {{name}}
 * ```
 */
class ConnectivityTest extends pulumi.CustomResource {
    /**
     * Get an existing ConnectivityTest resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new ConnectivityTest(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ConnectivityTest.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === ConnectivityTest.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["bypassFirewallChecks"] = state?.bypassFirewallChecks;
            resourceInputs["description"] = state?.description;
            resourceInputs["destination"] = state?.destination;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["protocol"] = state?.protocol;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["relatedProjects"] = state?.relatedProjects;
            resourceInputs["roundTrip"] = state?.roundTrip;
            resourceInputs["source"] = state?.source;
        }
        else {
            const args = argsOrState;
            if (args?.destination === undefined && !opts.urn) {
                throw new Error("Missing required property 'destination'");
            }
            if (args?.source === undefined && !opts.urn) {
                throw new Error("Missing required property 'source'");
            }
            resourceInputs["bypassFirewallChecks"] = args?.bypassFirewallChecks;
            resourceInputs["description"] = args?.description;
            resourceInputs["destination"] = args?.destination;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["protocol"] = args?.protocol;
            resourceInputs["relatedProjects"] = args?.relatedProjects;
            resourceInputs["roundTrip"] = args?.roundTrip;
            resourceInputs["source"] = args?.source;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(ConnectivityTest.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ConnectivityTest = ConnectivityTest;
/** @internal */
ConnectivityTest.__pulumiType = 'gcp:networkmanagement/connectivityTest:ConnectivityTest';
//# sourceMappingURL=connectivityTest.js.map