Closed
Description
Expected Behaviour
AWS Serverless Application Model (SAM) template.yaml should be valid without errors
Current Behaviour
Current example has missing attributes and generates the following errors.
Code snippet
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: python3.8
Environment:
Variables:
POWERTOOLS_SERVICE_NAME: payment
POWERTOOLS_METRICS_NAMESPACE: ServerlessAirline
Possible Solution
Template yaml should be, like in PR #1122 , deployed example is here https://gyft.github.io/aws-lambda-powertools-python/latest/core/metrics/#getting-started
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: src/
Handler: app.lambda_handler
Runtime: python3.9
Environment:
Variables:
POWERTOOLS_SERVICE_NAME: payment
POWERTOOLS_METRICS_NAMESPACE: ServerlessAirline
Steps to Reproduce
- Go to https://awslabs.github.io/aws-lambda-powertools-python/latest/core/metrics/#getting-started
- Copy
template.yml
example - Run
sam validate
andcfn-lint
AWS Lambda Powertools for Python version
latest
AWS Lambda function runtime
3.9
Packaging format used
PyPi
Debugging logs
N/A