UNPKG

@pulumi/gcp

Version:

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

132 lines 5.27 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.PublicAdvertisedPrefix = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Represents a PublicAdvertisedPrefix for use with bring your own IP addresses (BYOIP). * * To get more information about PublicAdvertisedPrefix, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/publicAdvertisedPrefixes) * * How-to Guides * * [Using bring your own IP](https://cloud.google.com/vpc/docs/using-bring-your-own-ip) * * ## Example Usage * * ### Public Advertised Prefixes Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const prefixes = new gcp.compute.PublicAdvertisedPrefix("prefixes", { * name: "my-prefix", * description: "description", * dnsVerificationIp: "127.127.0.0", * ipCidrRange: "127.127.0.0/16", * }); * ``` * ### Public Advertised Prefixes Pdp Scope * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const prefixes = new gcp.compute.PublicAdvertisedPrefix("prefixes", { * name: "my-pap", * description: "description", * dnsVerificationIp: "127.127.0.0", * ipCidrRange: "127.127.0.0/16", * pdpScope: "REGIONAL", * }); * ``` * * ## Import * * PublicAdvertisedPrefix can be imported using any of these accepted formats: * * * `projects/{{project}}/global/publicAdvertisedPrefixes/{{name}}` * * * `{{project}}/{{name}}` * * * `{{name}}` * * When using the `pulumi import` command, PublicAdvertisedPrefix can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/publicAdvertisedPrefix:PublicAdvertisedPrefix default projects/{{project}}/global/publicAdvertisedPrefixes/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/publicAdvertisedPrefix:PublicAdvertisedPrefix default {{project}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/publicAdvertisedPrefix:PublicAdvertisedPrefix default {{name}} * ``` */ class PublicAdvertisedPrefix extends pulumi.CustomResource { /** * Get an existing PublicAdvertisedPrefix 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 PublicAdvertisedPrefix(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of PublicAdvertisedPrefix. 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'] === PublicAdvertisedPrefix.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state?.description; resourceInputs["dnsVerificationIp"] = state?.dnsVerificationIp; resourceInputs["ipCidrRange"] = state?.ipCidrRange; resourceInputs["name"] = state?.name; resourceInputs["pdpScope"] = state?.pdpScope; resourceInputs["project"] = state?.project; resourceInputs["selfLink"] = state?.selfLink; resourceInputs["sharedSecret"] = state?.sharedSecret; } else { const args = argsOrState; if (args?.dnsVerificationIp === undefined && !opts.urn) { throw new Error("Missing required property 'dnsVerificationIp'"); } if (args?.ipCidrRange === undefined && !opts.urn) { throw new Error("Missing required property 'ipCidrRange'"); } resourceInputs["description"] = args?.description; resourceInputs["dnsVerificationIp"] = args?.dnsVerificationIp; resourceInputs["ipCidrRange"] = args?.ipCidrRange; resourceInputs["name"] = args?.name; resourceInputs["pdpScope"] = args?.pdpScope; resourceInputs["project"] = args?.project; resourceInputs["selfLink"] = undefined /*out*/; resourceInputs["sharedSecret"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(PublicAdvertisedPrefix.__pulumiType, name, resourceInputs, opts); } } exports.PublicAdvertisedPrefix = PublicAdvertisedPrefix; /** @internal */ PublicAdvertisedPrefix.__pulumiType = 'gcp:compute/publicAdvertisedPrefix:PublicAdvertisedPrefix'; //# sourceMappingURL=publicAdvertisedPrefix.js.map