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

feita há um ano670 visualizações
2 Respostas
1
Resposta aceita

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.

ESPECIALISTA
respondido há um ano
profile pictureAWS
ESPECIALISTA
avaliado há um ano
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 há um ano
  • 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.

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas