chalice
chalice copied to clipboard
Support new Lambda deployment params: Provisioned Concurrency, Maximum Event Age and Maximum Retry Attempts
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:
I agree, marking as a feature request.
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}"
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.
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.
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?
Seems to be (at least partial) duplicate of #1309.
@renecouto can you submit a proposal?
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?
Any update on this?
Any updates?
Another vote for adding this functionality, would be helpful!
Topic super important, it would be nice to receive any updates
Yup, we want this also!
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.
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.
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)