web stats
AMAZON AWS CLI Tutorial | Why Cloud Computing

AMAZON AWS CLI Tutorial

I’ve started working on AMAZON AWS CLI, and here is a tutorial that I have created based on my understanding and requirement. I have

Amazon AWC Cli command to show details of all ec2 instances running.

aws ec2 describe-instances

Amazon AWC Cli command to show details of specific instance.

aws ec2 describe-instances –instance-ids i-1a2b3c4d

Amazon AWC Cli command to show details of specific instance requested with its name.

aws ec2 describe-instances –filter Name=tag:Name,Values=EE-Test

Amazon AWC Cli command to check status of a particular Instance.

aws ec2 describe-instance-status –instance-id i-1a2b3c4d

Amazon AWC Cli command to get status of Instance with id i-1a2b3c4d” and “Availability Zone, State Name, Instance ID, TYPE, Platform, Tags. Value, State Code and tag values”.

aws ec2 describe-instances –instance-ids i-1a2b3c4d –query ‘Reservations[].Instances[].[Placement.AvailabilityZone, State.Name, InstanceId,InstanceType,Platform,Tags.Value,State.Code,Tags.Values]’ –output json

———————

[

[

“us-east-1B”,

“running”,

“i-1a2b3c4d”,

“m1.micro”,

“windows”,

null,

16,

null

]

]

 

Amazon AWC Cli command to get status of Instance with name “EE-Test” and “Availability Zone, State Name, Instance ID, TYPE, Platform, Tags. Value, State Code and tag values”.

aws ec2 describe-instances –filter Name=tag:Name,Values=EE-Test –query ‘Reservations[].Instances[].[Placement.AvailabilityZone, State.Name, InstanceId,InstanceType,Platform,Tags.Value,State.Code,Tags.Values]’ –output json

———————-

[

[

“us-east-1a”,

“running”,

“i-1a2b3c4d”,

“m1.micro”,

“windows”,

null,

16,

null

]

]

  • instance-state-code- The state of the instance, as a 16-bit unsigned integer. The high byte is an opaque internal value and should be ignored. The low byte is set based on the state represented. The valid values are: 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).
  • instance-state-name- The state of the instance (pending | running | shutting-down | terminated| stopping | stopped ).

Amazon AWC Cli command to get status of the Specific Instance using (i-1a2b3c4d – Instance-id)

aws ec2 describe-instances –instance-ids i-1a2b3c4d –query ‘Reservations[].Instances[].[State.Name]’ –output text

running

Start a Particular Instance using Instance ID in AMAZON AWS EC2.

aws ec2 start-instances –instance-ids i-1a2e3c4d

Stop a Particular Instance using Instance ID in AMAZON AWS EC2.

aws ec2 stop-instances –instance-ids i-1a2b3c4d

Share our stuff and help us grow. Need help to create something new or fix something old? Contact us to know if we can help 🙂

Related Posts:

  • No Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Why ask?