UNPKG

@pulumi/gcp

Version:

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

180 lines • 8.07 kB
"use strict"; // *** 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.RegionalEndpoint = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Regional Private Service Connect (PSC) endpoint resource. * * To get more information about RegionalEndpoint, see: * * * [API documentation](https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.regionalEndpoints) * * How-to Guides * * [Access regional Google APIs through endpoints](https://cloud.google.com/vpc/docs/access-regional-google-apis-endpoints) * * ## Example Usage * * ### Network Connectivity Regional Endpoint Regional Access * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const myNetwork = new gcp.compute.Network("my_network", { * name: "my-network", * autoCreateSubnetworks: false, * }); * const mySubnetwork = new gcp.compute.Subnetwork("my_subnetwork", { * name: "my-subnetwork", * ipCidrRange: "192.168.0.0/24", * region: "us-central1", * network: myNetwork.id, * }); * const _default = new gcp.networkconnectivity.RegionalEndpoint("default", { * name: "my-rep", * location: "us-central1", * targetGoogleApi: "storage.us-central1.p.rep.googleapis.com", * accessType: "REGIONAL", * address: "192.168.0.5", * network: myNetwork.id, * subnetwork: mySubnetwork.id, * description: "My RegionalEndpoint targeting Google API storage.us-central1.p.rep.googleapis.com", * labels: { * env: "default", * }, * }); * ``` * ### Network Connectivity Regional Endpoint Global Access * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const myNetwork = new gcp.compute.Network("my_network", { * name: "my-network", * autoCreateSubnetworks: false, * }); * const mySubnetwork = new gcp.compute.Subnetwork("my_subnetwork", { * name: "my-subnetwork", * ipCidrRange: "192.168.0.0/24", * region: "us-central1", * network: myNetwork.id, * }); * const _default = new gcp.networkconnectivity.RegionalEndpoint("default", { * name: "my-rep", * location: "us-central1", * targetGoogleApi: "storage.us-central1.p.rep.googleapis.com", * accessType: "GLOBAL", * address: "192.168.0.4", * network: myNetwork.id, * subnetwork: mySubnetwork.id, * }); * ``` * * ## Import * * RegionalEndpoint can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/regionalEndpoints/{{name}}` * * * `{{project}}/{{location}}/{{name}}` * * * `{{location}}/{{name}}` * * When using the `pulumi import` command, RegionalEndpoint can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:networkconnectivity/regionalEndpoint:RegionalEndpoint default projects/{{project}}/locations/{{location}}/regionalEndpoints/{{name}} * ``` * * ```sh * $ pulumi import gcp:networkconnectivity/regionalEndpoint:RegionalEndpoint default {{project}}/{{location}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:networkconnectivity/regionalEndpoint:RegionalEndpoint default {{location}}/{{name}} * ``` */ class RegionalEndpoint extends pulumi.CustomResource { /** * Get an existing RegionalEndpoint 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 RegionalEndpoint(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RegionalEndpoint. 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'] === RegionalEndpoint.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessType"] = state ? state.accessType : undefined; resourceInputs["address"] = state ? state.address : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["network"] = state ? state.network : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["pscForwardingRule"] = state ? state.pscForwardingRule : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["subnetwork"] = state ? state.subnetwork : undefined; resourceInputs["targetGoogleApi"] = state ? state.targetGoogleApi : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; } else { const args = argsOrState; if ((!args || args.accessType === undefined) && !opts.urn) { throw new Error("Missing required property 'accessType'"); } if ((!args || args.location === undefined) && !opts.urn) { throw new Error("Missing required property 'location'"); } if ((!args || args.targetGoogleApi === undefined) && !opts.urn) { throw new Error("Missing required property 'targetGoogleApi'"); } resourceInputs["accessType"] = args ? args.accessType : undefined; resourceInputs["address"] = args ? args.address : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["network"] = args ? args.network : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["subnetwork"] = args ? args.subnetwork : undefined; resourceInputs["targetGoogleApi"] = args ? args.targetGoogleApi : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["pscForwardingRule"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(RegionalEndpoint.__pulumiType, name, resourceInputs, opts); } } exports.RegionalEndpoint = RegionalEndpoint; /** @internal */ RegionalEndpoint.__pulumiType = 'gcp:networkconnectivity/regionalEndpoint:RegionalEndpoint'; //# sourceMappingURL=regionalEndpoint.js.map