How do disable AWS CloudFront Distribution via api - https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFront.html. I can't find proper function.
Final goal is delete distribution (deleteDistribution), but it requires disabling firstly.
CodePudding user response:
In order to delete a distribution, you should first use updateDistribution
to disable the distribution (setting enabled to false
), and then call deleteDistribution
to delete it.
CodePudding user response:
Call updateDistribution(params, callback)
with params.DistributionConfig.Enabled = false
.
The SDK documentation states:
Enabled — required — (Boolean)
From this field, you can enable or disable the selected distribution.