UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

99 lines 4.87 kB
"use strict"; // *** 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.NetworkAclRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a network ACL rule resource within HuaweiCloud IEC. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const aclTest = new huaweicloud.iec.NetworkAcl("aclTest", {}); * const ruleTest = new huaweicloud.iec.NetworkAclRule("ruleTest", { * networkAclId: aclTest.id, * direction: "ingress", * protocol: "tcp", * action: "allow", * sourceIpAddress: "152.16.30.0/24", * destinationIpAddress: "192.168.128.0/18", * destinationPort: "445", * enabled: true, * }); * ``` */ class NetworkAclRule extends pulumi.CustomResource { /** * Get an existing NetworkAclRule 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 NetworkAclRule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of NetworkAclRule. 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'] === NetworkAclRule.__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["direction"] = state ? state.direction : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["ipVersion"] = state ? state.ipVersion : undefined; resourceInputs["networkAclId"] = state ? state.networkAclId : undefined; resourceInputs["policyId"] = state ? state.policyId : undefined; resourceInputs["protocol"] = state ? state.protocol : undefined; resourceInputs["sourceIpAddress"] = state ? state.sourceIpAddress : undefined; resourceInputs["sourcePort"] = state ? state.sourcePort : undefined; } else { const args = argsOrState; if ((!args || args.direction === undefined) && !opts.urn) { throw new Error("Missing required property 'direction'"); } if ((!args || args.networkAclId === undefined) && !opts.urn) { throw new Error("Missing required property 'networkAclId'"); } 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["direction"] = args ? args.direction : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["ipVersion"] = args ? args.ipVersion : undefined; resourceInputs["networkAclId"] = args ? args.networkAclId : undefined; resourceInputs["protocol"] = args ? args.protocol : undefined; resourceInputs["sourceIpAddress"] = args ? args.sourceIpAddress : undefined; resourceInputs["sourcePort"] = args ? args.sourcePort : undefined; resourceInputs["policyId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(NetworkAclRule.__pulumiType, name, resourceInputs, opts); } } exports.NetworkAclRule = NetworkAclRule; /** @internal */ NetworkAclRule.__pulumiType = 'huaweicloud:Iec/networkAclRule:NetworkAclRule'; //# sourceMappingURL=networkAclRule.js.map