Menu

Claude IP allowlist: Lambda with a static egress IP
📰

Claude IP allowlist: Lambda with a static egress IP

DEV Community: aws·Sascha Mirow-Stanitzok·6 days ago
#A0QxxgKn
#devtoaws#devto#dev#claude#const
Reading 0:00
15s threshold

Since November 5, the Claude IP allowlist lets you decide which IP addresses may use the Claude API for your organization at all. The feature looks small, yet I think it matters a lot: an API key that ends up in a log, a screenshot or a public repo by accident becomes useless on someone else’s machine.

Here is the catch for anyone building serverless: a Lambda function has no fixed source address out of the box. If you switch on the Claude IP allowlist before pinning down the egress IP of your functions, in the worst case you lock yourself out. That is exactly what this post covers, step by step and with code you can deploy right away.

In short

The Claude IP allowlist only lets requests through from public addresses on the list, everything else gets a 403. To make Lambda fit, you route its traffic through a NAT gateway with an Elastic IP and add exactly that address.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.