I am building a webserver with AWS Lambda and I need a public IP address that I can call to request the Lambda function. My users need to put this IP address as an A record into their DNS.
Is it somehow possible, for example, to associate an Elastic IP to a single Lambda function for incoming traffic? Maybe through a load balancer?
For the outgoing traffic I have my NAT and Internet Gateways, which are working fine.
You have 2 choices that can provide this functionality:
Both of the above will require that the subdomain is mapped by a CNAME rather than an A Record. This is because both of these domains recycle IP addresses on an infrequent basis.
If you absolutely must have the record resolve to an IP you would need to use an NLB in front of you ALB. The NLB supports a static IP per subnet, the ALB would then become its target through IP mapping and an existing AWS service. If you can use CNAMEs then you do not need to do this.