aws:createImage – 建立 Amazon Machine Image - AWS Systems Manager

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

aws:createImage – 建立 Amazon Machine Image

從正在執行、正在停止或已停止的執行個體建立 Amazon Machine Image (AMI)。

Input

此動作支援下列 CreateImage 參數。如需詳細資訊,請參閱 CreateImage

YAML
name: createMyImage action: aws:createImage maxAttempts: 3 onFailure: Abort inputs: InstanceId: i-1234567890abcdef0 ImageName: AMI Created on{{global:DATE_TIME}} NoReboot: true ImageDescription: My newly created AMI
JSON
{ "name": "createMyImage", "action": "aws:createImage", "maxAttempts": 3, "onFailure": "Abort", "inputs": { "InstanceId": "i-1234567890abcdef0", "ImageName": "AMI Created on{{global:DATE_TIME}}", "NoReboot": true, "ImageDescription": "My newly created AMI" } }
InstanceId

執行個體的 ID。

類型:字串

必要:是

ImageName

映像的名稱。

類型:字串

必要:是

ImageDescription

映像的描述。

類型:字串

必要:否

NoReboot

布林值常值。

根據預設,Amazon Elastic Compute Cloud (Amazon EC2) 會在建立映像之前嘗試關閉並重新開機執行個體。若 No Reboot (不重新啟動) 選項設為 true,則 Amazon EC2 在建立映像之前不會關閉執行個體。使用此選項時,無法保證所建立映像的檔案系統完整性。

如果您不希望執行個體在您從其建立 AMI 映像後執行,首先請使用 aws:changeInstanceState – 變更或宣告執行個體狀態 動作停止執行個體,接著使用 aws:createImage 動作並將 NoReboot 選項設為 true

類型:布林值

必要:否

BlockDeviceMappings

執行個體的區塊型儲存設備。

類型:映射

必要:否

輸出
ImageId

新建立映像的 ID。

類型:字串

ImageState

映像目前的狀態。如果狀態可用,則表示已成功註冊映像,且該映像可以用來啟動執行個體。

類型:字串