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

preguntada hace 2 años1477 visualizaciones
1 Respuesta
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
EXPERTO
kentrad
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas