LoginSignup
0
2

More than 1 year has passed since last update.

aws cliでcloudfrontのオブジェクトの無効化

Last updated at Posted at 2021-09-10

参考

(今後変わるかもしれないので参考程度に:)一ヶ月に無効化の回数が1000件超えると支払いが発生し始めるようなので注意しましょう。

手順

以下のコマンドで invalidationを作成できます。

$ aws cloudfront create-invalidation --distribution-id xxxxx --paths /past-payments/index.
html

このようなレスポンスが返ってきます。

{
    "Location": "https://cloudfront.amazonaws.com/2020-05-31/distribution/xxx/invalidation/xxxx",
    "Invalidation": {
        "Id": "xxxxx",
        "Status": "InProgress",
        "CreateTime": "2021-09-10T07:08:03.775000+00:00",
        "InvalidationBatch": {
            "Paths": {
                "Quantity": 1,
                "Items": [
                    "/past-payments/index.html"
                ]
            },
            "CallerReference": "cli-xxx-139143"
        }
    }
}

すべて無効化したい場合は以下を使うといいです。

aws cloudfront create-invalidation --distribution-id xxxxxx --paths "/*"
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2