how to set block-device-mappings during aws ec2 run-instances?

纵然是瞬间 提交于 2020-07-22 07:39:05

问题


sof,

how to set block-device-mappings during aws ec2 run-instances?

I am new to awscli.

I pip installed it into my python env.

I got this example to work ok:

aws ec2 run-instances --image-id ami-d2c924b2 --instance-type m4.large

How to enhance the above shell command so I launch with more disk space?

I tried this syntax and it failed:

aws ec2 run-instances --image-id ami-d2c924b2 --instance-type m4.large --block-device-mappings {"DeviceName":"/dev/sda1","Ebs":{"VolumeSize":100}}

回答1:


Here is how it works without moving the code to separate JSON:

aws ec2 run-instances \
    --image-id ami-d2c924b2 \
    --instance-type m4.large \
    --block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=32}'


来源:https://stackoverflow.com/questions/43290499/how-to-set-block-device-mappings-during-aws-ec2-run-instances

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!