Code Monkey home page Code Monkey logo

serverless-bot-framework's Introduction

Serverless Bot Framework

The Serverless Bot Framework is a collection of AWS services combined into a single solution that any company can use to have a scalable and high-available multi-language audiobot, chatbot and touch interface with their customers.

On this Page

Architecture Overview

Architecture

AWS CDK Constructs

AWS CDK Solutions Constructs make it easier to consistently create well-architected applications. All AWS Solutions Constructs are reviewed by AWS and use best practices established by the AWS Well-Architected Framework. This solution uses the following AWS CDK Constructs:

  • aws-cognito-apigateway-lambda.
  • aws-lambda-dynamodb.
  • aws-cloudfront-s3
  • aws-s3-lambda
  • aws-lambda-s3.

Deployment

The solution is deployed using a CloudFormation template with a lambda backed custom resource. For details on deploying the solution please see the details on the solution home page: Serverless Bot Framework

Source Code

source/infrastructure Includes AWS CDK code describing the architecture of the solution. This CDK code will be transpiled into Cloudformation template when running build-s3-dist.sh.

source/samples Includes three components, a lambda function that integrates with Amazon Lex, a custom resource, and a front-end web client. This code can be extended to add different functionalities to the bot.

source/services Includes source code for three lambda functions, core, lex-bot, webclient-setup, and polly-service.

source/services/solution-helper A Python Lambda function used as a CloudFormation custom resource for configuring Amazon S3 bucket notifications and to send anonymous metrics.

Creating a custom build

The solution can be deployed through the CloudFormation template available on the solution home page: Serverless Bot Framework. To make changes to the solution, download or clone this repo, update the source code and then run the deployment/build-s3-dist.sh script to deploy the updated Lambda code to an Amazon S3 bucket in your account.

Prerequisites:

1. Create the deployment packages

Build the distributable:

ARTIFACT_BUCKET=my-bucket-name     # S3 bucket name where customized code will reside
SOLUTION_NAME=my-solution-name     # customized solution name
VERSION=my-version                 # version number for the customized code

cd ./deployment
chmod +x ./build-s3-dist.sh
./build-s3-dist.sh $ARTIFACT_BUCKET $SOLUTION_NAME $VERSION

Notes: The build-s3-dist script expects the bucket name as one of its parameters, and this value should not include the region suffix. In addition to that, the version parameter will be used to tag the npm packages, and therefore should be in the Semantic Versioning format.

2. Create Amazon S3 Buckets

The CloudFormation template is configured to pull the Lambda deployment packages from Amazon S3 buckets in the region the template is being launched in. You need to create two buckets in the desired region. The names of the buckets should be $ARTIFACT_BUCKET and $ARTIFACT_BUCKET-<region-name>. For example, the following will create two buckets in the us-east-1 region.

aws s3 mb s3://$ARTIFACT_BUCKET --region us-east-1
aws s3 mb s3://$ARTIFACT_BUCKET-us-east-1 --region us-east-1

Deploy the distributable to the Amazon S3 bucket in your account:

aws s3 sync ./global-s3-assets s3://$ARTIFACT_BUCKET/$SOLUTION_NAME/$VERSION --acl bucket-owner-full-control
aws s3 sync ./regional-s3-assets s3://$ARTIFACT_BUCKET-us-east-1/$SOLUTION_NAME/$VERSION --acl bucket-owner-full-control

3. Launch the CloudFormation template.

  • Get the link of the serverless-bot-framework.template uploaded to your Amazon S3 bucket.
  • Deploy the serverless bot framework to your account by launching a new AWS CloudFormation stack using the link of the serverless-bot-framework.template.

Known Behavior

When using the 'Leave Feedback' intent, the bot only accepts one-word feedback.

Collection of operational metrics

This solution collects anonymous operational metrics to help AWS improve the quality of features of the solution. For more information, including how to disable this capability, please see the implementation guide.


Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.removed api and email

serverless-bot-framework's People

Contributors

aassadza avatar dependabot[bot] avatar dreamorosi avatar dscpinheiro avatar jpeddicord avatar shsenior avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

serverless-bot-framework's Issues

SampleWebclientPackage typo

I believe that there's a typo in serverless-bot-framework/deployment/serverless-bot-framework.template, line 1308.

