Adding environment variables to Lambda function resource using SAM
An example of how to add Lambda function in template.yaml of your SAM configuration
YourLambdaFunction:
Type: AWS::Serverless::Function
Properties:
Description: Description of your function
Runtime: nodejs16.x
Environment:
Variables:
VAR_1: my_value
NODE_ENV: production
SOME_DYNAMIC_VAR: !Select [1, !Split ['/', !GetAtt YourDynamoDBTable.Arn]]
Architectures:
- x86_64
Handler: index.handler
MemorySize: 128
Timeout: 100PreviousSchema to create Lambda function resource using SAMNextAdding a scheduled timer to start Lambda function resource using SAM
Last updated