@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
111 lines • 5.11 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.RouterInterface = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a Cloud Router interface. For more information see
* [the official documentation](https://cloud.google.com/compute/docs/cloudrouter)
* and
* [API](https://cloud.google.com/compute/docs/reference/latest/routers).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const foobar = new gcp.compute.RouterInterface("foobar", {
* name: "interface-1",
* router: "router-1",
* region: "us-central1",
* ipRange: "169.254.1.1/30",
* vpnTunnel: "tunnel-1",
* });
* ```
*
* ## Import
*
* Router interfaces can be imported using the `project` (optional), `region`, `router`, and `name`, e.g.
*
* * `{{project_id}}/{{region}}/{{router}}/{{name}}`
*
* * `{{region}}/{{router}}/{{name}}`
*
* When using the `pulumi import` command, router interfaces can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/routerInterface:RouterInterface default {{project_id}}/{{region}}/{{router}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/routerInterface:RouterInterface default {{region}}/{{router}}/{{name}}
* ```
*/
class RouterInterface extends pulumi.CustomResource {
/**
* Get an existing RouterInterface 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 RouterInterface(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RouterInterface. 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'] === RouterInterface.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["interconnectAttachment"] = state ? state.interconnectAttachment : undefined;
resourceInputs["ipRange"] = state ? state.ipRange : undefined;
resourceInputs["ipVersion"] = state ? state.ipVersion : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["privateIpAddress"] = state ? state.privateIpAddress : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["redundantInterface"] = state ? state.redundantInterface : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["router"] = state ? state.router : undefined;
resourceInputs["subnetwork"] = state ? state.subnetwork : undefined;
resourceInputs["vpnTunnel"] = state ? state.vpnTunnel : undefined;
}
else {
const args = argsOrState;
if ((!args || args.router === undefined) && !opts.urn) {
throw new Error("Missing required property 'router'");
}
resourceInputs["interconnectAttachment"] = args ? args.interconnectAttachment : undefined;
resourceInputs["ipRange"] = args ? args.ipRange : undefined;
resourceInputs["ipVersion"] = args ? args.ipVersion : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["privateIpAddress"] = args ? args.privateIpAddress : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["redundantInterface"] = args ? args.redundantInterface : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["router"] = args ? args.router : undefined;
resourceInputs["subnetwork"] = args ? args.subnetwork : undefined;
resourceInputs["vpnTunnel"] = args ? args.vpnTunnel : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RouterInterface.__pulumiType, name, resourceInputs, opts);
}
}
exports.RouterInterface = RouterInterface;
/** @internal */
RouterInterface.__pulumiType = 'gcp:compute/routerInterface:RouterInterface';
//# sourceMappingURL=routerInterface.js.map