问题
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