Skip to content
GitHubXDiscord

Endpoint

The Endpoint resource allows you to manage AWS S3Outposts Endpoints effectively. This resource facilitates the creation and configuration of S3 endpoints within an AWS Outposts environment.

Create a basic S3Outposts endpoint with required properties and one optional property.

import AWS from "alchemy/aws/control";
const s3OutpostsEndpoint = await AWS.S3Outposts.Endpoint("myS3OutpostsEndpoint", {
OutpostId: "op-12345678",
SecurityGroupId: "sg-87654321",
SubnetId: "subnet-1234abcd",
AccessType: "Private" // Optional
});

Configure an endpoint with additional optional properties for advanced use cases.

const advancedS3OutpostsEndpoint = await AWS.S3Outposts.Endpoint("advancedS3OutpostsEndpoint", {
OutpostId: "op-12345678",
SecurityGroupId: "sg-87654321",
SubnetId: "subnet-1234abcd",
AccessType: "Private",
CustomerOwnedIpv4Pool: "coip-12345678", // Optional
adopt: true // Optional, adopt existing resource if it exists
});

Example of creating an endpoint and handling potential errors.

try {
const errorHandledEndpoint = await AWS.S3Outposts.Endpoint("errorHandledEndpoint", {
OutpostId: "op-12345678",
SecurityGroupId: "sg-87654321",
SubnetId: "subnet-1234abcd"
});
} catch (error) {
console.error("Failed to create S3Outposts Endpoint:", error.message);
}

Use the adopt property to ensure that the creation doesn’t fail if the endpoint already exists.

const adoptExistingEndpoint = await AWS.S3Outposts.Endpoint("adoptExistingEndpoint", {
OutpostId: "op-12345678",
SecurityGroupId: "sg-87654321",
SubnetId: "subnet-1234abcd",
adopt: true // Adopt existing endpoint instead of creating a new one
});