-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69b22ae
commit dfc6a84
Showing
31 changed files
with
6,697 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
# dependencies | ||
/node_modules/ | ||
|
||
# build | ||
/cdk.out/ | ||
|
||
# ide | ||
/.vscode | ||
.vscode | ||
/.idea/ | ||
|
||
# ignore files compiled from ts files - this assumes that ALL js files in these dirs were generated from ts | ||
*.d.ts | ||
/src/**/*.js | ||
/cdkStacks/**/*.js | ||
/bin/*.js | ||
|
||
# General | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Amazon Lex V2 Lambda Integration Examples | ||
|
||
## Introduction | ||
|
||
This folder contains examples of AWS Lambda functions for use with Amazon Lex v2 code hooks. | ||
|
||
|
||
## Prerequisites | ||
|
||
- AWS Account | ||
- [AWS IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html) with Administrator permissions | ||
- [Node](https://nodejs.org/) (v18) | ||
- [NPM](https://docs.npmjs.com/cli/v9/configuring-npm/install) (v9) | ||
- [AWS CLI v2](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) | ||
- [AWS CDK v2](https://docs.aws.amazon.com/cdk/v2/guide/cli.html) | ||
|
||
## Set-up | ||
```commandline | ||
cd projects/AmazonLexv2LambdaIntegrationExamples | ||
``` | ||
```commandline | ||
npm install | ||
npm run build | ||
``` | ||
|
||
If you have started with a new environment, please bootstrap CDK | ||
```commandline | ||
npm run cdk:bootstrap | ||
``` | ||
|
||
|
||
|
||
## Deploying | ||
|
||
To deploy **all** examples | ||
```commandline | ||
npm run cdk:deploy:all | ||
``` | ||
|
||
To deploy individual examples, use the specific instructions below: | ||
|
||
#### Basic pass-through lambda | ||
If you are just looking to get a basic template, or to do some experimenting and learning, this lambda will give you a place to start. | ||
|
||
See [README](src/basicPassthroughLexv2Lambda/README.md) for detailed information. | ||
|
||
```commandline | ||
npm run cdk:deploy:basiclambda | ||
``` | ||
|
||
#### Reminder Lex bot and Lambda function | ||
This bot shows a simple non-functional example of a Reminder bot showing example Lambda function integrations and conditional flows. | ||
It deploys both the Lex bot and the Lambda function and connects the Lambda function to the bot as part of deploy. | ||
|
||
See [README](src/reminderBotLex2Lambda/README.md) for detailed information. | ||
|
||
```commandline | ||
npm run cdk:deploy:reminderbot | ||
``` | ||
|
||
|
||
### Clean-up | ||
To remove **all** resources created as part of all stacks run the below: | ||
```commandline | ||
npm run cdk:destroy:all | ||
``` | ||
See individual READMEs for specific instructions to just remove individual Stacks. |
17 changes: 17 additions & 0 deletions
17
projects/AmazonLexv2LambdaIntegrationExamples/bin/cdk-lex-v2-lambda-integration-examples.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env node | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: MIT-0 | ||
|
||
import "source-map-support/register" | ||
import * as cdk from "aws-cdk-lib" | ||
import { AwsSolutionsChecks } from "cdk-nag" | ||
import { Aspects } from "aws-cdk-lib" | ||
|
||
import { BasicPassthroughLambdaCdkStack } from "../cdkStacks/basic-passthrough-lambda-stack" | ||
import { ReminderBotStack } from "../cdkStacks/reminder-bot-stack" | ||
|
||
const app = new cdk.App() | ||
Aspects.of(app).add(new AwsSolutionsChecks({ verbose: true })) | ||
|
||
new BasicPassthroughLambdaCdkStack(app, "BasicLexLambdaIntegration", {}) | ||
new ReminderBotStack(app, "ReminderBot", {}) |
7 changes: 7 additions & 0 deletions
7
projects/AmazonLexv2LambdaIntegrationExamples/bots/ReminderBotFiles/Manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"metaData": { | ||
"fileFormat": "LexJson", | ||
"resourceType": "BOT", | ||
"schemaVersion": "1" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
projects/AmazonLexv2LambdaIntegrationExamples/bots/ReminderBotFiles/ReminderBot/Bot.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "ReminderBot", | ||
"version": "DRAFT", | ||
"description": "Example reminder bot to demonstrate different lambda integration options.", | ||
"identifier": "", | ||
"dataPrivacy": { | ||
"childDirected": false | ||
}, | ||
"idleSessionTTLInSeconds": 300 | ||
} |
11 changes: 11 additions & 0 deletions
11
...mbdaIntegrationExamples/bots/ReminderBotFiles/ReminderBot/BotLocales/en_US/BotLocale.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "English (US)", | ||
"identifier": "en_US", | ||
"version": null, | ||
"description": null, | ||
"voiceSettings": { | ||
"engine": "neural", | ||
"voiceId": "Ivy" | ||
}, | ||
"nluConfidenceThreshold": 0.4 | ||
} |
Oops, something went wrong.