@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
150 lines • 7.07 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");
/**
* Provides a resource to manage waf acl rule
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const foo = new volcengine.waf.AclRule("foo", {
* accurateGroup: {
* accurateRules: [{
* httpObj: "request.uri",
* objType: 1,
* opretar: 2,
* property: 0,
* valueString: "GET",
* }],
* logic: 1,
* },
* aclType: "Allow",
* action: "block",
* advanced: 1,
* description: "tf-test",
* enable: 1,
* hostAddType: 3,
* hostLists: ["www.tf-test.com"],
* ipAddType: 3,
* ipLists: [
* "1.2.2.2",
* "1.2.3.30",
* ],
* projectName: "default",
* url: "/",
* });
* ```
*
* ## Import
*
* WafAclRule can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:waf/aclRule:AclRule default resource_id:AclType
* ```
*/
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["accurateGroup"] = state ? state.accurateGroup : undefined;
resourceInputs["aclType"] = state ? state.aclType : undefined;
resourceInputs["action"] = state ? state.action : undefined;
resourceInputs["advanced"] = state ? state.advanced : undefined;
resourceInputs["clientIp"] = state ? state.clientIp : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["enable"] = state ? state.enable : undefined;
resourceInputs["hostAddType"] = state ? state.hostAddType : undefined;
resourceInputs["hostGroupIds"] = state ? state.hostGroupIds : undefined;
resourceInputs["hostGroups"] = state ? state.hostGroups : undefined;
resourceInputs["hostLists"] = state ? state.hostLists : undefined;
resourceInputs["ipAddType"] = state ? state.ipAddType : undefined;
resourceInputs["ipGroupIds"] = state ? state.ipGroupIds : undefined;
resourceInputs["ipGroups"] = state ? state.ipGroups : undefined;
resourceInputs["ipLists"] = state ? state.ipLists : undefined;
resourceInputs["ipLocationCountries"] = state ? state.ipLocationCountries : undefined;
resourceInputs["ipLocationSubregions"] = state ? state.ipLocationSubregions : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["projectName"] = state ? state.projectName : undefined;
resourceInputs["ruleTag"] = state ? state.ruleTag : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
resourceInputs["url"] = state ? state.url : undefined;
}
else {
const args = argsOrState;
if ((!args || args.aclType === undefined) && !opts.urn) {
throw new Error("Missing required property 'aclType'");
}
if ((!args || args.enable === undefined) && !opts.urn) {
throw new Error("Missing required property 'enable'");
}
if ((!args || args.hostAddType === undefined) && !opts.urn) {
throw new Error("Missing required property 'hostAddType'");
}
if ((!args || args.ipAddType === undefined) && !opts.urn) {
throw new Error("Missing required property 'ipAddType'");
}
if ((!args || args.url === undefined) && !opts.urn) {
throw new Error("Missing required property 'url'");
}
resourceInputs["accurateGroup"] = args ? args.accurateGroup : undefined;
resourceInputs["aclType"] = args ? args.aclType : undefined;
resourceInputs["action"] = args ? args.action : undefined;
resourceInputs["advanced"] = args ? args.advanced : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["enable"] = args ? args.enable : undefined;
resourceInputs["hostAddType"] = args ? args.hostAddType : undefined;
resourceInputs["hostGroupIds"] = args ? args.hostGroupIds : undefined;
resourceInputs["hostLists"] = args ? args.hostLists : undefined;
resourceInputs["ipAddType"] = args ? args.ipAddType : undefined;
resourceInputs["ipGroupIds"] = args ? args.ipGroupIds : undefined;
resourceInputs["ipLists"] = args ? args.ipLists : undefined;
resourceInputs["ipLocationCountries"] = args ? args.ipLocationCountries : undefined;
resourceInputs["ipLocationSubregions"] = args ? args.ipLocationSubregions : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["projectName"] = args ? args.projectName : undefined;
resourceInputs["url"] = args ? args.url : undefined;
resourceInputs["clientIp"] = undefined /*out*/;
resourceInputs["hostGroups"] = undefined /*out*/;
resourceInputs["ipGroups"] = undefined /*out*/;
resourceInputs["ruleTag"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AclRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.AclRule = AclRule;
/** @internal */
AclRule.__pulumiType = 'volcengine:waf/aclRule:AclRule';
//# sourceMappingURL=aclRule.js.map