A
A
Alexander2016-11-21 14:23:01
Amazon Web Services
Alexander, 2016-11-21 14:23:01

How to bind a private IP to an EC2 machine in AWS VPC?

Hello. Perhaps in the Management Console it is indicated, but not explicitly.
Migrated with my cars from Classic to VPC. Each machine now has two IPs: Elastic IP (EIP) and Private IP (PIP).
Previously, it happened, our services communicated with each other via EIP (Yes, not quite right, but what is temporary is permanent). Now we managed to transfer everything to the VPC and now I want the machines to communicate via PIP. But in the console, I didn’t find an explicit DHCP binding anywhere, that a machine with the nnnnnn indicator corresponds to a private address XX.XX.XX.XX
I’m afraid that PIP may change when EC2 is rebooted

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2016-11-23
@yellowmew

private IP do not change until the terminate of the wheelbarrow.
docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-...
Also, you can operate with a secondary private IP set if your processes involve re-creating instances for upgrade/replacement: you can chain certain secondary PIPs to certain instances. The scheme looks a little perverted, but I saw cases where it came in handy.
For example, they didn’t bind to Primary PIP when first it was necessary to create a new instance, and then only terminate the old one: you can’t untie primary PIP from an instance, and after creating a new Secondary PIP, it moved to a new one and the application worked already with a new instance - with the ability to roll back to the old version .
PS for everyone who wants to comment on Secondary PIP - I just saw this, I use Consul in my work, don't consider it a pervert, please :D

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question