Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Metrics - Invalid AWS Serverless Application Model (SAM) example #1213

Closed
michaelbrewer opened this issue May 18, 2022 · 1 comment
Closed
Labels
documentation Improvements or additions to documentation

Comments

@michaelbrewer
Copy link
Contributor

michaelbrewer commented May 18, 2022

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.

Screen Shot 2022-05-17 at 6 23 19 PM

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

  1. Go to https://awslabs.github.io/aws-lambda-powertools-python/latest/core/metrics/#getting-started
  2. Copy template.yml example
  3. Run sam validate and cfn-lint

AWS Lambda Powertools for Python version

latest

AWS Lambda function runtime

3.9

Packaging format used

PyPi

Debugging logs

N/A
@michaelbrewer michaelbrewer added bug Something isn't working triage Pending triage from maintainers labels May 18, 2022
@michaelbrewer michaelbrewer changed the title Bug: TITLE Bug: Invalid AWS Serverless Application Model (SAM) example in Metrics May 18, 2022
@michaelbrewer michaelbrewer changed the title Bug: Invalid AWS Serverless Application Model (SAM) example in Metrics Bug: Metrics, Invalid AWS Serverless Application Model (SAM) example May 18, 2022
@michaelbrewer michaelbrewer changed the title Bug: Metrics, Invalid AWS Serverless Application Model (SAM) example Bug: Metrics - Invalid AWS Serverless Application Model (SAM) example May 18, 2022
@sthulb sthulb changed the title Bug: Metrics - Invalid AWS Serverless Application Model (SAM) example Docs: Metrics - Invalid AWS Serverless Application Model (SAM) example May 18, 2022
@heitorlessa heitorlessa added documentation Improvements or additions to documentation and removed bug Something isn't working labels May 20, 2022
@sthulb sthulb closed this as completed Jun 14, 2022
@github-actions
Copy link
Contributor

Comments on closed issues are hard for our team to see.

@heitorlessa heitorlessa removed the triage Pending triage from maintainers label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants