Reputation: 21830
In the GUI, I can add CNAMEs to the distribution for future use in Route53, what is the appropriate API call for that?
Upvotes: 0
Views: 130
Reputation: 179114
The CloudFront API uses kind of a monolithic REST-like model -- there's no API method to simply modify this one thing.
Instead, you use PUT /2017-03-25/distribution/Id/config HTTP/1.1
and replace essentially the entire distribution configuration with a new configuration, which consists of the current distribution config, as fetched from the API, plus any changes.
Distribution alternate domain names (unfortunately they are inaccurately referred to as CNAMEs) are in the <Aliases>
block of the XML.
http://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.html
Upvotes: 1