-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[proposal] Add support for timeout, memory size, and tagging on Lambda functions #347
Comments
In general I like the feature. Couple of comments:
|
I'm fine with the not allowing the In terms of I like the
|
The implementation has now been merged. Closing out issue. |
Is the usage of the timeout feature documented somewhere? I couldn't fine it by searching https://chalice.readthedocs.io/en/latest/search.html?q=timeout I still get timeout after 60 seconds with this is my (more or less) config.json file:
Any idea what could be the cause? |
Abstract
Add support for various granular configuration options in the chalice
config.json
. This will entail addingtimeout
,memory_size
, andtags
to the ``config.json` to support respectively the timeout of a lambda function, the memory size of a lambda function, and the tags on a lambda function.Motivation
The feature has been requested in the following issues:
Specifically, users would want to configure:
Timeout:
code to run to cut down costs if the execution is running longer than it should be.
60
. Some users may want their lambda function to be able to ran longerthan 60 seconds.
Memory Size:
that value.
a user may want to increase memory size to increase the amount of CPU allocated.
Tags:
Interface
config.json
The following keys will be allowed in the
config.json
timeout
: This is an integer representing the timeout in seconds for a lambda function. The default currently is60
.memory_size
: This is an integer representing the amount of memory given to the lambda function in MB. The default currently is128
.tags
: This is a map who's key is the tag name and the value is tag valueThese values will be able to vary globally and per stage. These values will be plumbed into both non-SAM and SAM methods of deployment. Here are some examples of how this will look in the
config.json
:Globally
This will make sure for all lambda function the values will be:
Stage
This will make sure that for only the
dev
stage the values will be (all other stages will fallback to the default):Then you can override/merge global values through stages. Given:
The values for the lambda functions in the
dev
stage would be:Specifics on tags
Tags on a lambda function can be specified on the
CreateFunction
call, but they cannot be specified in theUpdateFunctionConfiguration
call. So for non-SAM deployments, a call will need to be made toListTags
to get all of the tags, add any tags missing from or different in theconfig.json
withTagResource
, and remove any tags in the list of tags but not in theconfig.json
withUntagResource
.In terms of the default
aws-chalice
tag, it will always be included even if the user supplies their own tags. If a user tries to override the tag, it will use the user's provided tag.Rationale
Q: Why have memory_size and timeout specified on the same level of all the other configurations instead of in a "lambda_config" dictionary?
It would be awkward to isolate the
memory_size
andtimeout
to alambda_config
when there is already information likeenvironment_variables
that do not live in alambda_config
dictionary in theconfig.json
but are purely related to the lambda configuration.Q: Why allow users to override aws-chalice tag?
It is because the tag space is typically considered the user's space; they should have the right to override if they want to. It is a bad user experience to prevent users from clobbering the value as customer's could easily just use the API directly to update the tags, which at that point makes the process cumbersome.
The text was updated successfully, but these errors were encountered: