我已经在我的AWS帐户中创建了WAF,我希望将它与我的API网关rest端点集成起来。
我在下面的命令中找到了将WAF与API网关rest端点集成在一起的命令,但我必须使用Cloudformation模板来完成相同的工作。
aws waf-regional associate-web-acl \
--web-acl-id 'aabc123a-fb4f-4fc6-becb-2b00831cadcf' \
--resource-arn 'arn:aws:apigateway:{region}::/restapis/4wk1k4onj3/stages/prod'我也无法从AWS文件中了解到如何将WAF与API网关端点连接起来。
以下是AWS UI中WAF配置的外观:

发布于 2019-07-25 09:13:51
下面是将WAF与AWS中任何WAF支持的资源集成的方法:https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafregional-webaclassociation.html
"MyWebACLAssociation": {
"Type": "AWS::WAFRegional::WebACLAssociation",
"Properties": {
"ResourceArn": { "Ref": "MyLoadBalancer" },
"WebACLId": { "Ref": "MyWebACL" }
}
}编辑:较新的WAFv2:https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-webaclassociation.html的文档
https://stackoverflow.com/questions/57197145
复制相似问题