jovotech / jovo-templates

💬 Code Patterns and Templates for Jovo Voice Apps
https://www.jovo.tech
Apache License 2.0
27 stars 30 forks source link

Add template that uses the Serverless framework for deployment #20

Open jankoenig opened 5 years ago

jankoenig commented 5 years ago

Including creating the right permissions, lambda, and DynamoDB for e.g. AWS

https://serverless.com/

shouxian92 commented 5 years ago

Hi @jankoenig i'm interested to pick up this issue

jankoenig commented 5 years ago

Cool! Let me know if you need more info. I started playing with it a few months ago. Here's part of the serverless.yml (I commented out some things and am not sure if everything works):

service: jovo-project-name  # Update

custom:
  defaultStage: dev
  currentStage: ${opt:stage, self:custom.defaultStage}

provider:
  name: aws
  runtime: nodejs8.10
  stage: ${self:custom.currentStage}
  # iamRoleStatements:
  #   - Effect: "Allow"
  #     Action:
  #     - dynamodb: GetItem
  #     - dynamodb: PutItem
  #     - dynamodb: CreateTable
  #     Resource: "arn:aws:dynamodb:*:*:table/*"

# Define service wide environment variables here
# environment:
#   STAGE: ${self:custom.currentStage}

package:
 include:
   - index.js
   - app/**
 exclude:
   - platforms/**
   - models/**

functions:
  app:
    handler: index.handler
    events:
      # - alexaSkill: ${file(./app.json):stages.${self:custom.currentStage}.alexaSkill.skillId}

      # API Gateway
      # - http:
      #     method: post

    # Define function environment variables here
    environment:
      STAGE: ${self:custom.currentStage}
shouxian92 commented 5 years ago

Thanks @jankoenig i was looking at how to setup the example projects in my free time within the past few days. It seems like the setup is not as straightforward as i thought, i might need some time to get some template files working with my own AWS account (need to get some free time to do so). If anyone with experience with this framework would like to go ahead and implement this ahead of me then i would encourage them to do so instead

Caoimhin89 commented 4 years ago

This is a really interesting proposal. Has any progress been made on this? I'd definitely be happy to contribute.

jankoenig commented 4 years ago

No one has contributed yet, but I know that a few people are using Serverless for Jovo projects. e.g. @dominik-meissner