Cloudfront Add Alias Issues - Invalid or missing alias DNS TXT records

0

I have a cloudfront distribution without any aliases. I can add a new alias in through the console just fine. However, when I try to add the same alias via awscli or boto3 (python), I continuously get the following error:

An error occurred (IllegalUpdate) when calling the AssociateAlias operation: Invalid or missing alias DNS TXT records.

To add to this, the domain does not exist in Route53 but it also doesn't need to when I do it via the Console. So my usual workflow is:

  1. Create a distribution
  2. Add an alias something like myname.domain.com and myname2.domain.com
  3. Add route53 A record to point myname.domain.com and myname2.domain.com to the distribution ID/address

My goal is to achieve the same without having to use the Console but I'm not able to figure it out.

  • Can you post the CLI command you are submitting?

  • Sure, aws cloudfront associate-alias --target-distribution-id <distribution-id> --alias myname.domain.com

질문됨 2년 전1477회 조회
1개 답변
0

According to the associate-alias documentation:

With this operation you can move an alias that’s already in use on a CloudFront distribution to a different distribution in one step. This prevents the downtime that could occur if you first remove the alias from one distribution and then separately add the alias to another distribution.

You should use the update-distribution command. Or set the alias(es) when you create the distribution.

profile pictureAWS
전문가
kentrad
답변함 2년 전

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

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

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

관련 콘텐츠