Created
April 22, 2023 09:50
-
-
Save aashishrbhandari/98cbcfb0a7addd1c114d8e750fef39d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Get all Instance inside a VPC, part of VPC | |
aws ec2 describe-instances \ | |
--filters "Name=vpc-id,Values=vpc-9999999999999" "Name=instance-state-name,Values=running" \ | |
--query \ | |
'Reservations[].Instances[].{ | |
Name: Tags[?Key==`Name`].Value | [0],InstanceId:InstanceId, | |
Id: InstanceId, | |
SubnetId: SubnetId, | |
AZ: Placement.AvailabilityZone, | |
PrivateIP: PrivateIpAddress, | |
OS: PlatformDetails | |
}' \ | |
--output table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment