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 年前

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

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

回答问题的准则