User Tools

Site Tools


ec2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ec2 [2015/09/05 17:06] (current)
sebastian created
Line 1: Line 1:
 +====== Using EC2 via the CLI ======
  
 +===== Listing the instances =====
 +You can get a list of the available instance with the following command.
 +<code bash>
 +aws ec2 describe-instances
 +</​code>​
 +
 +Or — if you like it a little bit more readable — choose the table output option.
 +<code bash>
 +aws ec2 describe-instances --output=table
 +</​code>​
 +
 +If you are only interested in instance number name and state use [[grep]].
 +<code bash>
 +aws ec2 describe-instances | grep -E -o '​\bi-[0-9a-f]+\b|STATE\b.*|Name.*'​
 +</​code>​
 +
 +===== Starting an instance =====
 +To start a stopped instance use the following command.
 +<code bash>
 +aws ec2 start-instances --instance-ids the_instance_id
 +</​code>​
 +
 +Don't mix up ''​start-instances''​ and ''​run-instances''​ the later is to start a new instance from an [[AWS:​AMI]].
ec2.txt · Last modified: 2015/09/05 17:06 by sebastian