@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
113 lines • 4.46 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.Ip = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage nat ip
* ## 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 intranetNatGateway = new volcengine.nat.Gateway("intranetNatGateway", {
* vpcId: fooVpc.id,
* subnetId: fooSubnet.id,
* natGatewayName: "acc-test-intranet_ng",
* description: "acc-test",
* networkType: "intranet",
* billingType: "PostPaidByUsage",
* projectName: "default",
* tags: [{
* key: "k1",
* value: "v1",
* }],
* });
* const fooIp = new volcengine.nat.Ip("fooIp", {
* natGatewayId: intranetNatGateway.id,
* natIpName: "acc-test-nat-ip",
* natIpDescription: "acc-test",
* natIp: "172.16.0.3",
* });
* ```
*
* ## Import
*
* NatIp can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:nat/ip:Ip default resource_id
* ```
*/
class Ip extends pulumi.CustomResource {
/**
* Get an existing Ip 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 Ip(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Ip. 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'] === Ip.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["isDefault"] = state ? state.isDefault : undefined;
resourceInputs["natGatewayId"] = state ? state.natGatewayId : undefined;
resourceInputs["natIp"] = state ? state.natIp : undefined;
resourceInputs["natIpDescription"] = state ? state.natIpDescription : undefined;
resourceInputs["natIpName"] = state ? state.natIpName : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["usingStatus"] = state ? state.usingStatus : undefined;
}
else {
const args = argsOrState;
if ((!args || args.natGatewayId === undefined) && !opts.urn) {
throw new Error("Missing required property 'natGatewayId'");
}
resourceInputs["natGatewayId"] = args ? args.natGatewayId : undefined;
resourceInputs["natIp"] = args ? args.natIp : undefined;
resourceInputs["natIpDescription"] = args ? args.natIpDescription : undefined;
resourceInputs["natIpName"] = args ? args.natIpName : undefined;
resourceInputs["isDefault"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["usingStatus"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Ip.__pulumiType, name, resourceInputs, opts);
}
}
exports.Ip = Ip;
/** @internal */
Ip.__pulumiType = 'volcengine:nat/ip:Ip';
//# sourceMappingURL=ip.js.map