Skip to content
GitHubXDiscordRSS

Endpoint

Learn how to create, update, and manage AWS Events Endpoints using Alchemy Cloud Control.

The Endpoint resource lets you manage AWS Events Endpoints for routing events to a target service. This resource enables you to define event buses, configurations, and permissions to facilitate seamless event-driven architectures.

Create a basic event endpoint with required properties and a description.

import AWS from "alchemy/aws/control";
const eventEndpoint = await AWS.Events.Endpoint("basicEventEndpoint", {
EventBuses: [{ Name: "default" }],
Description: "A basic event endpoint for routing events."
});

Configure an endpoint with routing settings and replication configuration.

const advancedEventEndpoint = await AWS.Events.Endpoint("advancedEventEndpoint", {
EventBuses: [{ Name: "default" }],
Description: "An advanced event endpoint with specific routing and replication settings.",
RoutingConfig: {
FailoverConfig: {
Primary: {
Target: {
Type: "lambda",
Arn: "arn:aws:lambda:us-east-1:123456789012:function:MyFunction"
},
Type: "primary"
},
Secondary: {
Target: {
Type: "sqs",
Arn: "arn:aws:sqs:us-east-1:123456789012:MyQueue"
},
Type: "secondary"
}
}
},
ReplicationConfig: {
RoleArn: "arn:aws:iam::123456789012:role/MyReplicationRole"
}
});

Assign a specific IAM role to the endpoint for permissions.

const roleAssignedEndpoint = await AWS.Events.Endpoint("roleAssignedEndpoint", {
EventBuses: [{ Name: "default" }],
Description: "An endpoint with a custom IAM role for execution.",
RoleArn: "arn:aws:iam::123456789012:role/MyCustomRole"
});

Adopt an existing event endpoint instead of failing if it already exists.

const adoptedEndpoint = await AWS.Events.Endpoint("adoptExistingEndpoint", {
EventBuses: [{ Name: "default" }],
Description: "Adopting an existing endpoint if it already exists.",
adopt: true
});