user3676943
user3676943

Reputation: 923

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

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}}

Upvotes: 6

Views: 9768

Answers (1)

Janusz
Janusz

Reputation: 1491

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}'

Upvotes: 16

Related Questions