"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.PublicDelegatedPrefix = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a PublicDelegatedPrefix for use with bring your own IP addresses (BYOIP).
 *
 * To get more information about PublicDelegatedPrefix, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/publicDelegatedPrefixes)
 * * How-to Guides
 *     * [Using bring your own IP](https://cloud.google.com/vpc/docs/using-bring-your-own-ip)
 *
 * ## Example Usage
 *
 * ### Public Delegated Prefixes Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const advertised = new gcp.compute.PublicAdvertisedPrefix("advertised", {
 *     name: "my-prefix",
 *     description: "description",
 *     dnsVerificationIp: "127.127.0.0",
 *     ipCidrRange: "127.127.0.0/16",
 * });
 * const prefixes = new gcp.compute.PublicDelegatedPrefix("prefixes", {
 *     name: "my-prefix",
 *     region: "us-central1",
 *     description: "my description",
 *     ipCidrRange: "127.127.0.0/24",
 *     parentPrefix: advertised.id,
 * });
 * ```
 * ### Public Delegated Prefixes Ipv6
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const advertised = new gcp.compute.PublicAdvertisedPrefix("advertised", {
 *     name: "ipv6-pap",
 *     description: "description",
 *     dnsVerificationIp: "2001:db8::",
 *     ipCidrRange: "2001:db8::/32",
 *     pdpScope: "REGIONAL",
 * });
 * const prefix = new gcp.compute.PublicDelegatedPrefix("prefix", {
 *     name: "ipv6-root-pdp",
 *     description: "test-delegation-mode-pdp",
 *     region: "us-west1",
 *     ipCidrRange: "2001:db8::/40",
 *     parentPrefix: advertised.id,
 *     mode: "DELEGATION",
 * });
 * const subprefix = new gcp.compute.PublicDelegatedPrefix("subprefix", {
 *     name: "ipv6-sub-pdp",
 *     description: "test-forwarding-rule-mode-pdp",
 *     region: "us-west1",
 *     ipCidrRange: "2001:db8::/48",
 *     parentPrefix: prefix.id,
 *     allocatablePrefixLength: 64,
 *     mode: "EXTERNAL_IPV6_FORWARDING_RULE_CREATION",
 * });
 * ```
 * ### Public Delegated Prefix Ipv6 Subnet Mode
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const advertised = new gcp.compute.PublicAdvertisedPrefix("advertised", {
 *     name: "ipv6-pap",
 *     description: "description",
 *     dnsVerificationIp: "2001:db8::",
 *     ipCidrRange: "2001:db8::/32",
 *     pdpScope: "REGIONAL",
 * });
 * const prefix = new gcp.compute.PublicDelegatedPrefix("prefix", {
 *     name: "ipv6-root-pdp",
 *     description: "test-delegation-mode-pdp",
 *     region: "us-east1",
 *     ipCidrRange: "2001:db8::/40",
 *     parentPrefix: advertised.id,
 *     mode: "DELEGATION",
 * });
 * const subprefix = new gcp.compute.PublicDelegatedPrefix("subprefix", {
 *     name: "ipv6-sub-pdp",
 *     description: "test-subnet-mode-pdp",
 *     region: "us-east1",
 *     ipCidrRange: "2001:db8::/48",
 *     parentPrefix: prefix.id,
 *     mode: "EXTERNAL_IPV6_SUBNETWORK_CREATION",
 * });
 * ```
 *
 * ## Import
 *
 * PublicDelegatedPrefix can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/regions/{{region}}/publicDelegatedPrefixes/{{name}}`
 *
 * * `{{project}}/{{region}}/{{name}}`
 *
 * * `{{region}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, PublicDelegatedPrefix can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default projects/{{project}}/regions/{{region}}/publicDelegatedPrefixes/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default {{project}}/{{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default {{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default {{name}}
 * ```
 */
class PublicDelegatedPrefix extends pulumi.CustomResource {
    /**
     * Get an existing PublicDelegatedPrefix 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 PublicDelegatedPrefix(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of PublicDelegatedPrefix.  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'] === PublicDelegatedPrefix.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["allocatablePrefixLength"] = state?.allocatablePrefixLength;
            resourceInputs["description"] = state?.description;
            resourceInputs["ipCidrRange"] = state?.ipCidrRange;
            resourceInputs["isLiveMigration"] = state?.isLiveMigration;
            resourceInputs["mode"] = state?.mode;
            resourceInputs["name"] = state?.name;
            resourceInputs["parentPrefix"] = state?.parentPrefix;
            resourceInputs["project"] = state?.project;
            resourceInputs["publicDelegatedSubPrefixs"] = state?.publicDelegatedSubPrefixs;
            resourceInputs["region"] = state?.region;
            resourceInputs["selfLink"] = state?.selfLink;
        }
        else {
            const args = argsOrState;
            if (args?.ipCidrRange === undefined && !opts.urn) {
                throw new Error("Missing required property 'ipCidrRange'");
            }
            if (args?.parentPrefix === undefined && !opts.urn) {
                throw new Error("Missing required property 'parentPrefix'");
            }
            if (args?.region === undefined && !opts.urn) {
                throw new Error("Missing required property 'region'");
            }
            resourceInputs["allocatablePrefixLength"] = args?.allocatablePrefixLength;
            resourceInputs["description"] = args?.description;
            resourceInputs["ipCidrRange"] = args?.ipCidrRange;
            resourceInputs["isLiveMigration"] = args?.isLiveMigration;
            resourceInputs["mode"] = args?.mode;
            resourceInputs["name"] = args?.name;
            resourceInputs["parentPrefix"] = args?.parentPrefix;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["publicDelegatedSubPrefixs"] = undefined /*out*/;
            resourceInputs["selfLink"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(PublicDelegatedPrefix.__pulumiType, name, resourceInputs, opts);
    }
}
exports.PublicDelegatedPrefix = PublicDelegatedPrefix;
/** @internal */
PublicDelegatedPrefix.__pulumiType = 'gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix';
//# sourceMappingURL=publicDelegatedPrefix.js.map