is it possible to update the CloudFront in another stack to add the new origin, after it is been created

0

i have two project one is creating the cloudFront, but somehow i need to update that cloudfront to add one more origin to it is that possible

preguntada hace un año467 visualizaciones
2 Respuestas
1
Respuesta aceptada

Hi, you can see in https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html that origins are managed under the Distribution resource, not separately. So you can update your Stack that managed the Distribution to add another Origin, but you can't manage a new Origin in a separate Stack (I think this is what you're asking?) as it's not an independent resource.

It's like this because the underlying API https://docs.aws.amazon.com/cloudfront/latest/APIReference/Welcome.html is like this - no separate Origin API actions are available. So even doing this via a custom resource isn't really viable.

EXPERTO
respondido hace un año
profile pictureAWS
EXPERTO
kentrad
revisado hace un año
0

In CloudFront, you can definitely add more origins after the initial setup.

  • Head over to the CloudFront console.
  • Click on the Distribution Id you're updating.
  • Hit the 'Origins tab.
  • Click 'Create Origin' and fill in the needed details.
  • Hit 'Create' and you're done.

Remember to tweak your cache behaviors to send requests to the new origin. And keep in mind, changes can take some time to propagate.

profile pictureAWS
respondido hace un año
  • ah, after rereading your question I see that you are leveraging CloudFormation, my answer did not take that into account. I am not sure, how that complicated things, I can try to research it. Apologies.

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