Lambda provisioned concurrency for $LATEST, or, updating API gateway to refer to version


Dear Experts,

I have API gateway and Lambda working happily, without using any versions or aliases. I'd now like to enable provisioned concurrency.

It seems that I cannot configure provisioned concurrency for $LATEST - is that correct? (Can I maybe enter "$LATEST" in the Alias field in the provisioned concurrency set up box?)

Assuming that I cannot do that, what's the best, simplest way to move forward? Let's say that I publish a new version now and enable provisioned concurrency for that version. Until I next upload code, $LATEST == this version - so do invocations from API gateway use the provisioned concurrency?

My guess is no, and that I need to update my API gateway configuration to refer to either this published version of the function, or to refer to a named alias which I need to create and make refer to this version.

I do not find the API Gateway console particularly clear. It has an "Integrations" page which refers to my lambda function by name, but there doesn't seem to be a field on that page where I can set the version or alias of the function. Similarly if I create a new integration I can choose the function by name, but not select a version or alias. Do I somehow configure this from the Lambda end?

Any advice would be much appreciated.

Thanks, Phil.

6 Answers

We're having the same issue. Lodging a support ticket, but following here as well.

answered 2 years ago

We ran into a similar issue with a hitting an API Gateway WebSocket API, where the requests were being routed to a Lambda that had an established Alias with provisioned concurrency setup. After deployment, we realized none of the requests were being handled by the provisioned lambda instances.

As you suspect, the issue was that our WebSocketApi routes were configured to point directly at the ARN of the Lambda we created, and not the ARN of the alias (or version), which is referred to as the "qualified" ARN.

To correct this in the Console, in the Integration settings, where it specifies the name of the Lambda you're targeting, you can append the version or alias to the function name using a colon.

For example, with a function named lambda_worker and an alias named current you would specify:


You can then setup provisioned concurrency on that lambda alias and the routed requests should be handled by your provisioned instances.

answered 2 years ago

In the console you can select from the list of functions and that will actually refer to the $LATEST version. Alternatively, you could just put the full function ARN, including the alias (e.g., arn:aws:lambda:REGION:ACCOUNT:function:FUNCTION-NAME:ALIAS-NAME) and that will work as well.

Saying that, I would recommend not using the console but rather use infrastructure as code tools such as SAM, CloudFormation, CDK, Terraform, etc.

profile pictureAWS
answered 2 years ago

Thanks for the answers everyone. I've just noticed that in the "create alias" form, I appear to be able to create an alias that refers to $LATEST. If I do this, will I be able to configure provisioned concurrency for that alias? Will it continue to refer to the new $LATEST when I upload a new version?

answered 2 years ago

Answering that last point - I see that there is a note "Can't assign an alias with provisioned concurrency to $LATEST" if you try to do that.

answered 2 years ago

To summarise:

  • It's correct that you can't have provisioned concurrency for $LATEST.
  • You need to publish new versions after each update.
  • You can create an alias, which you need to update to refer to the newest published version each time.
  • The alias can have provisioned concurrency.
  • In API Gateway, you can paste the ARN of the alias in the integration target. (You may also be able to type lambda-name:alias, but I've not tried that.)

Thanks for the comments everyone.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions