Skip to content

Only use private IP for machines in the same region #129

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mpickering
Copy link

This just puts the check back to how it was when the code was originally written, it is at least more correct than before.

@adisbladis
Copy link
Member

cc @tewfik-ghariani

@mpickering
Copy link
Author

To clarify the problem this fixes is if you deploy two AWS machines to different regions then the generated /etc/hosts would mention the private IPs of each machine rather than the public IP.

@roberth
Copy link
Member

roberth commented Feb 19, 2021

It's probably more useful to configure VPC peering.

You can establish peering relationships between VPCs across different AWS Regions (also called Inter-Region VPC Peering). This allows VPC resources including EC2 instances, Amazon RDS databases and Lambda functions that run in different AWS Regions to communicate with each other using private IP addresses

-- https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html

Should be similar price as well, if we can trust this chart.

@talyz
Copy link
Contributor

talyz commented Feb 15, 2024

VPC peering wouldn't work as a generic solution, since it doesn't allow for overlapping CIDRs. This is certainly better than the current behavior, which is just straight up broken. I've been using a similar fix in my own repo.

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.

4 participants