RuleGroup
Provides a WAF Rule Group Resource
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var exampleRule = new Aws.Waf.Rule("exampleRule", new Aws.Waf.RuleArgs
{
MetricName = "example",
});
var exampleRuleGroup = new Aws.Waf.RuleGroup("exampleRuleGroup", new Aws.Waf.RuleGroupArgs
{
ActivatedRules =
{
new Aws.Waf.Inputs.RuleGroupActivatedRuleArgs
{
Action = new Aws.Waf.Inputs.RuleGroupActivatedRuleActionArgs
{
Type = "COUNT",
},
Priority = 50,
RuleId = exampleRule.Id,
},
},
MetricName = "example",
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/waf"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleRule, err := waf.NewRule(ctx, "exampleRule", &waf.RuleArgs{
MetricName: pulumi.String("example"),
})
if err != nil {
return err
}
_, err = waf.NewRuleGroup(ctx, "exampleRuleGroup", &waf.RuleGroupArgs{
ActivatedRules: waf.RuleGroupActivatedRuleArray{
&waf.RuleGroupActivatedRuleArgs{
Action: &waf.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.waf.Rule("exampleRule", metric_name="example")
example_rule_group = aws.waf.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.waf.Rule("example", {
metricName: "example",
});
const exampleRuleGroup = new aws.waf.RuleGroup("example", {
activatedRules: [{
action: {
type: "COUNT",
},
priority: 50,
ruleId: exampleRule.id,
}],
metricName: "example",
});Create a RuleGroup Resource
new RuleGroup(name: string, args: RuleGroupArgs, opts?: CustomResourceOptions);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:
- Metric
Name string A friendly name for the metrics from the rule group
- Activated
Rules List<RuleGroup Activated Rule Args> A list of activated rules, see below
- Name string
A friendly name of the rule group
- Dictionary<string, string>
Key-value map of resource tags
- Metric
Name string A friendly name for the metrics from the rule group
- Activated
Rules []RuleGroup Activated Rule A list of activated rules, see below
- Name string
A friendly name of the rule group
- map[string]string
Key-value map of resource tags
- metric
Name string A friendly name for the metrics from the rule group
- activated
Rules RuleGroup Activated Rule[] A list of activated rules, see below
- name string
A friendly name of the rule group
- {[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[RuleGroup Activated Rule] A list of activated rules, see below
- name str
A friendly name of the rule group
- 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:
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): RuleGroupstatic 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:
- Activated
Rules List<RuleGroup Activated Rule Args> A list of activated rules, see below
- Arn string
The ARN of the WAF rule group.
- Metric
Name string A friendly name for the metrics from the rule group
- Name string
A friendly name of the rule group
- Dictionary<string, string>
Key-value map of resource tags
- Activated
Rules []RuleGroup Activated Rule A list of activated rules, see below
- Arn string
The ARN of the WAF rule group.
- Metric
Name string A friendly name for the metrics from the rule group
- Name string
A friendly name of the rule group
- map[string]string
Key-value map of resource tags
- activated
Rules RuleGroup Activated Rule[] A list of activated rules, see below
- arn string
The ARN of the WAF rule group.
- metric
Name string A friendly name for the metrics from the rule group
- name string
A friendly name of the rule group
- {[key: string]: string}
Key-value map of resource tags
- activated_
rules List[RuleGroup Activated Rule] A list of activated rules, see below
- arn str
The ARN of the WAF rule group.
- metric_
name str A friendly name for the metrics from the rule group
- name str
A friendly name of the rule group
- Dict[str, str]
Key-value map of resource tags
Supporting Types
RuleGroupActivatedRule
- Action
Rule
Group Activated Rule Action Args 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 string The ID of a
waf_rule- Type string
The rule type, either
REGULAR,RATE_BASED, orGROUP. Defaults toREGULAR.
- Action
Rule
Group Activated Rule Action 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 string The ID of a
waf_rule- Type string
The rule type, either
REGULAR,RATE_BASED, orGROUP. Defaults toREGULAR.
- action
Rule
Group Activated Rule Action 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.
- rule
Id string The ID of a
waf_rule- type string
The rule type, either
REGULAR,RATE_BASED, orGROUP. Defaults toREGULAR.
- action
Dict[Rule
Group Activated Rule Action] 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_rule- type str
The rule type, either
REGULAR,RATE_BASED, orGROUP. Defaults toREGULAR.
RuleGroupActivatedRuleAction
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.