AWS CLI: Disable Distribution

As I understand it, disabling cloud distribution means updating it and you need to delete it.

Given the very scarce AWI CLI documentation, I am looking for a minimal example of how to do this using only the CLI.

0
source share
3 answers

While I cannot provide you with a minimal example, the following should work. You can get jq from your distribution repository or from http://stedolan.imtqy.com/jq/manual/ .

  • Get Etag, you will need for step 3:

    $ aws cloudfront get-distribution-config --id E123456 | jq '. | .ETag '

:

  1. $ aws cloudfront get-distribution-config --id E123456 | jq '. |.DistributionConfig ' > /tmp/disable-distribution-E123456

    /tmp/disable-distribution-E123456, .

    :

    "DefaultRootObject": null,
    "PriceClass": "PriceClass_All",
    "Enabled": true,  <-- Set to false
    

:

  1. $ aws cloudfront update-distribution --id E123456 --if-match E3SVA578MZF6JZ - -config:///tmp/disable-distribution-E123456
+4

impalix ! , (, ):

  • . .
$ aws cloudfront list-distributions
  1. . , , .
$ aws cloudfront delete-distribution --id E123456 --if-match ETag123456
0

, .

An error occurred (DistributionNotDisabled) when calling the DeleteDistribution operation: The distribution you are trying to delete has not been disabled.

aws cloudfront delete-distribution.

, , aws cloudfront update-distribution, (. AWS, " ").

, :

aws cloudfront update-distribution
aws cloudfront wait distribution-deployed
aws cloudfront delete-distribution
0

All Articles