![](/img/trans.png)
[英]Create a geomatching AWS WAF condition/rule and connect it to an existing CloudFront distribution using CloudFormation
[英]How to integrate CloudFront distribution to AWS WAF by using CloudFormation?
我正在尝试使用CloudFormation将CloudFront分配添加到AWS WAF,并且已经尝试过了,
"Type": "AWS::WAFRegional::WebACLAssociation",
"Properties": {
"ResourceArn": "arn:aws:cloudfront::AccountID:distribution/CloudFrontID",
"WebACLId": {
"Ref": "WebACLName"
}
但是我最终遇到了这个错误:所引用的项目不存在。 (服务:AWSWAFRegional;状态代码:400;错误代码:WAFNonexistentItemException;请求ID:149453cd-1606-11e8-86b2-a3efdb49d9d1)
AWS::WAFRegional::*
实际上是与Application Load Balancer关联的。 您将要使用AWS::WAF::*
类型(不带“区域”)。
然后,对于关联,您必须从CloudFront发行版本身进行关联。 像这样:
"myDistribution": {
"Type": "AWS::CloudFront::Distribution",
"Properties": {
"DistributionConfig": {
"WebACLId": { "Ref" : "MyWebACL" },
该部分在CloudFormation文档中进行了说明 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.