RateBasedRuleArgs

data class RateBasedRuleArgs(val metricName: Output<String>? = null, val name: Output<String>? = null, val predicates: Output<List<RateBasedRulePredicateArgs>>? = null, val rateKey: Output<String>? = null, val rateLimit: Output<Int>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<RateBasedRuleArgs>

Provides a WAF Rate Based Rule Resource

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.waf.IpSet;
import com.pulumi.aws.waf.IpSetArgs;
import com.pulumi.aws.waf.inputs.IpSetIpSetDescriptorArgs;
import com.pulumi.aws.waf.RateBasedRule;
import com.pulumi.aws.waf.RateBasedRuleArgs;
import com.pulumi.aws.waf.inputs.RateBasedRulePredicateArgs;
import com.pulumi.resources.CustomResourceOptions;
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 ipset = new IpSet("ipset", IpSetArgs.builder()
.ipSetDescriptors(IpSetIpSetDescriptorArgs.builder()
.type("IPV4")
.value("192.0.7.0/24")
.build())
.build());
var wafrule = new RateBasedRule("wafrule", RateBasedRuleArgs.builder()
.metricName("tfWAFRule")
.rateKey("IP")
.rateLimit(100)
.predicates(RateBasedRulePredicateArgs.builder()
.dataId(ipset.id())
.negated(false)
.type("IPMatch")
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(ipset)
.build());
}
}

Import

WAF Rated Based Rule can be imported using the id, e.g.,

$ pulumi import aws:waf/rateBasedRule:RateBasedRule wafrule a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc

Constructors

Link copied to clipboard
constructor(metricName: Output<String>? = null, name: Output<String>? = null, predicates: Output<List<RateBasedRulePredicateArgs>>? = null, rateKey: Output<String>? = null, rateLimit: Output<Int>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val metricName: Output<String>? = null

The name or description for the Amazon CloudWatch metric of this rule.

Link copied to clipboard
val name: Output<String>? = null

The name or description of the rule.

Link copied to clipboard

The objects to include in a rule (documented below).

Link copied to clipboard
val rateKey: Output<String>? = null

Valid value is IP.

Link copied to clipboard
val rateLimit: Output<Int>? = null

The maximum number of requests, which have an identical value in the field specified by the RateKey, allowed in a five-minute period. Minimum value is 100.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

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.

Functions

Link copied to clipboard
open override fun toJava(): RateBasedRuleArgs