Giter Site home page Giter Site logo

amazon-lex-migration-utility's Introduction

Amazon Lex Migration Utility

Deprecation notice

2022-03-28

This project is no longer supported. AWS has announced Lex V2 with a new set of APIs and new functionality.

Purpose

The Amazon Lex Migration Utility allows you to easily migrate Amazon Lex Chatbots between accounts.

The Lex Migration Utility consists of a Python script that exports Lex definitions to an AWS CloudFormation template and three custom resources to create bots, Intents, and slots

Installation

Install the Serverless Application Model

Getting started with AWS SAM

Install AWS CloudFormation custom resources in the target account

sam build -t custom_resource_template.yml  
sam package --output-template-file custom-resources-sam-template.yml --resolve-s3
sam deploy --template-file custom-resources-sam-template.yml  --stack-name lex-custom-resources --capabilities "CAPABILITY_NAMED_IAM"

Usage

Create a configuration file

{
    "ResourceFilters":
    {
        "SlotTypes":["FlowerType","PickupDate","PickupTime"],
        "Intents":["OrderFlowers"],
        "Bots":["OrderFlowers"]
    },
    "Output":{
        "Filename": "order-flowers-template.json",
        "TemplateDescription":"Creates resources needed for the OrderFlowers Sample "
    }
}

ResourceFilters allow you to choose which bots, intents, and slots get exported. Any resources which contain the specified values as part of their name will be exported.

Output

    Filename the name of the exported template

    TemplateDescription Populates the Description field of the CloudFormation template

Export Lex definitions from the source account

Prerequisites

Python 3.x and Node 12.x

The Amazon Lex Migration Utility requires Python 3.x and Node 12.x

Configure the AWS CLI with a profile for the source account

The easiest method to export the definition is to create a named profile for the source_account:

aws configure --profile <source_account>

Install dependencies
pip install --requirements requirements.txt #installs dependencies.  This only needs to be run the first time.

Export resources

Then from the destination account:

python3 ./lex_exporter/create_lex_template.py --config-file <configuration file>  [--profile <source account>]

Deploy to the destination account

sam deploy --template-file <output template> --stack-name <stack name> --resolve-s3 --capabilities "CAPABILITY_NAMED_IAM"

Custom Resources created

Each custom resource wraps the corresponding API.

Sample configuration file and template

The sample configuration file and the order-flowers-template.json corresponds to the Amazon Lex bots created when you install Lex Web UI.

After installing Lex Web UI, you can export the LexBots by running:

python3 ./lex_exporter/create_lex_template.py --config-file ./lex_exporter/example-configuration.json

Known Issues

  • Deleting a stack with custom Lex resources does not always delete cleanly. If the custom resource returns a "Conflict Exception". Keep trying to delete the stack. The lex exporter scripts works around this by adding a DependsOn constraint to each resource to force CloudFormation to create and delete synchronously instead of in parallel.

Acknowledgements

The Lex bot, intent, and slot custom resources used by the Amazon Lex Migration Utility are slightly modified forks of work done by Andrew Templeton

amazon-lex-migration-utility's People

Contributors

karldthomas avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

karldthomas

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.