UNPKG

@pulumi/gcp

Version:

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

222 lines • 10.9 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.InterconnectAttachment = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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], * }); * ``` * * ## 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}} * ``` * * ```sh * $ pulumi import gcp:compute/interconnectAttachment:InterconnectAttachment default {{project}}/{{region}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/interconnectAttachment:InterconnectAttachment default {{region}}/{{name}} * ``` * * ```sh * $ 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.adminEnabled : undefined; resourceInputs["bandwidth"] = state ? state.bandwidth : undefined; resourceInputs["candidateSubnets"] = state ? state.candidateSubnets : undefined; resourceInputs["cloudRouterIpAddress"] = state ? state.cloudRouterIpAddress : undefined; resourceInputs["cloudRouterIpv6Address"] = state ? state.cloudRouterIpv6Address : undefined; resourceInputs["creationTimestamp"] = state ? state.creationTimestamp : undefined; resourceInputs["customerRouterIpAddress"] = state ? state.customerRouterIpAddress : undefined; resourceInputs["customerRouterIpv6Address"] = state ? state.customerRouterIpv6Address : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["edgeAvailabilityDomain"] = state ? state.edgeAvailabilityDomain : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["encryption"] = state ? state.encryption : undefined; resourceInputs["googleReferenceId"] = state ? state.googleReferenceId : undefined; resourceInputs["interconnect"] = state ? state.interconnect : undefined; resourceInputs["ipsecInternalAddresses"] = state ? state.ipsecInternalAddresses : undefined; resourceInputs["labelFingerprint"] = state ? state.labelFingerprint : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["mtu"] = state ? state.mtu : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["pairingKey"] = state ? state.pairingKey : undefined; resourceInputs["partnerAsn"] = state ? state.partnerAsn : undefined; resourceInputs["privateInterconnectInfos"] = state ? state.privateInterconnectInfos : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["router"] = state ? state.router : undefined; resourceInputs["selfLink"] = state ? state.selfLink : undefined; resourceInputs["stackType"] = state ? state.stackType : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["subnetLength"] = state ? state.subnetLength : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["vlanTag8021q"] = state ? state.vlanTag8021q : undefined; } else { const args = argsOrState; if ((!args || args.router === undefined) && !opts.urn) { throw new Error("Missing required property 'router'"); } resourceInputs["adminEnabled"] = args ? args.adminEnabled : undefined; resourceInputs["bandwidth"] = args ? args.bandwidth : undefined; resourceInputs["candidateSubnets"] = args ? args.candidateSubnets : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["edgeAvailabilityDomain"] = args ? args.edgeAvailabilityDomain : undefined; resourceInputs["encryption"] = args ? args.encryption : undefined; resourceInputs["interconnect"] = args ? args.interconnect : undefined; resourceInputs["ipsecInternalAddresses"] = args ? args.ipsecInternalAddresses : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["mtu"] = args ? args.mtu : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["router"] = args ? args.router : undefined; resourceInputs["stackType"] = args ? args.stackType : undefined; resourceInputs["subnetLength"] = args ? args.subnetLength : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["vlanTag8021q"] = args ? args.vlanTag8021q : undefined; 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; /** @internal */ InterconnectAttachment.__pulumiType = 'gcp:compute/interconnectAttachment:InterconnectAttachment'; //# sourceMappingURL=interconnectAttachment.js.map