Skip to content

Instantly share code, notes, and snippets.

@jsonw23
Last active June 24, 2020 03:13
Show Gist options
  • Select an option

  • Save jsonw23/b194ce9606f9c6addbec4c5a54a9a256 to your computer and use it in GitHub Desktop.

Select an option

Save jsonw23/b194ce9606f9c6addbec4c5a54a9a256 to your computer and use it in GitHub Desktop.
Add deployment stage as an environment variable
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: hello_world/
Handler: app.lambda_handler
Runtime: python3.8
Environment:
Variables:
# add a variable with the value of the DeploymentStage template parameter
STAGE: !Ref DeploymentStage
TABLE_NAME: !Ref MyTable
Policies:
- DynamoDBReadPolicy
TableName: !Ref MyTable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment