Importing - Amazon Lex

Importing

To use the console to import a previously exported bot, bot locale or custom vocabulary, you provide the file location on your local computer and the optional password to unlock the file. For an example, see Importing a bot (console).

When you use the API, importing a resource is a three step process:

  1. Create an upload URL using the CreateUploadUrl operation. You don't need to create an upload URL when you are using the console.

  2. Upload the .zip file that contains the resource definition.

  3. Start the import with the StartImport operation.

The upload URL is a pre-signed Amazon S3 URL with write permission. The URL is available for five minutes after it is generated. If you password protect the .zip file, you must provide the password when you start the import. For more information, see Using a password when importing or exporting.

An import is an asynchronous process. You can monitor the progress of an import using the console or the DescribeImport operation.

When you import a bot or bot locale, there may be conflicts between resource names in the import file and existing resource names in Amazon Lex V2. Amazon Lex V2 can handle the conflict in three ways:

  • Fail on conflict – The import stops and no resources are imported from the import .zip file.

  • Overwrite – Amazon Lex V2 imports all of the resources from the import .zip file and replaces any existing resource with the definition from the import file.

  • Append – Amazon Lex V2 imports all of the resources from the import .zip file and adds to any existing resource with the definition from the import file. This is available only for the bot locale.

You can see a list of the imports to a resource using the console or the ListImports operation. Imports remain in the list for seven days. You can use the console or the DescribeImport operation to see details about a specific import.

You can also remove an import and the associated .zip file using the console or the DeleteImport operation.

For an example of importing a bot using the console, see Importing a bot (console).

IAM permissions required to import

To import bots, bot locales, and custom vocabularies, the user running the import must have the following IAM permissions.

API Required IAM actions Resource
CreateUploadUrl
  • CreateUploadUrl

*
StartImport for bot and bot locale
  • StartImport

  • iam:PassRole

  • CreateBot

  • CreateCustomVocabulary

  • CreateLocale

  • CreateIntent

  • CreateSlot

  • CreateSlotType

  • UpdateBot

  • UpdateCustomVocabulary

  • UpdateLocale

  • UpdateIntent

  • UpdateSlot

  • UpdateSlotType

  • DeleteBot

  • DeleteCustomVocabulary

  • DeleteLocale

  • DeleteIntent

  • DeleteSlot

  • DeleteSlotType

  1. To import a new bot: bot, bot alias.

  2. To overwrite an existing bot: bot.

  3. To import a new locale: bot.

StartImport for custom vocabularies
  • StartImport

  • CreateCustomVocabulary

  • DeleteCustomVocabulary

  • UpdateCustomVocabulary

bot
DescribeImport
  • DescribeImport

Bot
DeleteImport
  • DeleteImport

Bot
ListImports
  • ListImports

*

For an example IAM policy, see Allow a user to import bots and bot locales .