1. Packages
  2. AWS Classic
  3. API Docs
  4. wafregional
  5. RuleGroup

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.24.0 published on Tuesday, Feb 27, 2024 by Pulumi

aws.wafregional.RuleGroup

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.24.0 published on Tuesday, Feb 27, 2024 by Pulumi

    Provides a WAF Regional Rule Group Resource

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleRule = new Aws.WafRegional.Rule("exampleRule", new()
        {
            MetricName = "example",
        });
    
        var exampleRuleGroup = new Aws.WafRegional.RuleGroup("exampleRuleGroup", new()
        {
            MetricName = "example",
            ActivatedRules = new[]
            {
                new Aws.WafRegional.Inputs.RuleGroupActivatedRuleArgs
                {
                    Action = new Aws.WafRegional.Inputs.RuleGroupActivatedRuleActionArgs
                    {
                        Type = "COUNT",
                    },
                    Priority = 50,
                    RuleId = exampleRule.Id,
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/wafregional"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleRule, err := wafregional.NewRule(ctx, "exampleRule", &wafregional.RuleArgs{
    			MetricName: pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = wafregional.NewRuleGroup(ctx, "exampleRuleGroup", &wafregional.RuleGroupArgs{
    			MetricName: pulumi.String("example"),
    			ActivatedRules: wafregional.RuleGroupActivatedRuleArray{
    				&wafregional.RuleGroupActivatedRuleArgs{
    					Action: &wafregional.RuleGroupActivatedRuleActionArgs{
    						Type: pulumi.String("COUNT"),
    					},
    					Priority: pulumi.Int(50),
    					RuleId:   exampleRule.ID(),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.wafregional.Rule;
    import com.pulumi.aws.wafregional.RuleArgs;
    import com.pulumi.aws.wafregional.RuleGroup;
    import com.pulumi.aws.wafregional.RuleGroupArgs;
    import com.pulumi.aws.wafregional.inputs.RuleGroupActivatedRuleArgs;
    import com.pulumi.aws.wafregional.inputs.RuleGroupActivatedRuleActionArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var exampleRule = new Rule("exampleRule", RuleArgs.builder()        
                .metricName("example")
                .build());
    
            var exampleRuleGroup = new RuleGroup("exampleRuleGroup", RuleGroupArgs.builder()        
                .metricName("example")
                .activatedRules(RuleGroupActivatedRuleArgs.builder()
                    .action(RuleGroupActivatedRuleActionArgs.builder()
                        .type("COUNT")
                        .build())
                    .priority(50)
                    .ruleId(exampleRule.id())
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example_rule = aws.wafregional.Rule("exampleRule", metric_name="example")
    example_rule_group = aws.wafregional.RuleGroup("exampleRuleGroup",
        metric_name="example",
        activated_rules=[aws.wafregional.RuleGroupActivatedRuleArgs(
            action=aws.wafregional.RuleGroupActivatedRuleActionArgs(
                type="COUNT",
            ),
            priority=50,
            rule_id=example_rule.id,
        )])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const exampleRule = new aws.wafregional.Rule("exampleRule", {metricName: "example"});
    const exampleRuleGroup = new aws.wafregional.RuleGroup("exampleRuleGroup", {
        metricName: "example",
        activatedRules: [{
            action: {
                type: "COUNT",
            },
            priority: 50,
            ruleId: exampleRule.id,
        }],
    });
    
    resources:
      exampleRule:
        type: aws:wafregional:Rule
        properties:
          metricName: example
      exampleRuleGroup:
        type: aws:wafregional:RuleGroup
        properties:
          metricName: example
          activatedRules:
            - action:
                type: COUNT
              priority: 50
              ruleId: ${exampleRule.id}
    

    Create RuleGroup Resource

    new RuleGroup(name: string, args: RuleGroupArgs, opts?: CustomResourceOptions);
    @overload
    def RuleGroup(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  activated_rules: Optional[Sequence[RuleGroupActivatedRuleArgs]] = None,
                  metric_name: Optional[str] = None,
                  name: Optional[str] = None,
                  tags: Optional[Mapping[str, str]] = None)
    @overload
    def RuleGroup(resource_name: str,
                  args: RuleGroupArgs,
                  opts: Optional[ResourceOptions] = None)
    func NewRuleGroup(ctx *Context, name string, args RuleGroupArgs, opts ...ResourceOption) (*RuleGroup, error)
    public RuleGroup(string name, RuleGroupArgs args, CustomResourceOptions? opts = null)
    public RuleGroup(String name, RuleGroupArgs args)
    public RuleGroup(String name, RuleGroupArgs args, CustomResourceOptions options)
    
    type: aws:wafregional:RuleGroup
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args RuleGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args RuleGroupArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args RuleGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RuleGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RuleGroupArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    RuleGroup Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The RuleGroup resource accepts the following input properties:

    MetricName string
    A friendly name for the metrics from the rule group
    ActivatedRules List<RuleGroupActivatedRule>
    A list of activated rules, see below
    Name string
    A friendly name of the rule group
    Tags Dictionary<string, string>
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    MetricName string
    A friendly name for the metrics from the rule group
    ActivatedRules []RuleGroupActivatedRuleArgs
    A list of activated rules, see below
    Name string
    A friendly name of the rule group
    Tags map[string]string
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    metricName String
    A friendly name for the metrics from the rule group
    activatedRules List<RuleGroupActivatedRule>
    A list of activated rules, see below
    name String
    A friendly name of the rule group
    tags Map<String,String>
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    metricName string
    A friendly name for the metrics from the rule group
    activatedRules RuleGroupActivatedRule[]
    A list of activated rules, see below
    name string
    A friendly name of the rule group
    tags {[key: string]: string}
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    metric_name str
    A friendly name for the metrics from the rule group
    activated_rules Sequence[RuleGroupActivatedRuleArgs]
    A list of activated rules, see below
    name str
    A friendly name of the rule group
    tags Mapping[str, str]
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    metricName String
    A friendly name for the metrics from the rule group
    activatedRules List<Property Map>
    A list of activated rules, see below
    name String
    A friendly name of the rule group
    tags Map<String>
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RuleGroup resource produces the following output properties:

    Arn string
    The ARN of the WAF Regional Rule Group.
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    Arn string
    The ARN of the WAF Regional Rule Group.
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn String
    The ARN of the WAF Regional Rule Group.
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn string
    The ARN of the WAF Regional Rule Group.
    id string
    The provider-assigned unique ID for this managed resource.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn str
    The ARN of the WAF Regional Rule Group.
    id str
    The provider-assigned unique ID for this managed resource.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn String
    The ARN of the WAF Regional Rule Group.
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    Look up Existing RuleGroup Resource

    Get an existing RuleGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: RuleGroupState, opts?: CustomResourceOptions): RuleGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            activated_rules: Optional[Sequence[RuleGroupActivatedRuleArgs]] = None,
            arn: Optional[str] = None,
            metric_name: Optional[str] = None,
            name: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None) -> RuleGroup
    func GetRuleGroup(ctx *Context, name string, id IDInput, state *RuleGroupState, opts ...ResourceOption) (*RuleGroup, error)
    public static RuleGroup Get(string name, Input<string> id, RuleGroupState? state, CustomResourceOptions? opts = null)
    public static RuleGroup get(String name, Output<String> id, RuleGroupState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ActivatedRules List<RuleGroupActivatedRule>
    A list of activated rules, see below
    Arn string
    The ARN of the WAF Regional Rule Group.
    MetricName string
    A friendly name for the metrics from the rule group
    Name string
    A friendly name of the rule group
    Tags Dictionary<string, string>
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    ActivatedRules []RuleGroupActivatedRuleArgs
    A list of activated rules, see below
    Arn string
    The ARN of the WAF Regional Rule Group.
    MetricName string
    A friendly name for the metrics from the rule group
    Name string
    A friendly name of the rule group
    Tags map[string]string
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    activatedRules List<RuleGroupActivatedRule>
    A list of activated rules, see below
    arn String
    The ARN of the WAF Regional Rule Group.
    metricName String
    A friendly name for the metrics from the rule group
    name String
    A friendly name of the rule group
    tags Map<String,String>
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    activatedRules RuleGroupActivatedRule[]
    A list of activated rules, see below
    arn string
    The ARN of the WAF Regional Rule Group.
    metricName string
    A friendly name for the metrics from the rule group
    name string
    A friendly name of the rule group
    tags {[key: string]: string}
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    activated_rules Sequence[RuleGroupActivatedRuleArgs]
    A list of activated rules, see below
    arn str
    The ARN of the WAF Regional Rule Group.
    metric_name str
    A friendly name for the metrics from the rule group
    name str
    A friendly name of the rule group
    tags Mapping[str, str]
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    activatedRules List<Property Map>
    A list of activated rules, see below
    arn String
    The ARN of the WAF Regional Rule Group.
    metricName String
    A friendly name for the metrics from the rule group
    name String
    A friendly name of the rule group
    tags Map<String>
    Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    Supporting Types

    RuleGroupActivatedRule, RuleGroupActivatedRuleArgs

    Action RuleGroupActivatedRuleAction
    Specifies the action that CloudFront or AWS WAF takes when a web request matches the conditions in the rule.
    Priority int
    Specifies the order in which the rules are evaluated. Rules with a lower value are evaluated before rules with a higher value.
    RuleId string
    The ID of a rule
    Type string
    The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.
    Action RuleGroupActivatedRuleAction
    Specifies the action that CloudFront or AWS WAF takes when a web request matches the conditions in the rule.
    Priority int
    Specifies the order in which the rules are evaluated. Rules with a lower value are evaluated before rules with a higher value.
    RuleId string
    The ID of a rule
    Type string
    The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.
    action RuleGroupActivatedRuleAction
    Specifies the action that CloudFront or AWS WAF takes when a web request matches the conditions in the rule.
    priority Integer
    Specifies the order in which the rules are evaluated. Rules with a lower value are evaluated before rules with a higher value.
    ruleId String
    The ID of a rule
    type String
    The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.
    action RuleGroupActivatedRuleAction
    Specifies the action that CloudFront or AWS WAF takes when a web request matches the conditions in the rule.
    priority number
    Specifies the order in which the rules are evaluated. Rules with a lower value are evaluated before rules with a higher value.
    ruleId string
    The ID of a rule
    type string
    The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.
    action RuleGroupActivatedRuleAction
    Specifies the action that CloudFront or AWS WAF takes when a web request matches the conditions in the rule.
    priority int
    Specifies the order in which the rules are evaluated. Rules with a lower value are evaluated before rules with a higher value.
    rule_id str
    The ID of a rule
    type str
    The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.
    action Property Map
    Specifies the action that CloudFront or AWS WAF takes when a web request matches the conditions in the rule.
    priority Number
    Specifies the order in which the rules are evaluated. Rules with a lower value are evaluated before rules with a higher value.
    ruleId String
    The ID of a rule
    type String
    The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.

    RuleGroupActivatedRuleAction, RuleGroupActivatedRuleActionArgs

    Type string
    The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.
    Type string
    The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.
    type String
    The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.
    type string
    The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.
    type str
    The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.
    type String
    The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.

    Import

    Using pulumi import, import WAF Regional Rule Group using the id. For example:

     $ pulumi import aws:wafregional/ruleGroup:RuleGroup example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.24.0 published on Tuesday, Feb 27, 2024 by Pulumi