[最終更新] 2021年1月13日
AWS Lambdaをデプロイした時、ダウンタイムは発生するのかについて。
直接答えとなる記述をドキュメントで見つけることができていないのだが、AWSフォーラムの開発者による回答を見るに、新旧両方のバージョンが動作する時間はあるものの、ダウンタイム自体は理屈のうえではなさそう。
公式フォーラムの回答
「AWS Developer Forums: What happens to a running lambda during …」の回答による。そのまま引用する。
In-flight invocations complete, without code changes or interruption, using the version of the function that was in place at the time they began. You can potentially have a function change for asynchronous invocations that experience errors or throttles, because a retry will potentially allow a new version of the function to be hit on the next attempt. While we do not abort in-flight invocations, we will aggressively eliminate copies of the old code; this typically happens within a minute of a function being updated. That means that for up to about 5-6 minutes (the max duration of a function, plus a little bit) you can experience either/both versions in use; after that, you should see only the new(ly deployed) version executing.
AWS Developer Forums: What happens to a running lambda during …
つまりデプロイ中の挙動としては以下のような感じ。
- 古いバージョンが動作したら、完了までそのバージョンが動作する
- ただし、エラーとかでリトライが発生すると、今度は新しいバージョンが動くかも
- 関数の動作時間に加えて5,6分くらいは、新旧両方のバージョンが動くかもね
ということらしい。
いずれにしても、こういうことならばダウンタイム自体は発生しない……と思われる。
リンク
- What happens to a running AWS lambda during redeployment? – Stack Overflow
- AWS Developer Forums: What happens to a running lambda during …
関連コンテンツ
関連記事
aws の記事
- ---本記事(カテゴリー内最新)---
- [2020年12月8日] DynamoDB から DocumentClient で get() した StringSet型 の値を取り出す
- [2020年11月20日] AWS Lambda (Python 3.8)でイベント起動した時にeventに渡されるパラメータあれこれ
- [2020年10月13日] AWS Lambda (Python 3.8)から Amazon Elasticsearchを使う(LambdaはSAMで)
- [2020年10月12日] AWS SAM CLIでSNSからLambdaを起動する(Python 3.8)、S3からSNSに通知する
- [2020年5月13日] Grafana on EC2 で Let’s Encrypt 使ってSSL
- [2020年4月28日] httpでPOSTする受け口をSAM CLI + API Gateway + Lambdaで作る
- [2020年4月26日] DynamoDBで多対多のテーブル設計
- [2020年4月17日] S3に指定のバケットにファイル生成したらSQSに通知
- [2019年6月12日] とにかくCloudSearch + boto3で全文検索するために学習する
- [2019年4月21日] DynamoDBのテーブル設計をするとき、自分に問いかけていること
スポンサーリンク