0
在AWS SDK版本1,我們可以從一個實例創建圖像下面的方法:如何使用AWS SDK爲Ruby創建圖片 - 第2版
ec2.images.create(:instance_id => "i-123", :name => "my-image")
如何,我們可以通過版本2處理呢?謝謝。
在AWS SDK版本1,我們可以從一個實例創建圖像下面的方法:如何使用AWS SDK爲Ruby創建圖片 - 第2版
ec2.images.create(:instance_id => "i-123", :name => "my-image")
如何,我們可以通過版本2處理呢?謝謝。
我剛剛得到了答案,這裏是例子:
ec2_instance.create_image({
dry_run: false,
name: "String", # required
description: "String",
no_reboot: false,
block_device_mappings: [
{
virtual_name: "String",
device_name: "String",
ebs: {
snapshot_id: "String",
volume_size: 1,
delete_on_termination: false,
volume_type: "standard", # accepts standard, io1, gp2, sc1, st1
iops: 1,
encrypted: false,
},
no_device: "String",
},
],
})