본문 바로가기
AWS

Elastic IP 정보 출력

by freesunny 2019. 7. 2.

awscli 만 사용하여 특정 EIP 정보 출력

$ aws ec2 describe-addresses --query "Addresses[?PublicIp=='13.124.0.244']"
[
  {
    "InstanceId": "i-01bb358db39e00eaf",
    "PublicIp": "13.124.0.244",
    "AllocationId": "eipalloc-051f47aa00be3e2f6",
    "AssociationId": "eipassoc-02c86d3f88f4b39aa",
    "Domain": "vpc",
    "NetworkInterfaceId": "eni-0c05b71024c58f8ad",
    "NetworkInterfaceOwnerId": "552342233276",
    "PrivateIpAddress": "10.12.1.119",
    "PublicIpv4Pool": "amazon"
  }
]

 

awscli + jq 사용하여 특정 EIP 정보 출력

$ aws ec2 describe-addresses | jq '.Addresses[] | select (.PublicIp=="13.124.0.244")'
{
  "InstanceId": "i-01bb358db39e00eaf",
  "PublicIp": "13.124.0.244",
  "AllocationId": "eipalloc-051f47aa00be3e2f6",
  "AssociationId": "eipassoc-02c86d3f88f4b39aa",
  "Domain": "vpc",
  "NetworkInterfaceId": "eni-0c05b71024c58f8ad",
  "NetworkInterfaceOwnerId": "552342233276",
  "PrivateIpAddress": "10.12.1.119",
  "PublicIpv4Pool": "amazon"
}