How is it possible to display the current VPC from the CLI within a running Linux (Debian) EC2 instance?
Asked
Active
Viewed 751 times
1 Answers
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