RuleGroup

Provides a WAF Regional Rule Group Resource

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleRule = new Aws.WafRegional.Rule("exampleRule", new Aws.WafRegional.RuleArgs
        {
            MetricName = "example",
        });
        var exampleRuleGroup = new Aws.WafRegional.RuleGroup("exampleRuleGroup", new Aws.WafRegional.RuleGroupArgs
        {
            ActivatedRules = 
            {
                new Aws.WafRegional.Inputs.RuleGroupActivatedRuleArgs
                {
                    Action = new Aws.WafRegional.Inputs.RuleGroupActivatedRuleActionArgs
                    {
                        Type = "COUNT",
                    },
                    Priority = 50,
                    RuleId = exampleRule.Id,
                },
            },
            MetricName = "example",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/wafregional"
    "github.com/pulumi/pulumi/sdk/v2/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{
            ActivatedRules: wafregional.RuleGroupActivatedRuleArray{
                &wafregional.RuleGroupActivatedRuleArgs{
                    Action: &wafregional.RuleGroupActivatedRuleActionArgs{
                        Type: pulumi.String("COUNT"),
                    },
                    Priority: pulumi.Int(50),
                    RuleId:   exampleRule.ID(),
                },
            },
            MetricName: pulumi.String("example"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example_rule = aws.wafregional.Rule("exampleRule", metric_name="example")
example_rule_group = aws.wafregional.RuleGroup("exampleRuleGroup",
    activated_rules=[{
        "action": {
            "type": "COUNT",
        },
        "priority": 50,
        "rule_id": example_rule.id,
    }],
    metric_name="example")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleRule = new aws.wafregional.Rule("example", {
    metricName: "example",
});
const exampleRuleGroup = new aws.wafregional.RuleGroup("example", {
    activatedRules: [{
        action: {
            type: "COUNT",
        },
        priority: 50,
        ruleId: exampleRule.id,
    }],
    metricName: "example",
});

Create a RuleGroup Resource

def RuleGroup(resource_name, opts=None, activated_rules=None, metric_name=None, name=None, tags=None, __props__=None);
func NewRuleGroup(ctx *Context, name string, args RuleGroupArgs, opts ...ResourceOption) (*RuleGroup, error)
public RuleGroup(string name, RuleGroupArgs args, CustomResourceOptions? opts = null)
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.
opts ResourceOptions
A bag of options that control this 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.

RuleGroup Resource Properties

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

Inputs

The RuleGroup resource accepts the following input properties:

MetricName string

A friendly name for the metrics from the rule group

ActivatedRules List<RuleGroupActivatedRuleArgs>

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

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 map[string]string

Key-value map of resource tags

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

metric_name str

A friendly name for the metrics from the rule group

activated_rules List[RuleGroupActivatedRule]

A list of activated rules, see below

name str

A friendly name of the rule group

tags Dict[str, str]

Key-value map of resource tags

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.
Arn string

The ARN of the WAF Regional Rule Group.

Id string
The provider-assigned unique ID for this managed resource.
arn string

The ARN of the WAF Regional Rule Group.

id string
The provider-assigned unique ID for this managed resource.
arn str

The ARN of the WAF Regional Rule Group.

id str
The provider-assigned unique ID for this managed resource.

Look up an 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
static get(resource_name, id, opts=None, activated_rules=None, arn=None, metric_name=None, name=None, tags=None, __props__=None);
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)
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.

The following state arguments are supported:

ActivatedRules List<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 Dictionary<string, string>

Key-value map of resource tags

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 map[string]string

Key-value map of resource tags

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

activated_rules List[RuleGroupActivatedRule]

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 Dict[str, str]

Key-value map of resource tags

Supporting Types

RuleGroupActivatedRule

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Action RuleGroupActivatedRuleActionArgs

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 waf_regional_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 waf_regional_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 waf_regional_rule

type string

The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.

action Dict[RuleGroupActivatedRuleAction]

Specifies the action that CloudFront or AWS WAF takes when a web request matches the conditions in the rule.

priority float

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 waf_regional_rule

type str

The rule type, either REGULAR, RATE_BASED, or GROUP. Defaults to REGULAR.

RuleGroupActivatedRuleAction

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.