Skip to content

Instantly share code, notes, and snippets.

View bernays's full-sized avatar

Ben Bernays bernays

View GitHub Profile
@bernays
bernays / assignEIP.js
Last active February 22, 2020 12:20
Lambda-Assign-EIP-Lifecyclehook
/*Problem: Integration into 3rd party API requires IP whitelisting. Servers are dynamically started and stopped.
Solution: assign predefined EIPs to EC2 instances as the Auto Scaling group size increases
Limitations: Need to predefine and preallocate all IP addresses
Other possible solutions:
1) Proxy all requests through single NAT instance
i. limitation: single point of failure
ii. need similar solution to make sure NAT is highly available
2) Remove whitelisting requirement
i. no...just no ... not gonna happen