@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
98 lines • 5.21 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.DnatRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a DNAT rule resource of the **public** NAT within HuaweiCloud.
*
* ## Example Usage
*
* ## Import
*
* DNAT rules can be imported using their `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Nat/dnatRule:DnatRule test f4f783a7-b908-4215-b018-724960e5df4a
* ```
*/
class DnatRule extends pulumi.CustomResource {
/**
* Get an existing DnatRule 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 DnatRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of DnatRule. 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'] === DnatRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["externalServicePort"] = state ? state.externalServicePort : undefined;
resourceInputs["externalServicePortRange"] = state ? state.externalServicePortRange : undefined;
resourceInputs["floatingIpAddress"] = state ? state.floatingIpAddress : undefined;
resourceInputs["floatingIpId"] = state ? state.floatingIpId : undefined;
resourceInputs["globalEipAddress"] = state ? state.globalEipAddress : undefined;
resourceInputs["globalEipId"] = state ? state.globalEipId : undefined;
resourceInputs["internalServicePort"] = state ? state.internalServicePort : undefined;
resourceInputs["internalServicePortRange"] = state ? state.internalServicePortRange : undefined;
resourceInputs["natGatewayId"] = state ? state.natGatewayId : undefined;
resourceInputs["portId"] = state ? state.portId : undefined;
resourceInputs["privateIp"] = state ? state.privateIp : undefined;
resourceInputs["protocol"] = state ? state.protocol : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["status"] = state ? state.status : undefined;
}
else {
const args = argsOrState;
if ((!args || args.natGatewayId === undefined) && !opts.urn) {
throw new Error("Missing required property 'natGatewayId'");
}
if ((!args || args.protocol === undefined) && !opts.urn) {
throw new Error("Missing required property 'protocol'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["externalServicePort"] = args ? args.externalServicePort : undefined;
resourceInputs["externalServicePortRange"] = args ? args.externalServicePortRange : undefined;
resourceInputs["floatingIpId"] = args ? args.floatingIpId : undefined;
resourceInputs["globalEipId"] = args ? args.globalEipId : undefined;
resourceInputs["internalServicePort"] = args ? args.internalServicePort : undefined;
resourceInputs["internalServicePortRange"] = args ? args.internalServicePortRange : undefined;
resourceInputs["natGatewayId"] = args ? args.natGatewayId : undefined;
resourceInputs["portId"] = args ? args.portId : undefined;
resourceInputs["privateIp"] = args ? args.privateIp : undefined;
resourceInputs["protocol"] = args ? args.protocol : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["floatingIpAddress"] = undefined /*out*/;
resourceInputs["globalEipAddress"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DnatRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.DnatRule = DnatRule;
/** @internal */
DnatRule.__pulumiType = 'huaweicloud:Nat/dnatRule:DnatRule';
//# sourceMappingURL=dnatRule.js.map