- Newest
- Most votes
- Most comments
The above implementation has been re-reviewed and with logging in place and a test API call to a free API - https://jsonplaceholder.typicode.com/todos/1 I can confirm that the response status is 200 OK (Lambda is able to reach the internet). Another learning was since the NAT has a static public IP, this can be added in security groups whose resources you want the lambda function to access.
High level summary of what got the NAT working for me:
NAT GW was created in the public subnet.
Private subnet was attached to Lambda and has a route table linking to the NAT.
A security group allowing all outbound traffic on http and https port was attached to the lambda while adding the private subnet.
Hi, from your description above I couldn't be sure which subnet your NAT GW is in. It's in the Public subnet, right?
Your setup sounds good. Are your NACLs open?
Hello, You can review rePOST article here :- https://repost.aws/articles/AR0sZ6gH1CRzGND7GV_Z_0pQ/how-do-i-create-an-amazon-msk-event-source-mapping-to-invoke-a-lambda-function-using-a-nat-gateway-internet-connection
Relevant content
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a year ago
Something still doesn't sound right there - your NAT GW needs a route to the Internet GW (if you're using it for internet traffic) so by definition is in a Public subnet if it's working.
Kindly note that the NAT Gateway was provisioned in the public subnet which has a route table with access to the internet gateway. Sorry about the earlier comment, I might have been rushing. On a high level summary: NAT GW was created in the public subnet. Private subnet was attached to Lambda and has a route table linking to the NAT.
A security group allowing all outbound traffic on http and https port was attached to the lambda while adding the private subnet. This approach got the NAT working as expected
Hello Skinsman Thanks for the prompt response. The NAT is residing in the public subnet.
But as per tests with a colleague today morning, we tested using this free API - https://jsonplaceholder.typicode.com/todos/1 and the response code logged was OK
Seems all checks out.