Thursday, 13 August 2015

AWS Cli Commands

Create Instance:


aws ec2 run-instances --image-id ami-1ecae776 --count 1 --instance-type t2.micro --key-name XXXXX --security-group-ids sg-xxxxxxx --subnet-id subnet-xxxxxx --query 'Instances[0].InstanceId'

Name Instance:


aws ec2 create-tags --resources i-ffc16754 --tags Key=Name,Value=Test-Naveed


Delete Instance:


aws ec2 terminate-instances --instance-ids i-b1c5e919

All in One!


yum install jq

aws ec2 create-tags --resources `aws ec2 run-instances --image-id ami-3d50120d --instance-type t2.small --subnet-id subnet-xxxxxxx --security-group-ids sg-xxxxxxxx --key-name "MyKey" | jq -r ".Instances[0].InstanceId"` --tags "Key=Name,Value=development_webserver"

1 comment:

  1. It'sVery informative blog and useful article thank you for sharing with us , keep posting learn more
    AWS Online Course

    ReplyDelete