0

How is it possible to display the current VPC from the CLI within a running Linux (Debian) EC2 instance?

manifestor
  • 6,079
  • 7
  • 27
  • 39

1 Answers1

4

Yes, but using the instance metadata not the cli:

curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/$( ip address show dev eth0 | grep ether | awk ' { print $2  } ' )/vpc-id

If your interface isn't named eth0 update appropriately.

B. Miller
  • 697
  • 3
  • 9