Get EIP association information for ENI if EIP is associated (#2082)

This commit is contained in:
Stefan Horning 2016-06-20 19:10:56 +02:00 committed by Adrian Likins
parent 45ca94af0a
commit 1da89cd5a1

View file

@ -101,6 +101,12 @@ def get_eni_info(interface):
'private_ip_addresses': private_addresses
}
if hasattr(interface, 'publicDnsName'):
interface_info['association'] = {'public_ip_address': interface.publicIp,
'public_dns_name': interface.publicDnsName,
'ip_owner_id': interface.ipOwnerId
}
if interface.attachment is not None:
interface_info['attachment'] = {'attachment_id': interface.attachment.id,
'instance_id': interface.attachment.instance_id,