

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 從 Lex V2 匯出機器人
<a name="export"></a>

您可以使用 主控台或 `CreatExport`操作匯出機器人、機器人地區設定或自訂詞彙。您可以指定要匯出的資源，並提供選用的密碼，以協助在啟動匯出時保護 .zip 檔案。下載 .zip 檔案之後，您必須使用密碼來存取檔案，才能使用它。如需詳細資訊，請參閱[匯入或匯出時使用密碼](import-export-password.md)。

匯出是非同步操作。開始匯出後，您可以使用 主控台或 `DescribeExport`操作來監控匯出的進度。匯出完成後， 主控台或 `DescribeExport`操作會顯示 狀態`COMPLETED`，而 主控台會將匯出的 .zip 檔案下載至您的瀏覽器。如果您使用 `DescribeExport`操作，Amazon Lex V2 會提供預先簽章的 Amazon S3 URL，您可以在其中下載匯出結果。下載 URL 只能使用五分鐘，但您可以透過再次呼叫 `DescribeExport`操作來取得新的 URL。

您可以使用 主控台或 `ListExports`操作查看資源的匯出歷史記錄。結果會顯示匯出及其目前狀態。匯出可在歷史記錄中使用七天。

當您匯出機器人`Draft`版本或機器人地區設定時，JSON 檔案中的定義可能會處於不一致的狀態，因為機器人`Draft`版本或機器人地區設定可以在匯出進行時變更。如果在匯出時變更`Draft`版本，則變更可能不會包含在匯出檔案中。

匯出機器人地區設定時，Amazon Lex 會匯出定義地區設定的所有資訊，包括地區設定、自訂詞彙、意圖、槽類型和槽。

匯出機器人時，Amazon Lex 會匯出為機器人定義的所有地區設定，包括意圖、槽類型和槽。下列項目不會使用機器人匯出：
+ 機器人別名
+ 與機器人相關聯的角色 ARN
+ 與機器人和機器人別名相關聯的標籤
+ 與機器人別名相關聯的 Lambda 程式碼掛鉤

當您匯入機器人時，角色 ARN 和標籤會輸入為請求參數。您需要建立機器人別名，並視需要在匯入後指派 Lambda 程式碼掛鉤。

您可以使用 主控台或 `DeleteExport`操作來移除匯出和相關聯的 .zip 檔案。

如需使用主控台匯出機器人的範例，請參閱 [匯出 Lex V2 機器人 （主控台）](export-console.md)。

## 在 Lex V2 中匯出機器人所需的 IAM 許可
<a name="export-permissions"></a>

若要匯出機器人、機器人地區設定和自訂詞彙，執行匯出的使用者必須具有下列 IAM 許可。


| API |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/lexv2/latest/dg/export.html) | 資源 | 
| --- | --- | --- | 
| [CreateExport](https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateExport.html) | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/lexv2/latest/dg/export.html) | 機器人 | 
| [UpdateExport](https://docs.aws.amazon.com/lexv2/latest/APIReference/API_UpdateExport.html) | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/lexv2/latest/dg/export.html) | 機器人 | 
| [DescribeExport](https://docs.aws.amazon.com/lexv2/latest/APIReference/API_DescribeExport.html) | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/lexv2/latest/dg/export.html) | 機器人 | 
| 自訂詞彙的 [DescribeExport](https://docs.aws.amazon.com/lexv2/latest/APIReference/API_DescribeExport.html)  | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/lexv2/latest/dg/export.html)  | 機器人 | 
| [DeleteExport](https://docs.aws.amazon.com/lexv2/latest/APIReference/API_DeleteExport.html) | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/lexv2/latest/dg/export.html) | 機器人 | 
| [ListExports](https://docs.aws.amazon.com/lexv2/latest/APIReference/API_ListExports.html) | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/lexv2/latest/dg/export.html) | \$1 | 

如需 IAM 政策範例，請參閱 [允許使用者匯出機器人和機器人地區設定](security_iam_id-based-policy-examples.md#security_iam_id-based-policy-examples-export)。