EventBridge Global Endpoints let you route events to specific regions, but what if your primary region goes dark? You need a way to automatically switch traffic to a backup region, and EventBridge Global Endpoints have a built-in mechanism for this, but it’s not as simple as just flipping a switch.

Let’s see how this works with a simple example. Imagine we have a primary AWS region, us-east-1, and a secondary region, us-west-2. We want to send events from a custom event bus to a Lambda function in us-east-1 by default. If us-east-1 becomes unavailable, we want EventBridge to automatically start sending those events to a replicated Lambda function in us-west-2.

Here’s a simplified setup. We’ll have a custom event bus named my-event-bus.

First, create the custom event bus:

aws events create-event-bus --name my-event-bus --region us-east-1
aws events create-event-bus --name my-event-bus --region us-west-2

Next, create a Lambda function in each region that will be the target for our events. For simplicity, these Lambdas will just log the event.

In us-east-1:

aws lambda create-function \
  --function-name MyEventHandler \
  --runtime nodejs18.x \
  --role arn:aws:iam::123456789012:role/lambda-execution-role \
  --handler index.handler \
  --zip-file fileb://function.zip \
  --region us-east-1

In us-west-2:

aws lambda create-function \
  --function-name MyEventHandler \
  --runtime nodejs18.x \
  --role arn:aws:iam::123456789012:role/lambda-execution-role \
  --handler index.handler \
  --zip-file fileb://function.zip \
  --region us-west-2

Now, let’s create the EventBridge Global Endpoint. This is the core piece for cross-region failover.

{
  "Name": "MyGlobalEndpoint",
  "Description": "Global endpoint for cross-region event routing",
  "ReplicationConfig": {
    "RegionConfig": [
      {
        "Region": "us-east-1"
      },
      {
        "Region": "us-west-2"
      }
    ]
  },
  "EventBuses": [
    {
      "EventBusArn": "arn:aws:events:us-east-1:123456789012:event-bus/my-event-bus",
      "State": "ENABLED"
    },
    {
      "EventBusArn": "arn:aws:events:us-west-2:123456789012:event-bus/my-event-bus",
      "State": "ENABLED"
    }
  ]
}

You’d create this using the aws events create-endpoint command. The ReplicationConfig tells EventBridge which regions to replicate the endpoint to. The EventBuses array lists the ARN of the local custom event bus in each region that this global endpoint will manage.

Once the global endpoint is created, you don’t directly send events to my-event-bus in a specific region. Instead, you send events to the global endpoint’s ARN. EventBridge will then route these events to the healthiest available replica of your custom event bus.

To make this failover actually work, you need to configure health checks. EventBridge Global Endpoints use Route 53 health checks behind the scenes. You create a Route 53 health check that monitors a specific endpoint in each region. If a health check fails, EventBridge marks that region as unhealthy and stops sending traffic there.

Here’s how you’d associate a Route 53 health check with a global endpoint. First, create a health check that points to your Lambda function’s API Gateway endpoint (or any other health indicator).

# Example of creating a Route 53 health check (simplified)
aws route53 create-health-check --caller-reference my-health-check-us-east-1 --health-check-config file://health-check-config-us-east-1.json
aws route53 create-health-check --caller-reference my-health-check-us-west-2 --health-check-config file://health-check-config-us-west-2.json

The health-check-config-us-east-1.json would look something like this:

{
  "IPAddress": "YOUR_API_GATEWAY_INVOKE_URL_US_EAST_1",
  "Port": 443,
  "Type": "HTTPS",
  "ResourcePath": "/health",
  "FullyQualifiedDomainName": "YOUR_API_GATEWAY_INVOKE_URL_US_EAST_1",
  "RequestInterval": 30,
  "FailureThreshold": 3,
  "HealthThreshold": 10,
  "CloudWatchAlarmConfiguration": {
    "Enabled": false
  }
}

Then, you associate these health check IDs with your global endpoint’s regions. This is done by updating the endpoint configuration.

{
  "Name": "MyGlobalEndpoint",
  "ReplicationConfig": {
    "RegionConfig": [
      {
        "Region": "us-east-1",
        "HealthCheckArn": "arn:aws:route53:::healthcheck/YOUR_HEALTH_CHECK_ID_US_EAST_1"
      },
      {
        "Region": "us-west-2",
        "HealthCheckArn": "arn:aws:route53:::healthcheck/YOUR_HEALTH_CHECK_ID_US_WEST_2"
      }
    ]
  },
  "EventBuses": [
    // ... same as before
  ]
}

You’d use aws events update-endpoint for this. When the health check for us-east-1 fails for three consecutive checks (based on FailureThreshold), EventBridge will mark us-east-1 as unhealthy. Events sent to the global endpoint will then be routed to us-west-2, assuming its health check is passing. When us-east-1 becomes healthy again, EventBridge will automatically re-route traffic back to it.

The magic isn’t in a separate failover mechanism; it’s in how EventBridge Global Endpoints leverage Route 53 health checks to dynamically route traffic to available regional endpoints. The endpoint itself is always active in all specified regions, but EventBridge’s internal routing logic, informed by health checks, determines where events actually go.

The most surprising part is that you don’t explicitly define "failover rules." The failover is an emergent property of the health-checked routing. You configure the global endpoint to know about multiple regions, and you configure Route 53 health checks to report the availability of services in those regions. EventBridge then uses this information to make routing decisions. It’s a passive system that reacts to external health signals.

The next problem you’ll hit is ensuring your event targets (like Lambda functions) are also deployed and configured in the secondary region, and that any necessary data or state is replicated or accessible to them.

Want structured learning?

Take the full Eventbridge course →