Difference between revisions of "AWS CLI"

From DevOps Notebook
(Created page with "'''AWS Command Line Interface''' snippets == EC2 via AWS CLI == === Start EC2 instance by tag === <pre> $ aws ec2 describe-instances --filters Name=tag:AutomationGroup,Value...")
 
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
  
 
== EC2 via AWS CLI ==
 
== EC2 via AWS CLI ==
=== Start EC2 instance by tag ===
+
=== Start EC2 instance by tag in linux (or Windows bash) ===
 
<pre>
 
<pre>
$ aws ec2 describe-instances --filters Name=tag:AutomationGroup,Values="Start" | jq ".Reservations[].Instances[].InstanceId" -r | xargs aws ec2 start-instances --instance-ids  
+
$ aws ec2 describe-instances --filters Name=tag:AutomationGroup,Values="Start" | jq ".Reservations[].Instances[].InstanceId" -r \
 +
| xargs aws ec2 start-instances --instance-ids  
 
</pre>
 
</pre>

Latest revision as of 23:02, 4 April 2020

AWS Command Line Interface snippets

EC2 via AWS CLI

Start EC2 instance by tag in linux (or Windows bash)

$ aws ec2 describe-instances --filters Name=tag:AutomationGroup,Values="Start" | jq ".Reservations[].Instances[].InstanceId" -r \
| xargs aws ec2 start-instances --instance-ids