1 Risposta
- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
0
To get the private IP address of an Amazon EC2 instance, you can use either of the following describe-instances AWS CLI commands:
Important: Replace <instance-id> with your Amazon EC2 instance's ID. Replace <your-private-dns-name> with the private DNS name of the network interface.
aws ec2 describe-instances --instance-id <instance-id> --query 'Reservations[0].Instances[0].NetworkInterfaces[?Attachment.DeviceIndex==`1`].PrivateIpAddress'
-or-
aws ec2 describe-instances --filters Name=private-dns-name,Values=<your-private-dns-name> --query 'Reservations[0].Instances[0].NetworkInterfaces[?Attachment.DeviceIndex==`1`].PrivateIpAddress'
con risposta 4 anni fa
Contenuto pertinente
- Come posso assegnare un indirizzo IP privato primario personalizzato alla mia istanza di Amazon EC2?AWS UFFICIALEAggiornata un anno fa
- AWS UFFICIALEAggiornata 4 mesi fa
- AWS UFFICIALEAggiornata 3 anni fa