UNPKG

@pulumi/gcp

Version:

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

160 lines 6.63 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.Subnet = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Subnet in a private cloud. A Private Cloud contains two types of subnets: `management` subnets (such as vMotion) that * are read-only,and `userDefined`, which can also be updated. This resource should be used to read and update `userDefined` * subnets. To read `management` subnets, please utilize the subnet data source. * * To get more information about Subnet, see: * * * [API documentation](https://cloud.google.com/vmware-engine/docs/reference/rest/v1/projects.locations.privateClouds.subnets) * * ## Example Usage * * ### Vmware Engine Subnet User Defined * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const subnet_nw = new gcp.vmwareengine.Network("subnet-nw", { * name: "pc-nw", * location: "global", * type: "STANDARD", * description: "PC network description.", * }); * const subnet_pc = new gcp.vmwareengine.PrivateCloud("subnet-pc", { * location: "us-west1-a", * name: "sample-pc", * description: "Sample test PC.", * networkConfig: { * managementCidr: "192.168.50.0/24", * vmwareEngineNetwork: subnet_nw.id, * }, * managementCluster: { * clusterId: "sample-mgmt-cluster", * nodeTypeConfigs: [{ * nodeTypeId: "standard-72", * nodeCount: 3, * }], * }, * }); * const vmw_engine_subnet = new gcp.vmwareengine.Subnet("vmw-engine-subnet", { * name: "service-1", * parent: subnet_pc.id, * ipCidrRange: "192.168.100.0/26", * }); * ``` * * ## Import * * Subnet can be imported using any of these accepted formats: * * * `{{parent}}/subnets/{{name}}` * * When using the `pulumi import` command, Subnet can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:vmwareengine/subnet:Subnet default {{parent}}/subnets/{{name}} * ``` */ class Subnet extends pulumi.CustomResource { /** * Get an existing Subnet 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 Subnet(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:vmwareengine/subnet:Subnet'; /** * Returns true if the given object is an instance of Subnet. 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'] === Subnet.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createTime"] = state?.createTime; resourceInputs["dhcpAddressRanges"] = state?.dhcpAddressRanges; resourceInputs["gatewayId"] = state?.gatewayId; resourceInputs["gatewayIp"] = state?.gatewayIp; resourceInputs["ipCidrRange"] = state?.ipCidrRange; resourceInputs["name"] = state?.name; resourceInputs["parent"] = state?.parent; resourceInputs["standardConfig"] = state?.standardConfig; resourceInputs["state"] = state?.state; resourceInputs["type"] = state?.type; resourceInputs["uid"] = state?.uid; resourceInputs["updateTime"] = state?.updateTime; resourceInputs["vlanId"] = state?.vlanId; } else { const args = argsOrState; if (args?.ipCidrRange === undefined && !opts.urn) { throw new Error("Missing required property 'ipCidrRange'"); } if (args?.parent === undefined && !opts.urn) { throw new Error("Missing required property 'parent'"); } resourceInputs["ipCidrRange"] = args?.ipCidrRange; resourceInputs["name"] = args?.name; resourceInputs["parent"] = args?.parent; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["dhcpAddressRanges"] = undefined /*out*/; resourceInputs["gatewayId"] = undefined /*out*/; resourceInputs["gatewayIp"] = undefined /*out*/; resourceInputs["standardConfig"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["type"] = undefined /*out*/; resourceInputs["uid"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; resourceInputs["vlanId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Subnet.__pulumiType, name, resourceInputs, opts); } } exports.Subnet = Subnet; //# sourceMappingURL=subnet.js.map