require 'aws-sdk'
AWS_KEY = {
:aws_access_key_id => "*************",
:aws_secret_access_key => "*************",
}
ec2 = AWS::EC2.new(
:access_key_id => AWS_KEY[:aws_access_key_id],
:secret_access_key => AWS_KEY[:aws_secret_access_key])
instance = ec2.instances['i-********']
puts instance.tags['Name']
image = ec2.images.create(
:instance_id => 'i-********',
:name => 'test-volume-ami',
:block_device_mappings => {:'/dev/sda' => {:snapshot_id => 'snap-********'}})
这是段测试代码,我感觉是我 block_device_mappings 这个参数写错了,但是苦于网上找不到详细的文档,试了几次都不行,大家帮我看下是哪里出了问题