@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
143 lines • 5.8 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.NetworkAcl = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a VPC network ACL resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const name = config.requireObject("name");
* const subnetId1 = config.requireObject("subnetId1");
* const subnetId2 = config.requireObject("subnetId2");
* const test = new huaweicloud.vpc.NetworkAcl("test", {
* description: "created by terraform",
* enterpriseProjectId: "0",
* enabled: true,
* ingressRules: [
* {
* action: "allow",
* ipVersion: 4,
* protocol: "tcp",
* sourceIpAddress: "192.168.0.0/24",
* sourcePort: "22-30,33",
* destinationIpAddress: "0.0.0.0/0",
* destinationPort: "8001-8010",
* },
* {
* action: "deny",
* ipVersion: 4,
* protocol: "icmp",
* sourceIpAddress: "192.168.0.0/24",
* destinationIpAddress: "0.0.0.0/0",
* },
* ],
* egressRules: [
* {
* action: "allow",
* ipVersion: 4,
* protocol: "tcp",
* sourceIpAddress: "172.16.0.0/24",
* sourcePort: "22-30,33",
* destinationIpAddress: "0.0.0.0/0",
* destinationPort: "8001-8010",
* },
* {
* action: "deny",
* ipVersion: 4,
* protocol: "icmp",
* sourceIpAddress: "172.16.0.0/24",
* destinationIpAddress: "0.0.0.0/0",
* },
* ],
* associatedSubnets: [
* {
* subnetId: subnetId1,
* },
* {
* subnetId: subnetId2,
* },
* ],
* });
* ```
*
* ## Import
*
* The network ACL can be imported using `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Vpc/networkAcl:NetworkAcl test <id>
* ```
*/
class NetworkAcl extends pulumi.CustomResource {
/**
* Get an existing NetworkAcl 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 NetworkAcl(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of NetworkAcl. 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'] === NetworkAcl.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["associatedSubnets"] = state ? state.associatedSubnets : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["egressRules"] = state ? state.egressRules : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined;
resourceInputs["ingressRules"] = state ? state.ingressRules : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
resourceInputs["associatedSubnets"] = args ? args.associatedSubnets : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["egressRules"] = args ? args.egressRules : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined;
resourceInputs["ingressRules"] = args ? args.ingressRules : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkAcl.__pulumiType, name, resourceInputs, opts);
}
}
exports.NetworkAcl = NetworkAcl;
/** @internal */
NetworkAcl.__pulumiType = 'huaweicloud:Vpc/networkAcl:NetworkAcl';
//# sourceMappingURL=networkAcl.js.map