Created
September 7, 2017 04:07
-
-
Save anuragmathur1/a5048d2d9248830af87b0d75dacb369c to your computer and use it in GitHub Desktop.
Create ec2 instance using aws cli.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws ec2 run-instances \ | |
--image-id ami-xxxxxxxx \ | |
--instance-type m4.large \ | |
--security-group-ids sg-xxxxxxxx sg-xxxxxxxx sg-xxxxxxxx \ | |
--subnet-id subnet-xxxxxxxx \ | |
--iam-instance-profile Arn=arn:aws:iam::xxxxxxxxxxxx:instance-profile/instance-profile \ | |
--count 1 \ | |
--block-device-mappings '[ { "DeviceName": "/dev/xvda", "Ebs": {"VolumeSize": 100, "VolumeType": "gp2"}}]' \ | |
--key-name instance-key \ | |
--associate-public-ip-address \ | |
--profile=work |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment