Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andytumelty/3651ef79fc00908b4d9f5f6bba05489a to your computer and use it in GitHub Desktop.
Save andytumelty/3651ef79fc00908b4d9f5f6bba05489a to your computer and use it in GitHub Desktop.
AWS CLI List VPC ID, Name and CIDR Block
# display VPC ID, CIDR Block and Name
aws ec2 --output text --query 'Vpcs[*].{VpcId:VpcId,Name:Tags[?Key==`Name`].Value|[0],CidrBlock:CidrBlock}' describe-vpcs
@astrikmobilize
Copy link

astrikmobilize commented Feb 15, 2024

aws ec2 --query 'Vpcs[*].{name:Tags[?Key==`Name`].Value|[0], VpcId:VpcId, Cidr:CidrBlockAssociationSet[*].CidrBlock}' describe-vpcs --profile ${request_account}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment