Upgrade Alexa Skill’s Lambda function runtime version from v10.x to v12.0 by using ask-cli v2

Now, ASK CLI(v2) will create a new Lambda Function that the runtime is nodejs10.x. But we can use nodejs12.x o […]

広告ここから
広告ここまで

目次

    Now, ASK CLI(v2) will create a new Lambda Function that the runtime is nodejs10.x. But we can use nodejs12.x on AWS lambda.

    How to check the runtime version?

    The runtime configuration is in ask-resources.json.

    % cat ask-resources.json | jq .
    {
      "askcliResourcesVersion": "2020-03-31",
      "profiles": {
        "default": {
          "skillMetadata": {
            "src": "./skill-package"
          },
          "code": {
            "default": {
              "src": "./lambda"
            }
          },
          "skillInfrastructure": {
            "userConfig": {
              "runtime": "nodejs10.x",
              "handler": "index.handler",
              "templatePath": "./infrastructure/cfn-deployer/skill-stack.yaml",
              "awsRegion": "us-east-1"
            },
            "type": "@ask-cli/cfn-deployer"
          }
        }
      }
    }
    
    // Just pick the runtime
    % cat ask-resources.json | jq .profiles.default.skillInfrastructure.userConfig.runtime
    "nodejs10.x"

    How to upgrade it?

    The answer is quite simply, just replace from nodejs10.x to nodejs12.x!

    {
      "askcliResourcesVersion": "2020-03-31",
      "profiles": {
        "default": {
          "skillMetadata": {
            "src": "./skill-package"
          },
          "code": {
            "default": {
              "src": "./lambda"
            }
          },
          "skillInfrastructure": {
            "userConfig": {
              "runtime": "nodejs12.x",
              "handler": "index.handler",
              "templatePath": "./infrastructure/cfn-deployer/skill-stack.yaml",
              "awsRegion": "us-east-1"
            },
            "type": "@ask-cli/cfn-deployer"
          }
        }
      }
    }

    広告ここから
    広告ここまで

    Random posts

    Home
    Search
    Bookmark