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

asked 2 years ago1462 views
1 Answer
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
EXPERT
kentrad
answered 2 years 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