AWS API。 CloudFront 分发禁用

AWS API. CloudFront Distribution disable

如何通过 api - https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFront.html 禁用 AWS CloudFront 分发。我找不到合适的功能。

最终目标是删除分发(deleteDistribution),但需要先禁用

要删除分配,您应该先使用updateDistribution to disable the distribution (setting enabled to false), and then call deleteDistribution删除它。

params.DistributionConfig.Enabled = false 调用 updateDistribution(params, callback)

SDK documentation 状态:

Enabled — required — (Boolean)

From this field, you can enable or disable the selected distribution.