UNPKG

@pulumi/gcp

Version:

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

149 lines 5.59 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.Network = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides connectivity for VMware Engine private clouds. * * To get more information about Network, see: * * * [API documentation](https://cloud.google.com/vmware-engine/docs/reference/rest/v1/projects.locations.vmwareEngineNetworks) * * ## Example Usage * * ### Vmware Engine Network Standard * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const vmw_engine_network = new gcp.vmwareengine.Network("vmw-engine-network", { * name: "standard-nw", * location: "global", * type: "STANDARD", * description: "VMwareEngine standard network sample", * }); * ``` * ### Vmware Engine Network Legacy * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as time from "@pulumiverse/time"; * * // there can be only 1 Legacy network per region for a given project, * // so creating new project for isolation in CI. * const acceptanceProject = new gcp.organizations.Project("acceptance", { * name: "vmw-proj", * projectId: "vmw-proj", * orgId: "123456789", * billingAccount: "000000-0000000-0000000-000000", * deletionPolicy: "DELETE", * }); * const wait60Seconds = new time.index.Sleep("wait_60_seconds", {createDuration: "60s"}, { * dependsOn: [acceptanceProject], * }); * const acceptance = new gcp.projects.Service("acceptance", { * project: acceptanceProject.projectId, * service: "vmwareengine.googleapis.com", * }, { * dependsOn: [wait60Seconds], * }); * const vmw_engine_network = new gcp.vmwareengine.Network("vmw-engine-network", { * project: acceptance.project, * name: "us-west1-default", * location: "us-west1", * type: "LEGACY", * description: "VMwareEngine legacy network sample", * }); * ``` * * ## Import * * Network can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/vmwareEngineNetworks/{{name}}` * * * `{{project}}/{{location}}/{{name}}` * * * `{{location}}/{{name}}` * * When using the `pulumi import` command, Network can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:vmwareengine/network:Network default projects/{{project}}/locations/{{location}}/vmwareEngineNetworks/{{name}} * ``` * * ```sh * $ pulumi import gcp:vmwareengine/network:Network default {{project}}/{{location}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:vmwareengine/network:Network default {{location}}/{{name}} * ``` */ class Network extends pulumi.CustomResource { /** * Get an existing Network 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 Network(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Network. 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'] === Network.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state?.description; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["state"] = state?.state; resourceInputs["type"] = state?.type; resourceInputs["uid"] = state?.uid; resourceInputs["vpcNetworks"] = state?.vpcNetworks; } else { const args = argsOrState; if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["description"] = args?.description; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; resourceInputs["type"] = args?.type; resourceInputs["state"] = undefined /*out*/; resourceInputs["uid"] = undefined /*out*/; resourceInputs["vpcNetworks"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Network.__pulumiType, name, resourceInputs, opts); } } exports.Network = Network; /** @internal */ Network.__pulumiType = 'gcp:vmwareengine/network:Network'; //# sourceMappingURL=network.js.map