Skip to content

ObjectLambdaAccessPoint

Source: src/AWS/S3Control/ObjectLambdaAccessPoint.ts

An S3 Object Lambda Access Point — intercepts S3 GetObject / HeadObject / ListObjects requests through a supporting access point and transforms responses with a Lambda function (redaction, resizing, format conversion, …).

Transform GetObject responses with a Lambda

import * as S3Control from "alchemy/AWS/S3Control";
const accessPoint = yield* S3Control.AccessPoint("data-ap", {
bucket: bucket.bucketName,
});
const olap = yield* S3Control.ObjectLambdaAccessPoint("transform-ap", {
supportingAccessPoint: accessPoint.accessPointArn,
transformationConfigurations: [
{
Actions: ["GetObject"],
ContentTransformation: {
AwsLambda: { FunctionArn: transformer.functionArn },
},
},
],
});

Pass Range/PartNumber through and enable metrics

const olap = yield* S3Control.ObjectLambdaAccessPoint("transform-ap", {
supportingAccessPoint: accessPoint.accessPointArn,
allowedFeatures: ["GetObject-Range", "GetObject-PartNumber"],
cloudWatchMetricsEnabled: true,
transformationConfigurations: [
{
Actions: ["GetObject"],
ContentTransformation: {
AwsLambda: { FunctionArn: transformer.functionArn },
},
},
],
});