重新创建CloudFront分配会导致以下问题: "您提供的一个或多个CNAME已与不同的资源关联。"

0

【以下的问题经过翻译处理】 我们的设置: 我们使用CDKv2。 我们有一些堆栈,应该创建API Gateway和CloudFront分发。 在另一个AWS账户上,我们拥有一个Route53托管区域,其中有一个A名称记录,指向CloudFront分发。 API Gateway由自定义域名(Route53域名)作为前端。 CloudFront的源已设置为从APIGW中自定义域名生成的域。

总之,Route53 A记录-> CloudFront分发-> API GW自定义域名-> API GW。

问题: 我们删除了CloudFormation堆栈,尝试重新部署它们,现在在尝试创建CloudFront分发时看到错误:“您提供的一个或多个CNAME已与不同的资源关联” 。

据我所知,当另一个CloudFront分发正在使用CNAME时,通常会出现此错误。 然而,这种情况并不成立,因为没有其他分发存在。

旧分发在删除后是否仍存在一段时间?

profile picture
EXPERT
asked 5 months ago63 views
1 Answer
0

【以下的回答经过翻译处理】 为了防止日后其他人遇到这个问题,我自己回答一下自己的问题。

在创建API GW自定义域时,使用了“边缘”端点,该端点面向CloudFront分发到API GW。然后,CloudFormation会尝试为已经在使用的CNAME创建另一个CloudFront分发,并发现错误,然后回滚。

通过将此配置设置为“区域”而不是“边缘”,可以解决此错误。

profile picture
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions