UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

113 lines 5.91 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.WebAcl = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Creates a WAFv2 Web ACL resource. * * > **Note** In `fieldToMatch` blocks, *e.g.*, in `byteMatchStatement`, the `body` block includes an optional argument `oversizeHandling`. AWS indicates this argument will be required starting February 2023. To avoid configurations breaking when that change happens, treat the `oversizeHandling` argument as **required** as soon as possible. * * !> **Warning:** If you use the `aws.wafv2.WebAclRuleGroupAssociation` resource to associate rule groups with this Web ACL, you must add `lifecycle { ignoreChanges = [rule] }` to this resource to prevent configuration drift. The association resource modifies the Web ACL's rules outside of this resource's direct management. * * ## Import * * Using `pulumi import`, import WAFv2 Web ACLs using `ID/Name/Scope`. For example: * * ```sh * $ pulumi import aws:wafv2/webAcl:WebAcl example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc/example/REGIONAL * ``` */ class WebAcl extends pulumi.CustomResource { /** * Get an existing WebAcl 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 WebAcl(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of WebAcl. 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'] === WebAcl.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["applicationIntegrationUrl"] = state?.applicationIntegrationUrl; resourceInputs["arn"] = state?.arn; resourceInputs["associationConfig"] = state?.associationConfig; resourceInputs["capacity"] = state?.capacity; resourceInputs["captchaConfig"] = state?.captchaConfig; resourceInputs["challengeConfig"] = state?.challengeConfig; resourceInputs["customResponseBodies"] = state?.customResponseBodies; resourceInputs["dataProtectionConfig"] = state?.dataProtectionConfig; resourceInputs["defaultAction"] = state?.defaultAction; resourceInputs["description"] = state?.description; resourceInputs["lockToken"] = state?.lockToken; resourceInputs["name"] = state?.name; resourceInputs["namePrefix"] = state?.namePrefix; resourceInputs["region"] = state?.region; resourceInputs["ruleJson"] = state?.ruleJson; resourceInputs["rules"] = state?.rules; resourceInputs["scope"] = state?.scope; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["tokenDomains"] = state?.tokenDomains; resourceInputs["visibilityConfig"] = state?.visibilityConfig; } else { const args = argsOrState; if (args?.defaultAction === undefined && !opts.urn) { throw new Error("Missing required property 'defaultAction'"); } if (args?.scope === undefined && !opts.urn) { throw new Error("Missing required property 'scope'"); } if (args?.visibilityConfig === undefined && !opts.urn) { throw new Error("Missing required property 'visibilityConfig'"); } resourceInputs["associationConfig"] = args?.associationConfig; resourceInputs["captchaConfig"] = args?.captchaConfig; resourceInputs["challengeConfig"] = args?.challengeConfig; resourceInputs["customResponseBodies"] = args?.customResponseBodies; resourceInputs["dataProtectionConfig"] = args?.dataProtectionConfig; resourceInputs["defaultAction"] = args?.defaultAction; resourceInputs["description"] = args?.description; resourceInputs["name"] = args?.name; resourceInputs["namePrefix"] = args?.namePrefix; resourceInputs["region"] = args?.region; resourceInputs["ruleJson"] = args?.ruleJson; resourceInputs["rules"] = args?.rules; resourceInputs["scope"] = args?.scope; resourceInputs["tags"] = args?.tags; resourceInputs["tokenDomains"] = args?.tokenDomains; resourceInputs["visibilityConfig"] = args?.visibilityConfig; resourceInputs["applicationIntegrationUrl"] = undefined /*out*/; resourceInputs["arn"] = undefined /*out*/; resourceInputs["capacity"] = undefined /*out*/; resourceInputs["lockToken"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(WebAcl.__pulumiType, name, resourceInputs, opts); } } exports.WebAcl = WebAcl; /** @internal */ WebAcl.__pulumiType = 'aws:wafv2/webAcl:WebAcl'; //# sourceMappingURL=webAcl.js.map