Skip to content

MultiRegionEndpoint

Source: src/AWS/SES/MultiRegionEndpoint.ts

An Amazon SES v2 multi-region endpoint (global endpoint) — a single sending endpoint that splits email traffic across a primary region (where the endpoint is created) and one or more secondary regions, improving resilience and deliverability.

There is no update API, so any change to the name or routes replaces the endpoint.

Two-Region Endpoint

import * as SES from "alchemy/AWS/SES";
// The primary region is wherever the stack deploys; the route adds a
// secondary region.
const endpoint = yield* SES.MultiRegionEndpoint("Global", {
regions: ["eu-west-1"],
});

Three-Region Endpoint

// Traffic is split across the primary region plus every listed route.
const endpoint = yield* SES.MultiRegionEndpoint("Global", {
regions: ["eu-west-1", "ap-southeast-2"],
});

Explicit Endpoint Name

const endpoint = yield* SES.MultiRegionEndpoint("Global", {
endpointName: "acme-global",
regions: ["eu-west-1"],
});
import * as sesv2 from "@distilled.cloud/aws/sesv2";
import * as Effect from "effect/Effect";
import * as Schedule from "effect/Schedule";
const endpoint = yield* SES.MultiRegionEndpoint("Global", {
regions: ["eu-west-1"],
});
// Reconcile returns as soon as SES accepts the create, so status is
// usually CREATING. Poll yourself when you need to block on readiness.
const ready = yield* sesv2
.getMultiRegionEndpoint({ EndpointName: yield* endpoint.endpointName })
.pipe(
Effect.repeat({
schedule: Schedule.spaced("30 seconds"),
until: (r) => r.Status === "READY",
times: 40,
}),
);