@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
104 lines • 4.74 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.AclRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* !> **WARNING:** It has been deprecated, use `huaweicloud.Vpc.NetworkAcl` instead.
*
* Manages a network ACL rule resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
*
* const rule1 = new huaweicloud.NetworkAcl.AclRule("rule_1", {
* action: "deny",
* destinationIpAddress: "4.3.2.0/24",
* destinationPort: "555",
* protocol: "udp",
* sourceIpAddress: "1.2.3.4",
* sourcePort: "444",
* });
* ```
*
* ## Import
*
* network ACL rules can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:NetworkAcl/aclRule:AclRule rule_1 89a84b28-4cc2-4859-9885-c67e802a46a3
* ```
*/
class AclRule extends pulumi.CustomResource {
/**
* Get an existing AclRule 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 AclRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AclRule. 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'] === AclRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["action"] = state ? state.action : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["destinationIpAddress"] = state ? state.destinationIpAddress : undefined;
resourceInputs["destinationPort"] = state ? state.destinationPort : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["ipVersion"] = state ? state.ipVersion : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["protocol"] = state ? state.protocol : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["sourceIpAddress"] = state ? state.sourceIpAddress : undefined;
resourceInputs["sourcePort"] = state ? state.sourcePort : undefined;
}
else {
const args = argsOrState;
if ((!args || args.action === undefined) && !opts.urn) {
throw new Error("Missing required property 'action'");
}
if ((!args || args.protocol === undefined) && !opts.urn) {
throw new Error("Missing required property 'protocol'");
}
resourceInputs["action"] = args ? args.action : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["destinationIpAddress"] = args ? args.destinationIpAddress : undefined;
resourceInputs["destinationPort"] = args ? args.destinationPort : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["ipVersion"] = args ? args.ipVersion : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["protocol"] = args ? args.protocol : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["sourceIpAddress"] = args ? args.sourceIpAddress : undefined;
resourceInputs["sourcePort"] = args ? args.sourcePort : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AclRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.AclRule = AclRule;
/** @internal */
AclRule.__pulumiType = 'huaweicloud:NetworkAcl/aclRule:AclRule';
//# sourceMappingURL=aclRule.js.map