Difference between revisions of "Aws ec2 describe-instances"

From wikieduonline
Jump to navigation Jump to search
Line 12: Line 12:
 
* <code>aws ec2 describe-instances --output text | [[egrep -w]] "Name|PLACEMENT"</code>
 
* <code>aws ec2 describe-instances --output text | [[egrep -w]] "Name|PLACEMENT"</code>
 
* <code>aws ec2 describe-instances [[--region]] [[us-west-1]]</code>
 
* <code>aws ec2 describe-instances [[--region]] [[us-west-1]]</code>
 +
* <code>aws ec2 describe-instance --filter "Name=tag:Name,Values=YOUR-TAG-NAME" --query "Reservations[].Instances[?State.Name == 'running'].InstanceId[]" --output text)</code>
  
 
=== Basic commands ===
 
=== Basic commands ===

Revision as of 14:47, 22 February 2022

https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html


Examples

  • aws ec2 describe-instances
  • aws ec2 describe-instances | grep InstanceType
  • aws ec2 describe-instances | grep AvailabilityZone
  • aws ec2 describe-instances | egrep "InstanceId|InstanceType|running"
  • aws ec2 describe-instances | egrep "InstanceId|YOUR_INSTANCE_NAME"
  • aws ec2 describe-instances | grep -A1 '"Key": "Name"'
  • aws ec2 describe-instances --output text | egrep -w "Name|PLACEMENT"
  • aws ec2 describe-instances --region us-west-1
  • aws ec2 describe-instance --filter "Name=tag:Name,Values=YOUR-TAG-NAME" --query "Reservations[].Instances[?State.Name == 'running'].InstanceId[]" --output text)

Basic commands

aws ec2 describe-instances
An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credential
Solution: Review configuration with aws configure list
  • aws ec2 describe-instances --profile YOUR_PROFILE

Related commands

See also

Advertising: