alexa-samples / skill-sample-nodejs-fact

Build An Alexa Fact Skill
Apache License 2.0
1.14k stars 1.19k forks source link

Template specifies deprecated Runtime 10.x #146

Closed nishantcasey closed 1 year ago

nishantcasey commented 2 years ago

When attempting to deploy this using Lambda Application based SAM deploy, the CloudFormation stack errors out with the following error:

"The runtime parameter of nodejs10.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs14.x) while creating or updating functions."

Workaround

  1. Copied the SAM template provided as part of the application.
  2. Modified Runtime -> Runtime: nodejs14.x
  3. Deployed SAM Application

The deployment worked & I was able to test the function with the 'Alexa Start Session' test event.

Can the application please be updated at the SAM side to modify the template in this way?

sjdee commented 2 years ago

Hi mate, I was trying to run the template and was having the same issue - can you share the steps you followed to set up the stack in nodejs14.x? It'd be a great help as I'm still getting into this space. Cheers

Did you use the template below and how did you deploy it? AWSTemplateFormatVersion: '2010-09-09' Metadata: Name: alexa-skills-kit-nodejs-factskill Transform: AWS::Serverless-2016-10-31 Resources: alexaskillskitnodejsfactskill: Type: AWS::Serverless::Function Properties: Handler: index.handler Description: Demonstrate a basic fact skill built with the ASK NodeJS SDK Timeout: 7 CodeUri: Bucket: <%REPO_BUCKET%> Key: 99fe9bf4-738d-40d5-9e0b-9bffaec8b930 Runtime: nodejs10.x MemorySize: 128 Events: AlexaTrigger: Type: AlexaSkill Description: Demonstrate a basic fact skill built with the ASK NodeJS SDK

nishantcasey commented 2 years ago

Hi mate, I was trying to run the template and was having the same issue - can you share the steps you followed to set up the stack in nodejs14.x? It'd be a great help as I'm still getting into this space. Cheers

Did you use the template below and how did you deploy it?

The steps were as follows:

  1. Publish a new Private SAM application in Serverless Application Repository.
  2. Go back to the Lambda console and select the newly created application (Should appear in the ‘Private Applications’ tab when you choose ‘Browse Serverless app repository’
  3. Once deployed, I was able to test the function in the console using the ‘Alexa Skills Start Session’ test event
Metadata:
  Name: alexa-skills-kit-nodejs-factskill
Transform: AWS::Serverless-2016-10-31
Resources:
  alexaskillskitnodejsfactskill:
    Type: AWS::Serverless::Function
    Properties:
      Handler: index.handler
      Description: Demonstrate a basic fact skill built with the ASK NodeJS SDK
      Timeout: 7
      CodeUri:
        Bucket: <<< Replace this with the bucket from your failed stack deployment >>>
        Key: <<< Replace this with the key from your failed stack deployment >>>
      Runtime: nodejs14.x
      MemorySize: 128
      Events:
        AlexaTrigger:
          Type: AlexaSkill
Description: Demonstrate a basic fact skill built with the ASK NodeJS SDK

Looking at your key, it seems you are missing the full arn.. It should be [your-account-id]/arn:aws:serverlessrepo:us-[your-region]:[your-account-id]:applications-AlexaSkillsNode14-versions-1.0.0/[your-uuid]

Hope that works for you too!

Keshavdulal commented 2 years ago

Coming from a 2018 tutorial, the above solution worked!

aszk commented 1 year ago

We have updated the serverless app. You should be able to deploy it.