@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
91 lines • 4.5 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.SnatRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an SNAT rule resource of the **public** NAT within HuaweiCloud.
*
* ## Example Usage
*
* ## Import
*
* The SNAT rule can be imported using `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Nat/snatRule:SnatRule test <id>
* ```
*/
class SnatRule extends pulumi.CustomResource {
/**
* Get an existing SnatRule 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 SnatRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SnatRule. 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'] === SnatRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cidr"] = state ? state.cidr : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["floatingIpAddress"] = state ? state.floatingIpAddress : undefined;
resourceInputs["floatingIpId"] = state ? state.floatingIpId : undefined;
resourceInputs["freezedIpAddress"] = state ? state.freezedIpAddress : undefined;
resourceInputs["globalEipAddress"] = state ? state.globalEipAddress : undefined;
resourceInputs["globalEipId"] = state ? state.globalEipId : undefined;
resourceInputs["natGatewayId"] = state ? state.natGatewayId : undefined;
resourceInputs["networkId"] = state ? state.networkId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["sourceType"] = state ? state.sourceType : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["subnetId"] = state ? state.subnetId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.natGatewayId === undefined) && !opts.urn) {
throw new Error("Missing required property 'natGatewayId'");
}
resourceInputs["cidr"] = args ? args.cidr : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["floatingIpId"] = args ? args.floatingIpId : undefined;
resourceInputs["globalEipId"] = args ? args.globalEipId : undefined;
resourceInputs["natGatewayId"] = args ? args.natGatewayId : undefined;
resourceInputs["networkId"] = args ? args.networkId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["sourceType"] = args ? args.sourceType : undefined;
resourceInputs["subnetId"] = args ? args.subnetId : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["floatingIpAddress"] = undefined /*out*/;
resourceInputs["freezedIpAddress"] = undefined /*out*/;
resourceInputs["globalEipAddress"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SnatRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.SnatRule = SnatRule;
/** @internal */
SnatRule.__pulumiType = 'huaweicloud:Nat/snatRule:SnatRule';
//# sourceMappingURL=snatRule.js.map