RouteServerEndpoint
The RouteServerEndpoint resource allows you to manage AWS EC2 RouteServerEndpoints which enable customers to connect to the AWS Direct Connect and transit gateway services through a centralized routing mechanism.
Minimal Example
Section titled “Minimal Example”Create a basic RouteServerEndpoint with required properties.
import AWS from "alchemy/aws/control";
const routeServerEndpoint = await AWS.EC2.RouteServerEndpoint("myRouteServerEndpoint", { SubnetId: "subnet-0abcd1234efgh5678", RouteServerId: "rs-0abcd1234efgh5678", Tags: [ { Key: "Environment", Value: "Production" } ]});
Advanced Configuration
Section titled “Advanced Configuration”Configure a RouteServerEndpoint with additional properties, including adopting an existing resource.
const advancedRouteServerEndpoint = await AWS.EC2.RouteServerEndpoint("advancedRouteServerEndpoint", { SubnetId: "subnet-0abcd1234efgh5678", RouteServerId: "rs-0abcd1234efgh5678", Tags: [ { Key: "Environment", Value: "Staging" } ], adopt: true // Adopt existing resource instead of failing if it already exists});
Connecting Multiple Networks
Section titled “Connecting Multiple Networks”Create a RouteServerEndpoint to connect multiple networks through distinct subnets.
const primaryRouteServerEndpoint = await AWS.EC2.RouteServerEndpoint("primaryRouteServerEndpoint", { SubnetId: "subnet-0abcd1234efgh5678", RouteServerId: "rs-0abcd1234efgh5678", Tags: [ { Key: "Role", Value: "Primary" } ]});
const secondaryRouteServerEndpoint = await AWS.EC2.RouteServerEndpoint("secondaryRouteServerEndpoint", { SubnetId: "subnet-1abcd1234efgh5678", RouteServerId: "rs-0abcd1234efgh5678", Tags: [ { Key: "Role", Value: "Secondary" } ]});
Deleting a RouteServerEndpoint
Section titled “Deleting a RouteServerEndpoint”Example of how to delete a RouteServerEndpoint when it is no longer needed.
await AWS.EC2.RouteServerEndpoint("deleteRouteServerEndpoint", { SubnetId: "subnet-0abcd1234efgh5678", RouteServerId: "rs-0abcd1234efgh5678", Tags: [ { Key: "Action", Value: "Delete" } ]});