StartMigrationCommand

Starts migrating a bot from Amazon Lex V1 to Amazon Lex V2. Migrate your bot when you want to take advantage of the new features of Amazon Lex V2.

For more information, see Migrating a bot  in the Amazon Lex developer guide.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { LexModelBuildingServiceClient, StartMigrationCommand } from "@aws-sdk/client-lex-model-building-service"; // ES Modules import
// const { LexModelBuildingServiceClient, StartMigrationCommand } = require("@aws-sdk/client-lex-model-building-service"); // CommonJS import
const client = new LexModelBuildingServiceClient(config);
const input = { // StartMigrationRequest
  v1BotName: "STRING_VALUE", // required
  v1BotVersion: "STRING_VALUE", // required
  v2BotName: "STRING_VALUE", // required
  v2BotRole: "STRING_VALUE", // required
  migrationStrategy: "CREATE_NEW" || "UPDATE_EXISTING", // required
};
const command = new StartMigrationCommand(input);
const response = await client.send(command);
// { // StartMigrationResponse
//   v1BotName: "STRING_VALUE",
//   v1BotVersion: "STRING_VALUE",
//   v1BotLocale: "de-DE" || "en-AU" || "en-GB" || "en-IN" || "en-US" || "es-419" || "es-ES" || "es-US" || "fr-FR" || "fr-CA" || "it-IT" || "ja-JP" || "ko-KR",
//   v2BotId: "STRING_VALUE",
//   v2BotRole: "STRING_VALUE",
//   migrationId: "STRING_VALUE",
//   migrationStrategy: "CREATE_NEW" || "UPDATE_EXISTING",
//   migrationTimestamp: new Date("TIMESTAMP"),
// };

StartMigrationCommand Input

See StartMigrationCommandInput for more details

Parameter
Type
Description
migrationStrategy
Required
MigrationStrategy | undefined

The strategy used to conduct the migration.

  • CREATE_NEW - Creates a new Amazon Lex V2 bot and migrates the Amazon Lex V1 bot to the new bot.

  • UPDATE_EXISTING - Overwrites the existing Amazon Lex V2 bot metadata and the locale being migrated. It doesn't change any other locales in the Amazon Lex V2 bot. If the locale doesn't exist, a new locale is created in the Amazon Lex V2 bot.

v1BotName
Required
string | undefined

The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex V2.

v1BotVersion
Required
string | undefined

The version of the bot to migrate to Amazon Lex V2. You can migrate the $LATEST version as well as any numbered version.

v2BotName
Required
string | undefined

The name of the Amazon Lex V2 bot that you are migrating the Amazon Lex V1 bot to.

  • If the Amazon Lex V2 bot doesn't exist, you must use the CREATE_NEW migration strategy.

  • If the Amazon Lex V2 bot exists, you must use the UPDATE_EXISTING migration strategy to change the contents of the Amazon Lex V2 bot.

v2BotRole
Required
string | undefined

The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.

StartMigrationCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
migrationId
string | undefined

The unique identifier that Amazon Lex assigned to the migration.

migrationStrategy
MigrationStrategy | undefined

The strategy used to conduct the migration.

migrationTimestamp
Date | undefined

The date and time that the migration started.

v1BotLocale
Locale | undefined

The locale used for the Amazon Lex V1 bot.

v1BotName
string | undefined

The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex V2.

v1BotVersion
string | undefined

The version of the bot to migrate to Amazon Lex V2.

v2BotId
string | undefined

The unique identifier for the Amazon Lex V2 bot.

v2BotRole
string | undefined

The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.

Throws

Name
Fault
Details
AccessDeniedException
client

Your IAM user or role does not have permission to call the Amazon Lex V2 APIs required to migrate your bot.

BadRequestException
client

The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and try again.

InternalFailureException
server

An internal Amazon Lex error occurred. Try your request again.

LimitExceededException
client

The request exceeded a limit. Try your request again.

NotFoundException
client

The resource specified in the request was not found. Check the resource and try again.

LexModelBuildingServiceServiceException
Base exception class for all service exceptions from LexModelBuildingService service.