should be:
"SampleWebclientPackage": { "Fn::Join": [ "", ["https://s3.", { "Ref": "AWS::Region" }, ".amazonaws.com/", "%%BUCKET_NAME%%", "-", { "Ref": "AWS::Region" }, "/serverless-bot-framework/%%VERSION%%/sample-webclient.zip" ] ] },

instead of:
"SampleWebclientPackage": { "Fn::Join": [ "", ["https://s3-", { "Ref": "AWS::Region" }, ".amazonaws.com/", "%%BUCKET_NAME%%", "-", { "Ref": "AWS::Region" }, "/serverless-bot-framework/%%VERSION%%/sample-webclient.zip" ] ] },

Support Japanese Language

Is your feature request related to a problem? Please describe.

No Japanese language supported.

Describe the feature you'd like

Japanese is now supported in Lex. So, I am very happy if the Serverless Bot Framework also supports it.

Additional context

Add any other context or screenshots about the feature request here.

sed usage bug

As specified on https://linux.die.net/man/1/sed , there isn't supposed to be a space between the -i option and its argument. The sed in msys2 complains

sed: can't read : No such file or directory

as it assumes anything that isn't prefixed by an option is a filename. Presumably the author's sed behaves differently, which is actually a fairly dangerous unix api bug, but is harmless here, since sed merely complains but doesn't do anything differently.

Tests failing due to missing "moduleFileExtensions": ["js"]

A clear and concise description of what the bug is.

Details:

/home/ec2-user/environment/serverless-bot-framework/source/infrastructure/test/corelambda-construct.test.ts:13
import { SynthUtils } from '@aws-cdk/assert';
       ^

SyntaxError: Unexpected token {

  at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1350:14)

FAIL test/cognito-api-lambdas-construct.test.ts
โ— Test suite failed to run

Jest encountered an unexpected token

Steps to reproduce the behavior

  1. Step One: clone repo into a fresh cloud9 environment
  2. Step Two: run the tests shell script
  3. [...]

Expected Result

A clear and concise description of what you expected to happen.
Exptected tests to pass

Actual Result

A description of what is the result and/or error messages you got when you faced this issue.
Test Suites: 10 failed, 10 passed, 20 total

Other information:

  1. Version of the Solution (e.g., v1.1.0):

    To get the version of the solution, you can look at the description of the created CloudFormation stack. For example, "(SO0027) AWS Serverless Bot Framework v1.2.0 - This AWS CloudFormation template helps you provision the AWS Serverless Bot Framework stack without worrying about creating and configuring the underlying AWS infrastructure". If the description does not contain the version information, you can look at the mappings section of the template:

Mappings:
  Solution:
    Data:
      ID: SO0027
      Version: 'v1.2.0'
  1. Region where CloudFormation template is deployed (e.g., us-east-1):
  2. Did you make any change in the source code? If yes, what are the relevant changes (if publicly available)?:
  3. Troubleshooting steps attempted:
  4. Were there any errors in the Cloudwatch logs?:
  5. Screenshots (please DO NOT include sensitive information):
  6. Did you use the Sample Weather Service (please DO NOT include API KEY) ? Yes / No

Stack Parameters

Cloudformation Stack Parameters (please DO NOT include sensitive information like S3 bucket name, IP address, credentials, etc):

  1. Bot Name:
  2. Bot Language:
  3. Bot Gender:

Additional context

Add any other context about the problem here.

what I need to do next and how to use the Lambda package?

I have executed the './build-s3-dist.sh bucket-base-name v1.0' command successfully and the Lambda package is also built successfully on my server. But I still don't know what I need to do next and how to use the Lambda package. Besides, after executing the command, there isn't anything in my bucket. Thanks.

Hi guys! Trying to add a new lambda function but failed

Hi guys!

Managed to get the Serverless bot framework up and running, i will like to add in new lambda functions but keeps getting stuck executing commands to the new lambda functions

What i did so far:

  1. i edited the knowledge.json file with new lambda function configurations
  2. create a lambda function similar to the 2 other lambda (password reset + weather checks)

what are the missing steps i didn't cover?
Please help to enlightened me, thanks folks! Cheers

Regards,
ak86

Usage of Lex

This is not really an issue but it is an enquiry. Various places it is mentioned that it uses Lex. But, in the architecture diagram or checking the services the stack installed, Lex is no where seen. I do understand that the solution does Natural Language Processing (NLP). How is it doing NLP if Lex is not in use?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.