gpt4 book ai didi

amazon-web-services - AWS Beanstalk 和 IPset

转载 作者:行者123 更新时间:2023-12-03 07:40:40 26 4
gpt4 key购买 nike

我正在尝试在我的 Beanstalk 环境上设置 IPSet。在我的 .ebextensions 中,我有一个 waf.config ,其中包含:

option_settings:
aws:elasticbeanstalk:environment:
LoadBalancerType: application
Resources:
IPSet:
Type: "AWS::WAFv2::IPSet"
Properties:
Name: '`{ "Ref" : "AWSEBEnvironmentName" }`-IPset'
Addresses:
- 10.10.10.10/32
IPAddressVersion: IPV4
Scope: REGIONAL
Tags:
- Key: "Scope"
Value: "Sqreen"
WafAcl:
Type: "AWS::WAFv2::WebACL"
Properties:
Description: 'Web ACL to Block bad requests on `{ "Ref" : "AWSEBEnvironmentName" }`'
Name: '`{ "Ref" : "AWSEBEnvironmentName" }`-WebACL'
Scope: REGIONAL
DefaultAction:
Allow : {}
VisibilityConfig:
SampledRequestsEnabled: true
CloudWatchMetricsEnabled: true
MetricName: '`{ "Ref" : "AWSEBEnvironmentName" }`-WebACL'
Rules:
- Name: DenyListIPSet
Priority: 0
OverrideAction:
Block: {}
VisibilityConfig:
SampledRequestsEnabled: true
CloudWatchMetricsEnabled: true
MetricName: DenyIps
Statement:
IPSetReferenceStatement:
Arn: '`{ "Fn::GetAtt" : ["IPSet", "Arn" ]}`'
WebACLAssociation:
Type: AWS::WAFv2::WebACLAssociation
Properties:
ResourceArn: '`{ "Ref" : "AWSEBV2LoadBalancer" }`'
WebACLArn: '`{ "Fn::GetAtt" : ["WafAcl", "Arn" ]}`'

但是cloudformation堆栈给了我:“错误原因:规则语句中的引用无效。,字段:RULE,参数:语句(服务:Wafv2,状态代码:400

cloudformation 堆栈对我来说看起来很有效。我没有看到任何其他声明可以更好地满足我的需要......

编辑:解决方案

“RuleAction”和“OverrideAction”,请分别引用[3]和[4]。

[3] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ruleaction.html[4]https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-overrideaction.html

通过操作(而不是覆盖操作),WAF 按预期工作!

最佳答案

关于amazon-web-services - AWS Beanstalk 和 IPset,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69004674/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com