@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
81 lines • 3.23 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.Acl = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an ACL resource within HuaweiCloud IAM service. The ACL allowing user access only from specified IP address
* ranges and IPv4 CIDR blocks. The ACL take effect for IAM users under the Domain account rather than the account itself.
*
* > **NOTE:** You *must* have admin privileges to use this resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
*
* const acl = new huaweicloud.Iam.Acl("acl", {
* ipCidrs: [{
* cidr: "159.138.39.192/32",
* description: "This is a test ip address",
* }],
* ipRanges: [{
* description: "This is a test ip range",
* range: "0.0.0.0-255.255.255.0",
* }],
* type: "console",
* });
* ```
*/
class Acl extends pulumi.CustomResource {
/**
* Get an existing Acl 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 Acl(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Acl. 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'] === Acl.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["ipCidrs"] = state ? state.ipCidrs : undefined;
resourceInputs["ipRanges"] = state ? state.ipRanges : undefined;
resourceInputs["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["ipCidrs"] = args ? args.ipCidrs : undefined;
resourceInputs["ipRanges"] = args ? args.ipRanges : undefined;
resourceInputs["type"] = args ? args.type : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Acl.__pulumiType, name, resourceInputs, opts);
}
}
exports.Acl = Acl;
/** @internal */
Acl.__pulumiType = 'huaweicloud:Iam/acl:Acl';
//# sourceMappingURL=acl.js.map