aws / aws/chalice

Add option to extract lambda env vars to cloudformation parameters

Open
#608 3 comments 4 reactions 1 assignee Claimed by @kyleknap View on GitHub
feature-request
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

When you run `chalice package`, it would be really helpful if we could take the lambda environment variables you have in your config file and map them to template parameters. That way you can override these values when you deploy but still reuse the same SAM template. They'd still default to the existing values in the `.chalice/configjson`. I'd prefer this was an additional flag you can specify.

The only thing I've ran into is that we'd need to transform the env vars to something supported by cloudformation. The typical format of `UPPER_SNAKE_CASE` for env vars won't work for parameter key names. We could just camel case them so you'd get `UPPER_SNAKE_CASE` -> `UpperSnakeCase`.

## Use Case

If you're deploying to multiple stages (say a test stage and a prod stage) one option is to run the package command twice, once for each stage. These should produce identical artifacts with the exception of stage specific configuration.

However, you're still relying on the guarantees of the `chalice package` command. With this feature, you'd be able to rely on the fact that you are deploying the *exact* same SAM template with the exception of different input CFN parameters.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.