I am learning aws SAM Cli. I created a project for a lambda function. I want to be able to pass a parameter to this cloudformation template that my python code can read and use when the lambda function executes. how/where do I indicate this in my cloudformation template file below. such that, either i can specify a default value for that parameter or override it when i create the stack from my template.
template.yaml -
AWSTemplateFormatVersion: '2010-09-09'
Description: Lambda SAM Template
Globals:
Function:
Timeout: 60
Resources:
mysamplefunction:
Properties:
CodeUri: s3://some-bucket/qhfqep238974384y
Description: some app
FunctionName: mysamplefunction
Handler: main.lambda_handler
Role: arn:aws:iam::0949928960903:role/LambdaRole
Runtime: python3.7
Type: AWS::Serverless::Function
...
main.py
def lambda_handler(event, context):
print('parameter passed to cloud formation template');