Re-creating CloudFront distribution results in: "One or more of the CNAMEs you provided are already associated with a different resource."

0

Our setup: We're using CDKv2. We have stacks that should create an API Gateway and a CloudFront distribution. On a separate AWS account, we have a Route53 hosted zone with an A name record that points to the CloudFront distribution. The API Gateway is fronted by a custom domain name (the Route53 domain). CloudFront's origin is set to the generated domain from the custom domain name in APIGW.

In summary, Route53 A record -> CloudFront Distribution -> API GW Custom Domain Name -> API GW.

Problem: We deleted our CloudFormation stacks and tried to re-deploy them and we're now seeing the error: "One or more of the CNAMEs you provided are already associated with a different resource" during attempted creation of the CloudFront distribution.

As far as I know, this error typically appears when another CloudFront distribution is using the CNAME. However, this is just not the case as no other distribution exists.

Is it possible that the old distribution still exists for a period of time after deletion?

1개 답변
0
수락된 답변

Answering my own question in case this is an issue for someone in the future.

When creating the API GW Custom Domain, the "edge" endpoint was used which fronts a CloudFront distribution to API GW. CloudFormation would then later attempt to create another CloudFront distribution for a CNAME that is already in use, find the error, then rollback.

By setting this configuration to "regional" instead of "edge," this error resolves.

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