aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Validate Fails on AlexaSkillEvent

Open iph opened this issue 9 years ago • 3 comments

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

iph avatar Aug 11 '17 18:08 iph

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?

sanathkr avatar Aug 11 '17 19:08 sanathkr

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.

PaulMaddox avatar Aug 18 '17 06:08 PaulMaddox

Fixed in v0.2.0

sanathkr avatar Aug 20 '17 06:08 sanathkr