AWS CLI:禁止发行 [英] AWS CLI: disable distribution
问题描述
据我也明白了,禁用CloudFront的分布的手段的更新其状态的,并且必须能够将其删除。
由于AWS CLI的很稀疏的文档,我找的是如何只使用CLI做更新一个小例子。
虽然我不能为你提供一个最小的例子,下面应该工作。您可以从您的发行版的储存库JQ或 http://stedolan.github.io/jq/manual/ 。
-
获取Etag的,会需要它第3步:
$ AWS CloudFront的获取,分发,配置--id E123456 | JQ。 | .ETag
获取当前配置:
<醇开始=2>$ AWS CloudFront的获取,分发,配置--id E123456 | JQ。 | .DistributionConfig'>的/ tmp /禁用分布-E123456
修改的/ tmp /禁用分布-E123456,分布配置文件来禁用。
相关部分:
DefaultRootObject:空,
价格查询:PriceClass_All,
已启用:真实,&LT; - 设置为false
更新分发:
<醇开始=3>As far as I have understood, disabling a cloudfront distribution means updating it's status and is necessary to be able to delete it.
Given the very sparse documentation of the AWS CLI, I am looking for a minimal example of how to do that update using just the CLI.
While I can't provide you a minimal example, the following should work. You can obtain jq from your distribution's repository or from http://stedolan.github.io/jq/manual/.
Get the Etag, will need it for step 3:
$ aws cloudfront get-distribution-config --id E123456 | jq '. | .ETag'
Get current config:
$ aws cloudfront get-distribution-config --id E123456 | jq '. | .DistributionConfig' > /tmp/disable-distribution-E123456
Modify /tmp/disable-distribution-E123456, distribution config file to disable.
Relevant section:
"DefaultRootObject": null, "PriceClass": "PriceClass_All", "Enabled": true, <-- Set to false
Update Distribution:
- $ aws cloudfront update-distribution --id E123456 --if-match E3SVA578MZF6JZ --distribution-config file:///tmp/disable-distribution-E123456
这篇关于AWS CLI:禁止发行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!