CamHart
CamHart

Reputation: 4335

What happens to request in the middle of an aws lambda update?

If I:

  1. Trigger an AWS Lambda deployment/update
  2. Trigger a request to AWS Lambda prior to step #1 finishing

Will the request just hit the old lambda? Will it error out?

So far in my testing it seems like there is no "downtime", that it swaps out the old for the new almost instantly--although the first request on the new lambda does have to do a cold start.

Upvotes: 2

Views: 2202

Answers (2)

Tom Bunting
Tom Bunting

Reputation: 1865

It is now possible to have even more fine-grained control over how requests are handled between lambda function versions using the new traffic shifting feature announced recently at AWS's re:Invent conference:

https://aws.amazon.com/about-aws/whats-new/2017/11/aws-lambda-supports-traffic-shifting-and-phased-deployments-with-aws-codedeploy/

Upvotes: 1

Jeff Learman
Jeff Learman

Reputation: 3287

You are correct. IIRC, each function invocation uses a specific function ARN, which changes when you update the function. When you invoke the function, you're using the new ARN, which invokes only the new version.

I believe it's possible to continue using the old function, using the old ARN explicitly (though you might not be able to do this from the Lambda console.)

For more info, see http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html

Upvotes: 1

Related Questions