Let's pretend I have an AWS EIP allocated as: eipalloc-94eb5af1 Let's pretent I have an AWS Network Interface: eni-e3d20a9a, eni-e3d20a9a
Let's now pretent I have two EC2 servers. The network interfaces are on those two servers.
Now...let's suppose I wanted to setup monitoring. Ping monitoring perhaps. If eni-e3d20a9a becomes invisible, I wish to transfer the EIP to eni-e3d20a9a.
This can be easily accomplished by:
aws ec2 associate-address --allocation-id eipalloc-03d3b666 \
--allow-reassociation --network-interface-id eni-98e03bd3
Also, setup of a rudimentary bash script on each server to monitor each other is rather simple.
But, I need advice on doing this efficiently on AWS. Not with a script Perhaps with Lambda or Cloudwatch?
What is the best way to accomplish the EIP move?