UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

113 lines 4.72 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.Gateway = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@pulumi/volcengine"; * import * as volcengine from "@volcengine/pulumi"; * * const fooZones = volcengine.ecs.getZones({}); * const fooVpc = new volcengine.vpc.Vpc("fooVpc", { * vpcName: "acc-test-vpc", * cidrBlock: "172.16.0.0/16", * }); * const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", { * subnetName: "acc-test-subnet", * cidrBlock: "172.16.0.0/24", * zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * vpcId: fooVpc.id, * }); * const fooGateway = new volcengine.nat.Gateway("fooGateway", { * vpcId: fooVpc.id, * subnetId: fooSubnet.id, * spec: "Small", * natGatewayName: "acc-test-ng", * description: "acc-test", * billingType: "PostPaid", * projectName: "default", * tags: [{ * key: "k1", * value: "v1", * }], * }); * ``` * * ## Import * * NatGateway can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:nat/gateway:Gateway default ngw-vv3t043k05sm**** * ``` */ class Gateway extends pulumi.CustomResource { /** * Get an existing Gateway 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 Gateway(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Gateway. 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'] === Gateway.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["billingType"] = state ? state.billingType : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["natGatewayName"] = state ? state.natGatewayName : undefined; resourceInputs["period"] = state ? state.period : undefined; resourceInputs["projectName"] = state ? state.projectName : undefined; resourceInputs["spec"] = state ? state.spec : undefined; resourceInputs["subnetId"] = state ? state.subnetId : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["vpcId"] = state ? state.vpcId : undefined; } else { const args = argsOrState; if ((!args || args.subnetId === undefined) && !opts.urn) { throw new Error("Missing required property 'subnetId'"); } if ((!args || args.vpcId === undefined) && !opts.urn) { throw new Error("Missing required property 'vpcId'"); } resourceInputs["billingType"] = args ? args.billingType : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["natGatewayName"] = args ? args.natGatewayName : undefined; resourceInputs["period"] = args ? args.period : undefined; resourceInputs["projectName"] = args ? args.projectName : undefined; resourceInputs["spec"] = args ? args.spec : undefined; resourceInputs["subnetId"] = args ? args.subnetId : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["vpcId"] = args ? args.vpcId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Gateway.__pulumiType, name, resourceInputs, opts); } } exports.Gateway = Gateway; /** @internal */ Gateway.__pulumiType = 'volcengine:nat/gateway:Gateway'; //# sourceMappingURL=gateway.js.map