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

demandé il y a un an667 vues
2 réponses
1
Réponse acceptée

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.

EXPERT
répondu il y a un an
profile pictureAWS
EXPERT
vérifié il y a un an
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
répondu il y a un an
  • 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.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions