Rule
Provides an WAF Regional Rule Resource for use with Application Load Balancer.
Nested Fields
predicate
See the WAF Documentation for more information.
Arguments
type- (Required) The type of predicate in a rule. Valid values:ByteMatch,GeoMatch,IPMatch,RegexMatch,SizeConstraint,SqlInjectionMatch, orXssMatchdata_id- (Required) The unique identifier of a predicate, such as the ID of aByteMatchSetorIPSet.negated- (Required) Whether to use the settings or the negated settings that you specified in the objects.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var ipset = new Aws.WafRegional.IpSet("ipset", new Aws.WafRegional.IpSetArgs
{
IpSetDescriptors =
{
new Aws.WafRegional.Inputs.IpSetIpSetDescriptorArgs
{
Type = "IPV4",
Value = "192.0.7.0/24",
},
},
});
var wafrule = new Aws.WafRegional.Rule("wafrule", new Aws.WafRegional.RuleArgs
{
MetricName = "tfWAFRule",
Predicates =
{
new Aws.WafRegional.Inputs.RulePredicateArgs
{
DataId = ipset.Id,
Negated = false,
Type = "IPMatch",
},
},
});
}
}
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 {
ipset, err := wafregional.NewIpSet(ctx, "ipset", &wafregional.IpSetArgs{
IpSetDescriptors: wafregional.IpSetIpSetDescriptorArray{
&wafregional.IpSetIpSetDescriptorArgs{
Type: pulumi.String("IPV4"),
Value: pulumi.String("192.0.7.0/24"),
},
},
})
if err != nil {
return err
}
_, err = wafregional.NewRule(ctx, "wafrule", &wafregional.RuleArgs{
MetricName: pulumi.String("tfWAFRule"),
Predicates: wafregional.RulePredicateArray{
&wafregional.RulePredicateArgs{
DataId: ipset.ID(),
Negated: pulumi.Bool(false),
Type: pulumi.String("IPMatch"),
},
},
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
ipset = aws.wafregional.IpSet("ipset", ip_set_descriptors=[{
"type": "IPV4",
"value": "192.0.7.0/24",
}])
wafrule = aws.wafregional.Rule("wafrule",
metric_name="tfWAFRule",
predicates=[{
"dataId": ipset.id,
"negated": False,
"type": "IPMatch",
}])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ipset = new aws.wafregional.IpSet("ipset", {
ipSetDescriptors: [{
type: "IPV4",
value: "192.0.7.0/24",
}],
});
const wafrule = new aws.wafregional.Rule("wafrule", {
metricName: "tfWAFRule",
predicates: [{
dataId: ipset.id,
negated: false,
type: "IPMatch",
}],
});Create a Rule Resource
new Rule(name: string, args: RuleArgs, opts?: CustomResourceOptions);def Rule(resource_name, opts=None, metric_name=None, name=None, predicates=None, tags=None, __props__=None);public Rule(string name, RuleArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args RuleArgs
- 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 RuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Rule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Rule resource accepts the following input properties:
- Metric
Name string The name or description for the Amazon CloudWatch metric of this rule.
- Name string
The name or description of the rule.
- Predicates
List<Rule
Predicate Args> The objects to include in a rule (documented below).
- Dictionary<string, string>
Key-value map of resource tags
- Metric
Name string The name or description for the Amazon CloudWatch metric of this rule.
- Name string
The name or description of the rule.
- Predicates
[]Rule
Predicate The objects to include in a rule (documented below).
- map[string]string
Key-value map of resource tags
- metric
Name string The name or description for the Amazon CloudWatch metric of this rule.
- name string
The name or description of the rule.
- predicates
Rule
Predicate[] The objects to include in a rule (documented below).
- {[key: string]: string}
Key-value map of resource tags
- metric_
name str The name or description for the Amazon CloudWatch metric of this rule.
- name str
The name or description of the rule.
- predicates
List[Rule
Predicate] The objects to include in a rule (documented below).
- Dict[str, str]
Key-value map of resource tags
Outputs
All input properties are implicitly available as output properties. Additionally, the Rule resource produces the following output properties:
Look up an Existing Rule Resource
Get an existing Rule 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?: RuleState, opts?: CustomResourceOptions): Rulestatic get(resource_name, id, opts=None, arn=None, metric_name=None, name=None, predicates=None, tags=None, __props__=None);public static Rule Get(string name, Input<string> id, RuleState? 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:
- Arn string
The ARN of the WAF Regional Rule.
- Metric
Name string The name or description for the Amazon CloudWatch metric of this rule.
- Name string
The name or description of the rule.
- Predicates
List<Rule
Predicate Args> The objects to include in a rule (documented below).
- Dictionary<string, string>
Key-value map of resource tags
- Arn string
The ARN of the WAF Regional Rule.
- Metric
Name string The name or description for the Amazon CloudWatch metric of this rule.
- Name string
The name or description of the rule.
- Predicates
[]Rule
Predicate The objects to include in a rule (documented below).
- map[string]string
Key-value map of resource tags
- arn string
The ARN of the WAF Regional Rule.
- metric
Name string The name or description for the Amazon CloudWatch metric of this rule.
- name string
The name or description of the rule.
- predicates
Rule
Predicate[] The objects to include in a rule (documented below).
- {[key: string]: string}
Key-value map of resource tags
- arn str
The ARN of the WAF Regional Rule.
- metric_
name str The name or description for the Amazon CloudWatch metric of this rule.
- name str
The name or description of the rule.
- predicates
List[Rule
Predicate] The objects to include in a rule (documented below).
- Dict[str, str]
Key-value map of resource tags
Supporting Types
RulePredicate
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.