Harsh Saudagar
Harsh Saudagar

Reputation: 478

How to add new origins to an already existing cloudfront distribution through cloudformation?

I am trying to add an origin to my already existing Cloudfront distribution(created outside of Cloudformation).

Looking at the AWS::CloudFront::DistributionOrigin block in the AWS docs, I could not find any property where I could specify an already existing Cloudfront distribution Id/ARN to add my origin to.

AWS::CloudFront::DistributionOrigin
{
  "CustomOriginConfig" : CustomOriginConfig,
  "DomainName" : String,
  "Id" : String, (this is the Origin Id)
  "OriginCustomHeaders" : [ OriginCustomHeader, ... ],
  "OriginPath" : String,
  "S3OriginConfig" : S3OriginConfig
}

The console let's me add an origin easily to an already existing distribution and I feel the same should have been possible through Cloudformation. Is there a way I can update my existing Cloudfront distribution with a new origin through Cloudformation ?

Upvotes: 2

Views: 2416

Answers (1)

Yupik
Yupik

Reputation: 5031

The answer is: there's no way. As you can see in documentation AWS::CloudFront::Distribution Origin - Distribution Origin is part of Distribution - it is not standalone resource.

Upvotes: 4

Related Questions