It would be nice to have a associate_public_ip_address parameter for the aws_network_interface resource so that it isn't required to allocate and manage an EIP.
The use case:
Making a HA service running in a active-passive fashion. The master and the backup each run in their own ASG, to leverage auto-recovery at the instance level., each ASG have exactly one instance. The master service needs to use a specific EIP address.
As master and backup need to communicate with one another an ENI is pre-provisioned for both to reserve a private IP each which is then passed via launch template's user data. Upon failover, the backup is promoted to master and self-assign the service EIP. After recovery from initial-master, it is unable to become master again as it's left without public IP to make calls to self-assign service EIP.
Having an auto-assigned IP would allow instances to have their primary IP be taken away while retaining their auto-assigned public IP as backup, and therefore still being able to make API calls. Private Link is not an option.
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Description
It would be nice to have a
associate_public_ip_address
parameter for theaws_network_interface
resource so that it isn't required to allocate and manage an EIP.The use case:
Making a HA service running in a active-passive fashion. The master and the backup each run in their own ASG, to leverage auto-recovery at the instance level., each ASG have exactly one instance. The master service needs to use a specific EIP address.
As master and backup need to communicate with one another an ENI is pre-provisioned for both to reserve a private IP each which is then passed via launch template's user data. Upon failover, the backup is promoted to master and self-assign the service EIP. After recovery from initial-master, it is unable to become master again as it's left without public IP to make calls to self-assign service EIP.
Having an auto-assigned IP would allow instances to have their primary IP be taken away while retaining their auto-assigned public IP as backup, and therefore still being able to make API calls. Private Link is not an option.
Affected Resource(s) and/or Data Source(s)
Potential Terraform Configuration
References
This is implemented in AWS CLI via the options
--associate-public-ip-address
and--no-associate-public-ip-address
.Would you like to implement a fix?
None