2개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
You can specify the IP Address in a Launch Template, specifically AWS::EC2::Launch Template NetworkInterface
답변함 일 년 전
0
It's good to avoid the issue using domain names or internal load balancers, but there are some ways of getting the same private IP.
One is to use an additional ENI that you attach to your instance in addition to the default ENI. Other resources can reference the private IP of this additional ENI, which can be detached and attached to another instance as needed. Note it needs to be in the same AZ but different subnet than the default ENI.
Another hack I've heard of is using a very small subnet (/28) and using up all but one of the available IP addresses. Then when your instance starts it's forced to always use the same IP address.
관련 콘텐츠
- 질문됨 5달 전
Thanks for adding the much better answer @Rodney Lester. My info was way out of date - somehow in the shift from Launch Configurations to Launch Templates years ago I never noticed (or have forgotten) that specifying a primary IPv4 address is now possible. Cheers.