chalice icon indicating copy to clipboard operation
chalice copied to clipboard

Support new Lambda deployment params: Provisioned Concurrency, Maximum Event Age and Maximum Retry Attempts

Open danil-smirnov opened this issue 5 years ago • 18 comments

New and quite exciting Lambda configuration parameters have been recently announced by AWS:

  • https://aws.amazon.com/ru/about-aws/whats-new/2019/11/aws-lambda-supports-max-retry-attempts-event-age-asynchronous-invocations/
  • https://aws.amazon.com/ru/about-aws/whats-new/2019/12/aws-lambda-announces-provisioned-concurrency/

They can be set using AWS console and it would be great to have them configurable in .chalice/config.json as well:

Screenshot 2019-12-10 at 11 53 18

danil-smirnov avatar Dec 10 '19 09:12 danil-smirnov

I agree, marking as a feature request.

jamesls avatar Feb 24 '20 19:02 jamesls

I was looking into adding provisioned concurrency (before this feature is released) using a custom post-chalice-deploy script. I would need to publish a version after/during deploy and then modify the API Gateway's lambda proxy configuration to point at the version instead of the unqualified lambda.

Is there a place in the chalice deployment configuration to setup the version number or at least modify the ARN for the lambda that the API Gateway endpoints point at?

For example: Instead of setting "{lambda_arn}" set something like: "{lambda_arn}:${tag_variable or version value}"

rmilne avatar Sep 25 '20 01:09 rmilne

There's not a good way to override this if you're using chalice deploy. If you're using the chalice package command, you could have a json snippet that overrides the uri in the swagger doc that you can then specify with --merge-template.

That being said, let me look into what it takes to support this. We'd need to add some support for versioning/aliases in Chalice in order to support provisioned concurrency.

jamesls avatar Sep 25 '20 16:09 jamesls

We might be able to just start with the AutoPublishAlias that SAM has and suggested here: https://github.com/aws/chalice/issues/907. That seems like a good first pass to support provisioned concurrency.

jamesls avatar Sep 25 '20 18:09 jamesls

I can work on the Provisioned Concurrency param, since it's very similar to the already implemented Reserved Concurrency. So should I proceed making a structured proposal?

renecouto avatar Nov 11 '20 15:11 renecouto

Seems to be (at least partial) duplicate of #1309.

and-semakin avatar Dec 25 '20 15:12 and-semakin

@renecouto can you submit a proposal?

ghost avatar Mar 14 '21 05:03 ghost

We would like to set the maximum-retry setting for the lambda function(based on DynamoStreams) is that functionality available in the chalice or yet to be implemented?

sudev avatar May 24 '21 16:05 sudev

Any update on this?

postmart avatar May 03 '22 12:05 postmart

Any updates?

Matvii-Boichenko avatar Mar 18 '23 12:03 Matvii-Boichenko

Another vote for adding this functionality, would be helpful!

nath-untold avatar Apr 14 '23 14:04 nath-untold

Topic super important, it would be nice to receive any updates

Wtevia avatar Apr 15 '23 15:04 Wtevia

Yup, we want this also!

AndrewFarley avatar May 12 '23 11:05 AndrewFarley

Has anyone figured out how to manually do this?

I tried setting an alias's ARN manually in the uri field of the generated API gateway endpoint, and it threw an internal server error.

ankrgyl avatar Aug 15 '23 06:08 ankrgyl

It would be nice even to be able to specify a version or alias in the config.json so we can manually create the alias needed to provision concurrency. But atm, even if you create that, API gateway is pointing to LATEST, not any provisioned version or alias.

Middleman3 avatar Dec 13 '23 00:12 Middleman3

Using configure_async_invoke worked for me:

app.py:

@app.lambda_function(name="MyFunctionName")
def do_not_retry_this_fn(event, context=None):
    pass

chaliceapp.py:

my_fn = self.chalice.get_function("MyFunctionName")
my_fn.configure_async_invoke(retry_attempts=0)

hugoalvarado avatar Jan 29 '24 20:01 hugoalvarado