@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
127 lines • 4.97 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.SnatEntry = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage snat entry
* ## 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",
* }],
* });
* const fooAddress = new volcengine.eip.Address("fooAddress", {
* description: "acc-test",
* bandwidth: 1,
* billingType: "PostPaidByBandwidth",
* isp: "BGP",
* });
* const fooAssociate = new volcengine.eip.Associate("fooAssociate", {
* allocationId: fooAddress.id,
* instanceId: fooGateway.id,
* instanceType: "Nat",
* });
* const fooSnatEntry = new volcengine.nat.SnatEntry("fooSnatEntry", {
* snatEntryName: "acc-test-snat-entry",
* natGatewayId: fooGateway.id,
* eipId: fooAddress.id,
* sourceCidr: "172.16.0.0/24",
* }, {
* dependsOn: [fooAssociate],
* });
* ```
*
* ## Import
*
* Snat entry can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:nat/snatEntry:SnatEntry default snat-3fvhk47kf56****
* ```
*/
class SnatEntry extends pulumi.CustomResource {
/**
* Get an existing SnatEntry 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 SnatEntry(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SnatEntry. 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'] === SnatEntry.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["eipId"] = state ? state.eipId : undefined;
resourceInputs["natGatewayId"] = state ? state.natGatewayId : undefined;
resourceInputs["snatEntryName"] = state ? state.snatEntryName : undefined;
resourceInputs["sourceCidr"] = state ? state.sourceCidr : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["subnetId"] = state ? state.subnetId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.eipId === undefined) && !opts.urn) {
throw new Error("Missing required property 'eipId'");
}
if ((!args || args.natGatewayId === undefined) && !opts.urn) {
throw new Error("Missing required property 'natGatewayId'");
}
resourceInputs["eipId"] = args ? args.eipId : undefined;
resourceInputs["natGatewayId"] = args ? args.natGatewayId : undefined;
resourceInputs["snatEntryName"] = args ? args.snatEntryName : undefined;
resourceInputs["sourceCidr"] = args ? args.sourceCidr : undefined;
resourceInputs["subnetId"] = args ? args.subnetId : undefined;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SnatEntry.__pulumiType, name, resourceInputs, opts);
}
}
exports.SnatEntry = SnatEntry;
/** @internal */
SnatEntry.__pulumiType = 'volcengine:nat/snatEntry:SnatEntry';
//# sourceMappingURL=snatEntry.js.map