UNPKG

@pulumi/gcp

Version:

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

279 lines • 13.2 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.InterconnectAttachment = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Represents an InterconnectAttachment (VLAN attachment) resource. For more * information, see Creating VLAN Attachments. * * To get more information about InterconnectAttachment, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/interconnectAttachments) * * How-to Guides * * [Create a Interconnect attachment](https://cloud.google.com/network-connectivity/docs/interconnect/how-to/dedicated/creating-vlan-attachments) * * ## Example Usage * * ### Interconnect Attachment Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const foobarNetwork = new gcp.compute.Network("foobar", { * name: "network-1", * autoCreateSubnetworks: false, * }); * const foobar = new gcp.compute.Router("foobar", { * name: "router-1", * network: foobarNetwork.name, * bgp: { * asn: 16550, * }, * }); * const onPrem = new gcp.compute.InterconnectAttachment("on_prem", { * name: "on-prem-attachment", * edgeAvailabilityDomain: "AVAILABILITY_DOMAIN_1", * type: "PARTNER", * router: foobar.id, * mtu: "1500", * labels: { * mykey: "myvalue", * }, * }); * ``` * ### Compute Interconnect Attachment Ipsec Encryption * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network = new gcp.compute.Network("network", { * name: "test-network", * autoCreateSubnetworks: false, * }); * const address = new gcp.compute.Address("address", { * name: "test-address", * addressType: "INTERNAL", * purpose: "IPSEC_INTERCONNECT", * address: "192.168.1.0", * prefixLength: 29, * network: network.selfLink, * }); * const router = new gcp.compute.Router("router", { * name: "test-router", * network: network.name, * encryptedInterconnectRouter: true, * bgp: { * asn: 16550, * }, * }); * const ipsec_encrypted_interconnect_attachment = new gcp.compute.InterconnectAttachment("ipsec-encrypted-interconnect-attachment", { * name: "test-interconnect-attachment", * edgeAvailabilityDomain: "AVAILABILITY_DOMAIN_1", * type: "PARTNER", * router: router.id, * encryption: "IPSEC", * ipsecInternalAddresses: [address.selfLink], * }); * ``` * ### Compute Interconnect Attachment Custom Ranges * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const foobarNetwork = new gcp.compute.Network("foobar", { * name: "test-network", * autoCreateSubnetworks: false, * }); * const foobar = new gcp.compute.Router("foobar", { * name: "test-router", * network: foobarNetwork.name, * bgp: { * asn: 16550, * }, * }); * const custom_ranges_interconnect_attachment = new gcp.compute.InterconnectAttachment("custom-ranges-interconnect-attachment", { * name: "test-custom-ranges-interconnect-attachment", * edgeAvailabilityDomain: "AVAILABILITY_DOMAIN_1", * type: "PARTNER", * router: foobar.id, * mtu: "1500", * stackType: "IPV4_IPV6", * labels: { * mykey: "myvalue", * }, * candidateCloudRouterIpAddress: "192.169.0.1/29", * candidateCustomerRouterIpAddress: "192.169.0.2/29", * candidateCloudRouterIpv6Address: "748d:2f23:6651:9455:828b:ca81:6fe0:fed1/125", * candidateCustomerRouterIpv6Address: "748d:2f23:6651:9455:828b:ca81:6fe0:fed2/125", * }); * ``` * * ## Import * * InterconnectAttachment can be imported using any of these accepted formats: * * * `projects/{{project}}/regions/{{region}}/interconnectAttachments/{{name}}` * * `{{project}}/{{region}}/{{name}}` * * `{{region}}/{{name}}` * * `{{name}}` * * When using the `pulumi import` command, InterconnectAttachment can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/interconnectAttachment:InterconnectAttachment default projects/{{project}}/regions/{{region}}/interconnectAttachments/{{name}} * $ pulumi import gcp:compute/interconnectAttachment:InterconnectAttachment default {{project}}/{{region}}/{{name}} * $ pulumi import gcp:compute/interconnectAttachment:InterconnectAttachment default {{region}}/{{name}} * $ pulumi import gcp:compute/interconnectAttachment:InterconnectAttachment default {{name}} * ``` */ class InterconnectAttachment extends pulumi.CustomResource { /** * Get an existing InterconnectAttachment 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 InterconnectAttachment(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:compute/interconnectAttachment:InterconnectAttachment'; /** * Returns true if the given object is an instance of InterconnectAttachment. 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'] === InterconnectAttachment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["adminEnabled"] = state?.adminEnabled; resourceInputs["attachmentGroup"] = state?.attachmentGroup; resourceInputs["bandwidth"] = state?.bandwidth; resourceInputs["candidateCloudRouterIpAddress"] = state?.candidateCloudRouterIpAddress; resourceInputs["candidateCloudRouterIpv6Address"] = state?.candidateCloudRouterIpv6Address; resourceInputs["candidateCustomerRouterIpAddress"] = state?.candidateCustomerRouterIpAddress; resourceInputs["candidateCustomerRouterIpv6Address"] = state?.candidateCustomerRouterIpv6Address; resourceInputs["candidateSubnets"] = state?.candidateSubnets; resourceInputs["cloudRouterIpAddress"] = state?.cloudRouterIpAddress; resourceInputs["cloudRouterIpv6Address"] = state?.cloudRouterIpv6Address; resourceInputs["creationTimestamp"] = state?.creationTimestamp; resourceInputs["customerRouterIpAddress"] = state?.customerRouterIpAddress; resourceInputs["customerRouterIpv6Address"] = state?.customerRouterIpv6Address; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["edgeAvailabilityDomain"] = state?.edgeAvailabilityDomain; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["encryption"] = state?.encryption; resourceInputs["googleReferenceId"] = state?.googleReferenceId; resourceInputs["interconnect"] = state?.interconnect; resourceInputs["ipsecInternalAddresses"] = state?.ipsecInternalAddresses; resourceInputs["l2Forwarding"] = state?.l2Forwarding; resourceInputs["labelFingerprint"] = state?.labelFingerprint; resourceInputs["labels"] = state?.labels; resourceInputs["mtu"] = state?.mtu; resourceInputs["name"] = state?.name; resourceInputs["pairingKey"] = state?.pairingKey; resourceInputs["params"] = state?.params; resourceInputs["partnerAsn"] = state?.partnerAsn; resourceInputs["privateInterconnectInfos"] = state?.privateInterconnectInfos; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["region"] = state?.region; resourceInputs["router"] = state?.router; resourceInputs["selfLink"] = state?.selfLink; resourceInputs["stackType"] = state?.stackType; resourceInputs["state"] = state?.state; resourceInputs["subnetLength"] = state?.subnetLength; resourceInputs["type"] = state?.type; resourceInputs["vlanTag8021q"] = state?.vlanTag8021q; } else { const args = argsOrState; resourceInputs["adminEnabled"] = args?.adminEnabled; resourceInputs["bandwidth"] = args?.bandwidth; resourceInputs["candidateCloudRouterIpAddress"] = args?.candidateCloudRouterIpAddress; resourceInputs["candidateCloudRouterIpv6Address"] = args?.candidateCloudRouterIpv6Address; resourceInputs["candidateCustomerRouterIpAddress"] = args?.candidateCustomerRouterIpAddress; resourceInputs["candidateCustomerRouterIpv6Address"] = args?.candidateCustomerRouterIpv6Address; resourceInputs["candidateSubnets"] = args?.candidateSubnets; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["edgeAvailabilityDomain"] = args?.edgeAvailabilityDomain; resourceInputs["encryption"] = args?.encryption; resourceInputs["interconnect"] = args?.interconnect; resourceInputs["ipsecInternalAddresses"] = args?.ipsecInternalAddresses; resourceInputs["l2Forwarding"] = args?.l2Forwarding; resourceInputs["labels"] = args?.labels; resourceInputs["mtu"] = args?.mtu; resourceInputs["name"] = args?.name; resourceInputs["params"] = args?.params; resourceInputs["project"] = args?.project; resourceInputs["region"] = args?.region; resourceInputs["router"] = args?.router; resourceInputs["stackType"] = args?.stackType; resourceInputs["subnetLength"] = args?.subnetLength; resourceInputs["type"] = args?.type; resourceInputs["vlanTag8021q"] = args?.vlanTag8021q; resourceInputs["attachmentGroup"] = undefined /*out*/; resourceInputs["cloudRouterIpAddress"] = undefined /*out*/; resourceInputs["cloudRouterIpv6Address"] = undefined /*out*/; resourceInputs["creationTimestamp"] = undefined /*out*/; resourceInputs["customerRouterIpAddress"] = undefined /*out*/; resourceInputs["customerRouterIpv6Address"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["googleReferenceId"] = undefined /*out*/; resourceInputs["labelFingerprint"] = undefined /*out*/; resourceInputs["pairingKey"] = undefined /*out*/; resourceInputs["partnerAsn"] = undefined /*out*/; resourceInputs["privateInterconnectInfos"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["selfLink"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(InterconnectAttachment.__pulumiType, name, resourceInputs, opts); } } exports.InterconnectAttachment = InterconnectAttachment; //# sourceMappingURL=interconnectAttachment.js.map