Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull public ips from aws-cli and not /latest/meta-data #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

djhouseknecht
Copy link

Issue

At some point in the recent past, the /latest/meta-data/.../ipv4-associations/{private-ip} endpoint started bunching up all public IPs to one private IP. In the AWS console, the public IPs were still mapped to the correct private IPs. This bug/feature from the endpoint caused the mappings to break since aws-eni thought that only one private IP had a public IP assigned even though multiple private IPs could have had public IPs associated.

Resolution

Instead of hitting /meta-data/... endpoints to query for public IPs, this PR will start using aws ec2 describe-addresses to fetch the actual private/public IP mappings for a given ENI.

@@ -181,6 +181,7 @@ def info
raise Errors::MetaBadResponse unless Meta.interface(hwaddr, '', not_found: nil)
{
hwaddr: hwaddr,
instance_id: Meta.instance('instance-id'),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was easier to just add this to the info's metadata than trying to pull it from lib/aws-eni.rb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant