Delivering EventBridge's Webhook and OAuth Legs Through One Static IP with VPC Lattice
Enterprise receivers often allow-list a single source IP. With EventBridge API Destinations the webhook is easy to pin, but the OAuth token call quietly egresses from a different address and fails the allow-list. Here's how to route both legs through your VPC and out one NAT Elastic IP, using private connectivity and VPC Lattice, with no proxy Lambda and no custom token code. Tested and working.
This is the end-to-end pattern that does it, tested in a live account: both legs private through a VPC Lattice resource gateway, out one NAT Elastic IP, with EventBridge still managing the OAuth token.
The Problem: one leg of the call leaks the wrong IP
A common integration requirement from enterprise receivers is: "we will only accept your webhooks from a single static IP that we add to our allow-list." With Amazon EventBridge API Destinations, the webhook delivery itself is easy to pin to a fixed address, teams usually route it through a Lambda in a VPC behind a NAT Gateway. The part teams miss is the OAuth leg.
When an API Destination uses an OAuth connection, EventBridge first calls the authorization endpoint to fetch a token, then calls the invocation endpoint with it. By default that token call egresses from EventBridge's shared, changing address space, not your fixed IP. So the webhook passes the receiver's allow-list and the token call does not, and the integration stalls on the leg that is easiest to overlook.
The instinct is to also route the token call through the proxy Lambda, which means custom OAuth code and a token cache you own, rotate, and secure. There is a cleaner way that keeps EventBridge in charge of the OAuth flow and removes the Lambda entirely.
The Idea: route both legs through a VPC Lattice resource gateway, egress through one NAT IP
EventBridge API Destinations support private connectivity through Amazon VPC Lattice. Two VPC Lattice building blocks do the work:
- A resource gateway is the entry point that receives traffic into your VPC. It lives in your private subnet and replaces the proxy Lambda.
- A resource configuration identifies a target the gateway can reach. Here it is a domain-name target pointing at the receiver's public hostname. Because that hostname resolves to a public IP outside your VPC, VPC Lattice requires a NAT Gateway in the VPC, and the traffic egresses through the NAT Gateway's Elastic IP.
You create one resource configuration per receiver host, then reference them from an EventBridge Connection: the OAuth authorization endpoint points at one, and the invocation (webhook) endpoint points at the other. Both legs now travel EventBridge to the resource gateway to the NAT Gateway, and leave from the same stable Elastic IP, the one your receiver allow-lists. EventBridge still owns the OAuth handshake, token caching and refresh, and stores the client secret in AWS Secrets Manager. You write no token code.
EventBridge (classic event bus) -> Connection (OAuth client credentials) OAuth authorization endpoint = private -> VPC Lattice resource config (OAuth host) invocation (webhook) endpoint = private -> VPC Lattice resource config (webhook host) -> VPC Lattice resource gateway (private subnet) [replaces the proxy Lambda] -> NAT Gateway + one Elastic IP -> receiver OAuth server (token) AND receiver webhook (delivery) [same Elastic IP]
Tested in a live account: the receiver logged the same source IP, the NAT Elastic IP, for both the
/token call and the /webhook delivery, and the webhook carried the bearer token EventBridge had issued and cached. Step 6 shows how to confirm it yourself.How it works, per event
- An event matches a rule on the event bus; the target is the API Destination (via the Connection).
- If there is no valid cached token, EventBridge calls the OAuth authorization endpoint (private) through the resource gateway and out the NAT Elastic IP to the receiver's token endpoint, then caches the token.
- EventBridge calls the invocation endpoint (private) with
Authorization: Bearer <token>through the same resource gateway and NAT Elastic IP to the receiver's webhook.
- Both calls reach the receiver from the one Elastic IP. EventBridge reuses the cached token across deliveries.
Step 1: Stand up the egress path
You need a VPC with a private subnet whose default route (
0.0.0.0/0 ) points to a NAT Gateway that owns an Elastic IP (plus a public subnet and internet gateway for the NAT). That Elastic IP is the single address you give the receiver. The receiver endpoints must be public HTTPS with publicly trusted certificates.Step 2: Create the VPC Lattice resource gateway
Create the resource gateway in the private subnet, with a security group that allows the HTTPS traffic:
aws vpc-lattice create-resource-gateway \ --name eb-lattice-rg \ --vpc-identifier $VPC \ --subnet-ids $PRIVATE_SUBNET \ --security-group-ids $SGStep 3: Create one resource configuration per receiver host
Each is a SINGLE, TCP, port 443 domain-name target. If the OAuth host and the webhook host differ, create one for each:
aws vpc-lattice create-resource-configuration \ --name eb-lattice-rc-webhook \ --type SINGLE --protocol TCP --port-ranges 443 \ --resource-gateway-identifier $RG \ --resource-configuration-definition 'dnsResource={domainName=webhook.receiver.example.com,ipAddressType=IPV4}'
aws vpc-lattice create-resource-configuration \ --name eb-lattice-rc-oauth \ --type SINGLE --protocol TCP --port-ranges 443 \ --resource-gateway-identifier $RG \ --resource-configuration-definition 'dnsResource={domainName=oauth.receiver.example.com,ipAddressType=IPV4}'Step 4: Create the EventBridge connection with both legs private
The OAuth authorization endpoint carries its own
ConnectivityParameters , and the invocation (webhook) leg uses --invocation-connectivity-parameters . Put each leg's resource configuration ARN in the matching place:# auth.json{ "OAuthParameters": { "ClientParameters": { "ClientID": "...", "ClientSecret": "..." }, "AuthorizationEndpoint": "https://oauth.receiver.example.com/token", "HttpMethod": "POST" }, "ConnectivityParameters": { "ResourceParameters": { "ResourceConfigurationArn": "<OAUTH_RESOURCE_CONFIG_ARN>" } }}
aws events create-connection \ --name eb-lattice-conn \ --authorization-type OAUTH_CLIENT_CREDENTIALS \ --auth-parameters file://auth.json \ --invocation-connectivity-parameters \ '{"ResourceParameters":{"ResourceConfigurationArn":"<WEBHOOK_RESOURCE_CONFIG_ARN>"}}'EventBridge stores the client secret in a managed Secrets Manager secret in your account, so the credential never lives in your code. On create, EventBridge also builds a VPC Lattice resource association to its own service network, using your credentials, so you retain visibility. The connection reaches ACTIVE after it provisions that association and performs the first token exchange, which took about five minutes in testing. Treat that as a one-time wait.
Step 5: Create the API Destination, rule, and target
aws events create-api-destination \ --name eb-lattice-dest \ --connection-arn $CONN_ARN \ --invocation-endpoint https://webhook.receiver.example.com/webhook \ --http-method POSTThen put a rule and point its target at the API Destination, with an invoke role that allows
events:InvokeApiDestination .Step 6: Verify the single IP
The whole point of this pattern is one IP, so prove it. This is the check that passed in testing:
- Send an event, and on the receiver side capture the source IP of both the OAuth token call and the webhook.
- Confirm both equal your NAT Elastic IP.
- Confirm the webhook carried the bearer token EventBridge issued.
- Add only that Elastic IP to the receiver's allow-list and confirm delivery still succeeds.
If the token call shows a different source IP, its connectivity parameters are not in effect; recheck that
OAuthParameters.ConnectivityParameters on the Connection carries the OAuth resource configuration ARN, not just the invocation leg.The trade-offs and caveats
No custom token code, by design. EventBridge keeps ownership of the OAuth handshake, token cache and refresh, and the secret. If you keep the Lambda and add the OAuth call to it instead, that is the smaller change from a Lambda-proxy setup, but you then own custom OAuth code and a token cache. This pattern trades that for more AWS configuration and a newer feature.
The target must be a public domain with a publicly trusted certificate. Private invocation here does not mean the receiver is private; it means EventBridge's path into your VPC is private. The receiver is still a public HTTPS endpoint.
One static IP is a high-availability decision. A single NAT Gateway gives exactly one Elastic IP but ties you to one Availability Zone. For HA, run a NAT Gateway with its own Elastic IP per AZ and have the receiver allow-list that small, fixed set of IPs. It is still permanent, with no ongoing updates.
Know the throughput and cost profile. API Destinations are low-RPS and best effort, so confirm against your delivery volume. Connection provisioning is slow (about five minutes), one time. Running cost is the NAT Gateway, the Elastic IP, and the VPC Lattice resource gateway and configurations.
Why this pattern matters
VPC Lattice private connectivity is usually framed as a way to reach a private endpoint inside your VPC. This flips it: it pins a public outbound integration, both the webhook and its OAuth token call, to one allow-listed IP, exactly what enterprise receivers ask for. Two details make it work and are easy to miss: the OAuth leg needs its own resource configuration, and a domain-name target plus a NAT Gateway removes the proxy Lambda entirely.
References (public)
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article