Restarting AWS lambda function to clear cache

后端 未结 7 1761
你的背包
你的背包 2021-01-08 00:38

I have a AWS Lambda function that creates an object from a s3 call in cold start. I then hold the object in the cache while the function is warm to keep load times down. W

7条回答
  •  情书的邮戳
    2021-01-08 01:02

    If you are using the Lambda versioning system, another way to do this is by publishing a new version and using an alias to direct all traffic to it.

    Here's an example:

    Publish version: aws lambda publish-version --function-name your-function-name-here

    Update the alias pointing to the new version: aws lambda update-alias --function-name your-function-name-here --name alias-name-here --function-version 123 (use the function version in the output message from the first command above)

提交回复
热议问题