@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
137 lines • 5.94 kB
JavaScript
;
// *** 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.Subnet = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = 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, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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 ? state.createTime : undefined;
resourceInputs["dhcpAddressRanges"] = state ? state.dhcpAddressRanges : undefined;
resourceInputs["gatewayId"] = state ? state.gatewayId : undefined;
resourceInputs["gatewayIp"] = state ? state.gatewayIp : undefined;
resourceInputs["ipCidrRange"] = state ? state.ipCidrRange : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["parent"] = state ? state.parent : undefined;
resourceInputs["standardConfig"] = state ? state.standardConfig : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["uid"] = state ? state.uid : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
resourceInputs["vlanId"] = state ? state.vlanId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.ipCidrRange === undefined) && !opts.urn) {
throw new Error("Missing required property 'ipCidrRange'");
}
if ((!args || args.parent === undefined) && !opts.urn) {
throw new Error("Missing required property 'parent'");
}
resourceInputs["ipCidrRange"] = args ? args.ipCidrRange : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["parent"] = args ? args.parent : undefined;
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;
/** @internal */
Subnet.__pulumiType = 'gcp:vmwareengine/subnet:Subnet';
//# sourceMappingURL=subnet.js.map