@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
171 lines • 9.23 kB
JavaScript
;
// *** 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.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/projects/${project.name}/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, Object.assign(Object.assign({}, 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["adminEnabled"] = state ? state.adminEnabled : undefined;
resourceInputs["availableFeatures"] = state ? state.availableFeatures : undefined;
resourceInputs["circuitInfos"] = state ? state.circuitInfos : undefined;
resourceInputs["creationTimestamp"] = state ? state.creationTimestamp : undefined;
resourceInputs["customerName"] = state ? state.customerName : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["expectedOutages"] = state ? state.expectedOutages : undefined;
resourceInputs["googleIpAddress"] = state ? state.googleIpAddress : undefined;
resourceInputs["googleReferenceId"] = state ? state.googleReferenceId : undefined;
resourceInputs["interconnectAttachments"] = state ? state.interconnectAttachments : undefined;
resourceInputs["interconnectType"] = state ? state.interconnectType : undefined;
resourceInputs["labelFingerprint"] = state ? state.labelFingerprint : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["linkType"] = state ? state.linkType : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["macsec"] = state ? state.macsec : undefined;
resourceInputs["macsecEnabled"] = state ? state.macsecEnabled : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["nocContactEmail"] = state ? state.nocContactEmail : undefined;
resourceInputs["operationalStatus"] = state ? state.operationalStatus : undefined;
resourceInputs["peerIpAddress"] = state ? state.peerIpAddress : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["provisionedLinkCount"] = state ? state.provisionedLinkCount : undefined;
resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined;
resourceInputs["remoteLocation"] = state ? state.remoteLocation : undefined;
resourceInputs["requestedFeatures"] = state ? state.requestedFeatures : undefined;
resourceInputs["requestedLinkCount"] = state ? state.requestedLinkCount : undefined;
resourceInputs["satisfiesPzs"] = state ? state.satisfiesPzs : undefined;
resourceInputs["state"] = state ? state.state : undefined;
}
else {
const args = argsOrState;
if ((!args || args.interconnectType === undefined) && !opts.urn) {
throw new Error("Missing required property 'interconnectType'");
}
if ((!args || args.linkType === undefined) && !opts.urn) {
throw new Error("Missing required property 'linkType'");
}
if ((!args || args.requestedLinkCount === undefined) && !opts.urn) {
throw new Error("Missing required property 'requestedLinkCount'");
}
resourceInputs["adminEnabled"] = args ? args.adminEnabled : undefined;
resourceInputs["customerName"] = args ? args.customerName : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["interconnectType"] = args ? args.interconnectType : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["linkType"] = args ? args.linkType : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["macsec"] = args ? args.macsec : undefined;
resourceInputs["macsecEnabled"] = args ? args.macsecEnabled : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["nocContactEmail"] = args ? args.nocContactEmail : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["remoteLocation"] = args ? args.remoteLocation : undefined;
resourceInputs["requestedFeatures"] = args ? args.requestedFeatures : undefined;
resourceInputs["requestedLinkCount"] = args ? args.requestedLinkCount : undefined;
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["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*/;
}
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