@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
113 lines • 5.04 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.RouterNatAddress = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A resource used to set the list of IP addresses to be used in a NAT service and manage the draining of destroyed IPs.
*
* > **Note:** This resource is to be used alongside a `gcp.compute.RouterNat` resource,
* the router nat resource must have no defined `natIps` or `drainNatIps` parameters,
* instead using the `initialNatIps` parameter to set at least one IP for the creation of the resource.
*
* To get more information about RouterNatAddress, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/routers)
* * How-to Guides
* * [Google Cloud Router](https://cloud.google.com/router/docs/)
*
* ## Example Usage
*
* ## Import
*
* RouterNatAddress can be imported using any of these accepted formats:
*
* * `projects/{{project}}/regions/{{region}}/routers/{{router}}/{{router_nat}}`
*
* * `{{project}}/{{region}}/{{router}}/{{router_nat}}`
*
* * `{{region}}/{{router}}/{{router_nat}}`
*
* * `{{router}}/{{router_nat}}`
*
* When using the `pulumi import` command, RouterNatAddress can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/routerNatAddress:RouterNatAddress default projects/{{project}}/regions/{{region}}/routers/{{router}}/{{router_nat}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/routerNatAddress:RouterNatAddress default {{project}}/{{region}}/{{router}}/{{router_nat}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/routerNatAddress:RouterNatAddress default {{region}}/{{router}}/{{router_nat}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/routerNatAddress:RouterNatAddress default {{router}}/{{router_nat}}
* ```
*/
class RouterNatAddress extends pulumi.CustomResource {
/**
* Get an existing RouterNatAddress 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 RouterNatAddress(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RouterNatAddress. 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'] === RouterNatAddress.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["drainNatIps"] = state ? state.drainNatIps : undefined;
resourceInputs["natIps"] = state ? state.natIps : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["router"] = state ? state.router : undefined;
resourceInputs["routerNat"] = state ? state.routerNat : undefined;
}
else {
const args = argsOrState;
if ((!args || args.natIps === undefined) && !opts.urn) {
throw new Error("Missing required property 'natIps'");
}
if ((!args || args.router === undefined) && !opts.urn) {
throw new Error("Missing required property 'router'");
}
if ((!args || args.routerNat === undefined) && !opts.urn) {
throw new Error("Missing required property 'routerNat'");
}
resourceInputs["drainNatIps"] = args ? args.drainNatIps : undefined;
resourceInputs["natIps"] = args ? args.natIps : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["router"] = args ? args.router : undefined;
resourceInputs["routerNat"] = args ? args.routerNat : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RouterNatAddress.__pulumiType, name, resourceInputs, opts);
}
}
exports.RouterNatAddress = RouterNatAddress;
/** @internal */
RouterNatAddress.__pulumiType = 'gcp:compute/routerNatAddress:RouterNatAddress';
//# sourceMappingURL=routerNatAddress.js.map