UNPKG

@pulumi/aws

Version:

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

135 lines 4.77 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.WebAclAssociation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an association with WAF Regional Web ACL. * * > **Note:** An Application Load Balancer can only be associated with one WAF Regional WebACL. * * ## Example Usage * * ### Application Load Balancer Association * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const ipset = new aws.wafregional.IpSet("ipset", { * name: "tfIPSet", * ipSetDescriptors: [{ * type: "IPV4", * value: "192.0.7.0/24", * }], * }); * const foo = new aws.wafregional.Rule("foo", { * name: "tfWAFRule", * metricName: "tfWAFRule", * predicates: [{ * dataId: ipset.id, * negated: false, * type: "IPMatch", * }], * }); * const fooWebAcl = new aws.wafregional.WebAcl("foo", { * name: "foo", * metricName: "foo", * defaultAction: { * type: "ALLOW", * }, * rules: [{ * action: { * type: "BLOCK", * }, * priority: 1, * ruleId: foo.id, * }], * }); * const fooVpc = new aws.ec2.Vpc("foo", {cidrBlock: "10.1.0.0/16"}); * const available = aws.getAvailabilityZones({}); * const fooSubnet = new aws.ec2.Subnet("foo", { * vpcId: fooVpc.id, * cidrBlock: "10.1.1.0/24", * availabilityZone: available.then(available => available.names?.[0]), * }); * const bar = new aws.ec2.Subnet("bar", { * vpcId: fooVpc.id, * cidrBlock: "10.1.2.0/24", * availabilityZone: available.then(available => available.names?.[1]), * }); * const fooLoadBalancer = new aws.alb.LoadBalancer("foo", { * internal: true, * subnets: [ * fooSubnet.id, * bar.id, * ], * }); * const fooWebAclAssociation = new aws.wafregional.WebAclAssociation("foo", { * resourceArn: fooLoadBalancer.arn, * webAclId: fooWebAcl.id, * }); * ``` * * ## Import * * Using `pulumi import`, import WAF Regional Web ACL Association using their `web_acl_id:resource_arn`. For example: * * ```sh * $ pulumi import aws:wafregional/webAclAssociation:WebAclAssociation foo web_acl_id:resource_arn * ``` */ class WebAclAssociation extends pulumi.CustomResource { /** * Get an existing WebAclAssociation 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 WebAclAssociation(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of WebAclAssociation. 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'] === WebAclAssociation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["region"] = state?.region; resourceInputs["resourceArn"] = state?.resourceArn; resourceInputs["webAclId"] = state?.webAclId; } else { const args = argsOrState; if (args?.resourceArn === undefined && !opts.urn) { throw new Error("Missing required property 'resourceArn'"); } if (args?.webAclId === undefined && !opts.urn) { throw new Error("Missing required property 'webAclId'"); } resourceInputs["region"] = args?.region; resourceInputs["resourceArn"] = args?.resourceArn; resourceInputs["webAclId"] = args?.webAclId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(WebAclAssociation.__pulumiType, name, resourceInputs, opts); } } exports.WebAclAssociation = WebAclAssociation; /** @internal */ WebAclAssociation.__pulumiType = 'aws:wafregional/webAclAssociation:WebAclAssociation'; //# sourceMappingURL=webAclAssociation.js.map