UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

248 lines • 10.3 kB
"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! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PublicDelegatedPrefix = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(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", * }); * ``` * ### Public Delegated Prefix Internal 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", * ipCidrRange: "2001:db8::/32", * pdpScope: "REGIONAL", * ipv6AccessType: "INTERNAL", * }); * 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: "INTERNAL_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}} * $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default {{project}}/{{region}}/{{name}} * $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default {{region}}/{{name}} * $ 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 }); } /** @internal */ static __pulumiType = 'gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix'; /** * 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["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["enableEnhancedIpv4Allocation"] = state?.enableEnhancedIpv4Allocation; resourceInputs["ipCidrRange"] = state?.ipCidrRange; resourceInputs["ipv6AccessType"] = state?.ipv6AccessType; 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["deletionPolicy"] = args?.deletionPolicy; 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["enableEnhancedIpv4Allocation"] = undefined /*out*/; resourceInputs["ipv6AccessType"] = undefined /*out*/; resourceInputs["publicDelegatedSubPrefixs"] = undefined /*out*/; resourceInputs["selfLink"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(PublicDelegatedPrefix.__pulumiType, name, resourceInputs, opts); } } exports.PublicDelegatedPrefix = PublicDelegatedPrefix; //# sourceMappingURL=publicDelegatedPrefix.js.map