UNPKG

@pulumi/gcp

Version:

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

183 lines • 7.94 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! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.VpnConnection = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * A VPN connection * * To get more information about VpnConnection, see: * * * [API documentation](https://cloud.google.com/distributed-cloud/edge/latest/docs/reference/container/rest/v1/projects.locations.vpnConnections) * * How-to Guides * * [Google Distributed Cloud Edge](https://cloud.google.com/distributed-cloud/edge/latest/docs) * * ## Example Usage * * ### Edgecontainer Vpn Connection * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const cluster = new gcp.edgecontainer.Cluster("cluster", { * name: "default", * location: "us-central1", * authorization: { * adminUsers: { * username: "admin@hashicorptest.com", * }, * }, * networking: { * clusterIpv4CidrBlocks: ["10.0.0.0/16"], * servicesIpv4CidrBlocks: ["10.1.0.0/16"], * }, * fleet: { * project: project.then(project => `projects/${project.number}`), * }, * }); * const nodePool = new gcp.edgecontainer.NodePool("node_pool", { * name: "nodepool-1", * cluster: cluster.name, * location: "us-central1", * nodeLocation: "us-central1-edge-example-edgesite", * nodeCount: 3, * }); * const vpc = new gcp.compute.Network("vpc", {name: "example-vpc"}); * const _default = new gcp.edgecontainer.VpnConnection("default", { * name: "vpn-connection-1", * location: "us-central1", * cluster: pulumi.all([project, cluster.name]).apply(([project, name]) => `projects/${project.number}/locations/us-east1/clusters/${name}`), * vpc: vpc.name, * enableHighAvailability: true, * labels: { * my_key: "my_val", * other_key: "other_val", * }, * }, { * dependsOn: [nodePool], * }); * ``` * * ## Import * * VpnConnection can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/vpnConnections/{{name}}` * * `{{project}}/{{location}}/{{name}}` * * `{{location}}/{{name}}` * * When using the `pulumi import` command, VpnConnection can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:edgecontainer/vpnConnection:VpnConnection default projects/{{project}}/locations/{{location}}/vpnConnections/{{name}} * $ pulumi import gcp:edgecontainer/vpnConnection:VpnConnection default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:edgecontainer/vpnConnection:VpnConnection default {{location}}/{{name}} * ``` */ class VpnConnection extends pulumi.CustomResource { /** * Get an existing VpnConnection 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 VpnConnection(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:edgecontainer/vpnConnection:VpnConnection'; /** * Returns true if the given object is an instance of VpnConnection. 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'] === VpnConnection.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cluster"] = state?.cluster; resourceInputs["createTime"] = state?.createTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["details"] = state?.details; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["enableHighAvailability"] = state?.enableHighAvailability; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["natGatewayIp"] = state?.natGatewayIp; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["router"] = state?.router; resourceInputs["updateTime"] = state?.updateTime; resourceInputs["vpc"] = state?.vpc; resourceInputs["vpcProject"] = state?.vpcProject; } else { const args = argsOrState; if (args?.cluster === undefined && !opts.urn) { throw new Error("Missing required property 'cluster'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["cluster"] = args?.cluster; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["enableHighAvailability"] = args?.enableHighAvailability; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["natGatewayIp"] = args?.natGatewayIp; resourceInputs["project"] = args?.project; resourceInputs["router"] = args?.router; resourceInputs["vpc"] = args?.vpc; resourceInputs["vpcProject"] = args?.vpcProject; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["details"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(VpnConnection.__pulumiType, name, resourceInputs, opts); } } exports.VpnConnection = VpnConnection; //# sourceMappingURL=vpnConnection.js.map