@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
182 lines • 9.04 kB
JavaScript
// *** 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.Interconnect = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Represents an Interconnect resource. The Interconnect resource is a dedicated connection between
* Google's network and your on-premises network.
*
* To get more information about Interconnect, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/interconnects)
* * How-to Guides
* * [Create a Dedicated Interconnect](https://cloud.google.com/network-connectivity/docs/interconnect/concepts/dedicated-overview)
*
* ## Example Usage
*
* ### Compute Interconnect Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const example_interconnect = new gcp.compute.Interconnect("example-interconnect", {
* name: "example-interconnect",
* customerName: "example_customer",
* interconnectType: "DEDICATED",
* linkType: "LINK_TYPE_ETHERNET_10G_LR",
* location: project.then(project => `https://www.googleapis.com/compute/v1/${project.id}/global/interconnectLocations/iad-zone1-1`),
* requestedLinkCount: 1,
* });
* ```
*
* ## Import
*
* Interconnect can be imported using any of these accepted formats:
*
* * `projects/{{project}}/global/interconnects/{{name}}`
*
* * `{{project}}/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, Interconnect can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/interconnect:Interconnect default projects/{{project}}/global/interconnects/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/interconnect:Interconnect default {{project}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/interconnect:Interconnect default {{name}}
* ```
*/
class Interconnect extends pulumi.CustomResource {
/**
* Get an existing Interconnect 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 Interconnect(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Interconnect. 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'] === Interconnect.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["aaiEnabled"] = state?.aaiEnabled;
resourceInputs["adminEnabled"] = state?.adminEnabled;
resourceInputs["applicationAwareInterconnect"] = state?.applicationAwareInterconnect;
resourceInputs["availableFeatures"] = state?.availableFeatures;
resourceInputs["circuitInfos"] = state?.circuitInfos;
resourceInputs["creationTimestamp"] = state?.creationTimestamp;
resourceInputs["customerName"] = state?.customerName;
resourceInputs["description"] = state?.description;
resourceInputs["effectiveLabels"] = state?.effectiveLabels;
resourceInputs["expectedOutages"] = state?.expectedOutages;
resourceInputs["googleIpAddress"] = state?.googleIpAddress;
resourceInputs["googleReferenceId"] = state?.googleReferenceId;
resourceInputs["interconnectAttachments"] = state?.interconnectAttachments;
resourceInputs["interconnectGroups"] = state?.interconnectGroups;
resourceInputs["interconnectType"] = state?.interconnectType;
resourceInputs["labelFingerprint"] = state?.labelFingerprint;
resourceInputs["labels"] = state?.labels;
resourceInputs["linkType"] = state?.linkType;
resourceInputs["location"] = state?.location;
resourceInputs["macsec"] = state?.macsec;
resourceInputs["macsecEnabled"] = state?.macsecEnabled;
resourceInputs["name"] = state?.name;
resourceInputs["nocContactEmail"] = state?.nocContactEmail;
resourceInputs["operationalStatus"] = state?.operationalStatus;
resourceInputs["peerIpAddress"] = state?.peerIpAddress;
resourceInputs["project"] = state?.project;
resourceInputs["provisionedLinkCount"] = state?.provisionedLinkCount;
resourceInputs["pulumiLabels"] = state?.pulumiLabels;
resourceInputs["remoteLocation"] = state?.remoteLocation;
resourceInputs["requestedFeatures"] = state?.requestedFeatures;
resourceInputs["requestedLinkCount"] = state?.requestedLinkCount;
resourceInputs["satisfiesPzs"] = state?.satisfiesPzs;
resourceInputs["state"] = state?.state;
resourceInputs["wireGroups"] = state?.wireGroups;
}
else {
const args = argsOrState;
if (args?.interconnectType === undefined && !opts.urn) {
throw new Error("Missing required property 'interconnectType'");
}
if (args?.linkType === undefined && !opts.urn) {
throw new Error("Missing required property 'linkType'");
}
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if (args?.requestedLinkCount === undefined && !opts.urn) {
throw new Error("Missing required property 'requestedLinkCount'");
}
resourceInputs["aaiEnabled"] = args?.aaiEnabled;
resourceInputs["adminEnabled"] = args?.adminEnabled;
resourceInputs["applicationAwareInterconnect"] = args?.applicationAwareInterconnect;
resourceInputs["customerName"] = args?.customerName;
resourceInputs["description"] = args?.description;
resourceInputs["interconnectType"] = args?.interconnectType;
resourceInputs["labels"] = args?.labels;
resourceInputs["linkType"] = args?.linkType;
resourceInputs["location"] = args?.location;
resourceInputs["macsec"] = args?.macsec;
resourceInputs["macsecEnabled"] = args?.macsecEnabled;
resourceInputs["name"] = args?.name;
resourceInputs["nocContactEmail"] = args?.nocContactEmail;
resourceInputs["project"] = args?.project;
resourceInputs["remoteLocation"] = args?.remoteLocation;
resourceInputs["requestedFeatures"] = args?.requestedFeatures;
resourceInputs["requestedLinkCount"] = args?.requestedLinkCount;
resourceInputs["availableFeatures"] = undefined /*out*/;
resourceInputs["circuitInfos"] = undefined /*out*/;
resourceInputs["creationTimestamp"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["expectedOutages"] = undefined /*out*/;
resourceInputs["googleIpAddress"] = undefined /*out*/;
resourceInputs["googleReferenceId"] = undefined /*out*/;
resourceInputs["interconnectAttachments"] = undefined /*out*/;
resourceInputs["interconnectGroups"] = undefined /*out*/;
resourceInputs["labelFingerprint"] = undefined /*out*/;
resourceInputs["operationalStatus"] = undefined /*out*/;
resourceInputs["peerIpAddress"] = undefined /*out*/;
resourceInputs["provisionedLinkCount"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["satisfiesPzs"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["wireGroups"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Interconnect.__pulumiType, name, resourceInputs, opts);
}
}
exports.Interconnect = Interconnect;
/** @internal */
Interconnect.__pulumiType = 'gcp:compute/interconnect:Interconnect';
//# sourceMappingURL=interconnect.js.map
;