I am trying a quick way to list/output all instances type running in my environment. Nothing else just a list of those InstanceType
.
I can easily get them on the console but it's a bit time consuming.
Thanks in advance!
Go to the instances section and click on "instances". It will show you all the running instances in the select region.
To find an instance type using the consoleOpen the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . From the navigation bar, select the Region in which to launch your instances. You can select any Region that's available to you, regardless of your location. In the navigation pane, choose Instance Types.
Which of the following is needed to retrieve a list of your EC2 instances using the AWS CLI? Solution: Access keys are long-term credentials for an IAM user or the AWS account root user.
Setup your Programmatic Access – Create Access Key and Key Secret. Execute the AWS CLI Command line examples to List EC2 instances command line. Let us perform these aforementioned steps one by one. Example3: Getting More Fields using the Query Parameter. Get the Machine type
EC2 instances in any of the following states are considered active: AWAITING_FULFILLMENT, PROVISIONING, BOOTSTRAPPING, RUNNING. See 'aws help' for descriptions of global parameters. list-instances is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results.
instance-storage-info.total-size-in-gb - The total amount of storage available from all local instance storage, in GB. instance-storage-supported - Indicates whether the instance type has local instance storage ( true | false ). instance-type - The instance type (for example c5.2xlarge or c5*).
AWS CLI is a very great help when it comes to efficiently manage your AWS Cloud Infrastructure and your EC2 instances. While we are managing our AWS Infrastructure, we cannot always afford to login to the AWS console all the time and it is not recommended from the security perspective as well.
AWS CLI -
aws ec2 describe-instances --region eu-west-1 --query 'Reservations[*].Instances[*].InstanceType' --output text | sort | uniq
In AWS web console - You can also use AWS Config -> Advanced queries -> Query editor as shown below. Output can be exported as json or csv. Also have aws cli for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With