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

asked 10 months ago441 views
2 Answers
1
Accepted Answer

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
answered 10 months ago
profile pictureAWS
EXPERT
kentrad
reviewed 10 months ago
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
answered 10 months ago
  • 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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions