damp-salesmen-74351
01/23/2024, 10:58 PMwaf
with rate limit rule,
I try to create a RuleGroup
but I got error for this line of code:
action=pulumi_aws.wafv2.RuleGroupRuleActionArgs(
allow=pulumi_aws.wafv2.RuleGroupRuleActionAllowArgs(),
),
Here is the code:
import pulumi
import pulumi_aws
def create_rate_limit_rule(
deploy_name_prefix,
):
"""
:param deploy_name_prefix:
:return:
"""
rate_based_rule = pulumi_aws.wafv2.RuleGroup(
f'waf-rule-group{deploy_name_prefix}',
capacity=100,
scope="REGIONAL",
rules=[
pulumi_aws.wafv2.RuleGroupRuleArgs(
name=f'waf-rule-group-arg{deploy_name_prefix}',
priority=1,
action=pulumi_aws.wafv2.RuleGroupRuleActionArgs(
allow=pulumi_aws.wafv2.RuleGroupRuleActionAllowArgs(),
),
statement=pulumi_aws.wafv2.RuleGroupRuleStatementArgs(
rate_based_statement=pulumi_aws.wafv2.RuleGroupRuleStatementRateBasedStatementArgs(
aggregate_key_type="IP",
limit=100,
),
),
visibility_config=pulumi_aws.wafv2.RuleGroupRuleVisibilityConfigArgs(
cloudwatch_metrics_enabled=True,
metric_name='WafRbrMetric',
sampled_requests_enabled=True,
),
)
],
visibility_config=pulumi_aws.wafv2.RuleGroupVisibilityConfigArgs(
cloudwatch_metrics_enabled=True,
metric_name='WafRbrGroupMetric',
sampled_requests_enabled=True,
)
)
return rate_based_rule
Info:
creating WAFv2 RuleGroup (waf-rule-group-pr-a12b7df):
WAFInvalidParameterException: Error reason: The parameter value isn't supported., field: RULE_ACTION, parameter: AllowAction(customRequestHandling=null)
damp-salesmen-74351
01/23/2024, 11:41 PM