I want to limit number of simultaneously running lambdas through cloudformation configuration file. I tried to search for it, but had no luck. On the documentation page there is not information about it. There are to approaches to set this limit: by console or by API. But how can I do it automatically on stack deploying?
You can now set Per Function Concurrency using
ReservedConcurrentExecutions
This property allows you to set a concurrency limit to each of your Lambda functions.
Documentation for this property.
I am guessing that, since this feature is relatively new (and there is no clue in the docs) there is no way to do it out-of-the-box in a cloudformation template. Your best bet if you want to use CF is a Custom Resource, where you set the concurrency via a lambda using e.g. boto3's put_function_concurrency
method.
Some resources on Custom Reources: - http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html - http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/walkthrough-custom-resources-lambda-lookup-amiids.html - http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With