aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.5k stars 1.17k forks source link

Validate Fails on AlexaSkillEvent #15

Closed iph closed 7 years ago

iph commented 7 years ago

Repro:

git clone https://github.com/awslabs/serverless-application-model.git
cd serverless-application-model/examples/2016-10-31/alexa_skill
aws-sam-local validate template.yaml

File contents:

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Alexa Skill https://developer.amazon.com/alexa-skills-kit
Resources:
  AlexaSkillFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: s3://<bucket>/alexa_skill.zip
      Handler: index.handler
      Runtime: nodejs4.3
      Events:
        AlexaSkillEvent:
          Type: AlexaSkill

output:

ERROR: Resource "AlexaSkillFunction", property "Events": Inner property Properties is required (line: 12; col: 8)

expected output: Success

sanathkr commented 7 years ago

You're right. Test checked into this repository has been modified to include Properties - template.yaml#L15. This needs to be fixed.

@iph Can you send a PR?

PaulMaddox commented 7 years ago

We're rewriting some of the library we use for CloudFormation/SAM parsing (github.com/awslabs/goformation) to make it more resilient against issues like this.

I can confirm this bug is fixed in the 0.1.0 branch of goformation, however we've got a bit more work to do before we can start using it in SAM Local. Shouldn't be much longer.

sanathkr commented 7 years ago

Fixed in v0.2.0