amazon web services - AWS CLI: disable distribution -
as far have understood, disabling cloudfront distribution means updating it's status , necessary able delete it.
given sparse documentation of aws cli, looking minimal illustration of how update using cli.
while can't provide minimal example, next should work. can obtain jq distribution's repository or http://stedolan.github.io/jq/manual/.
get etag, need 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 disable.
relevant section:
"defaultrootobject": null, "priceclass": "priceclass_all", "enabled": true, <-- set false
update distribution:
$ aws cloudfront update-distribution --id e123456 --if-match e3sva578mzf6jz --distribution-config file:///tmp/disable-distribution-e123456 amazon-web-services amazon-cloudfront aws-cli
No comments:
Post a Comment