"use strict";
// *** 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.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, { ...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?.drainNatIps;
            resourceInputs["natIps"] = state?.natIps;
            resourceInputs["project"] = state?.project;
            resourceInputs["region"] = state?.region;
            resourceInputs["router"] = state?.router;
            resourceInputs["routerNat"] = state?.routerNat;
        }
        else {
            const args = argsOrState;
            if (args?.natIps === undefined && !opts.urn) {
                throw new Error("Missing required property 'natIps'");
            }
            if (args?.router === undefined && !opts.urn) {
                throw new Error("Missing required property 'router'");
            }
            if (args?.routerNat === undefined && !opts.urn) {
                throw new Error("Missing required property 'routerNat'");
            }
            resourceInputs["drainNatIps"] = args?.drainNatIps;
            resourceInputs["natIps"] = args?.natIps;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["router"] = args?.router;
            resourceInputs["routerNat"] = args?.routerNat;
        }
        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