1
votes

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 ?

1

1 Answers

4
votes

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.