跳至内容

为什么当Cloudformation更改Cloudfront资源时,WAF会取消与资源的关联?

0

【以下的问题经过翻译处理】 大家好。 当我在CloudFormation模板中更改Cloudfront资源时,我会看到WAF上的Cloudfront Distribution被移除。 这让我感到非常不舒服。我必须重新将Distribution与WAF关联起来。 为什么WAF会取消Distribution的关联呢? 请帮助我。谢谢。

专家
已提问 2 年前63 查看次数
1 回答
0

【以下的回答经过翻译处理】 您在模板中对CloudFront Distribution资源做了哪些更改?您是否单独将WAF附加到CloudFormation上?如果您修改了影响WAF的属性,CloudFormation可能会覆盖它;如果您修改了需要替换的属性,CloudFormation将使用新的分配进行替换。

我建议您使用CloudFormation将AWS WAF与您的分配相关联。您可以使用模板中的DistributionConfig属性中的WebACLId [属性](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-webaclid)。如果您不想通过CloudFormation管理整个WAF,我建议您在模板中制定一个[参数](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html),以允许您指定WAF ACL Id,然后在分配资源中[使用](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#parameters-section-structure-referencing)该参数来设置该值。

专家
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。