Package software.amazon.awscdk.services.s3objectlambda
@Stability(Experimental)
@Deprecated
package software.amazon.awscdk.services.s3objectlambda
Deprecated.
AWS::S3ObjectLambda Construct Library
---
AWS CDK v1 has reached End-of-Support on 2023-06-01. This package is no longer being updated, and users should migrate to AWS CDK v2.
For more information on how to migrate, see the Migrating to AWS CDK v2 guide.
This construct library allows you to define S3 object lambda access points.
import software.amazon.awscdk.services.lambda.*;
import software.amazon.awscdk.services.s3.*;
import software.amazon.awscdk.services.s3objectlambda.*;
import software.amazon.awscdk.core.*;
Stack stack = new Stack();
Bucket bucket = new Bucket(stack, "MyBucket");
Function handler = Function.Builder.create(stack, "MyFunction")
.runtime(Runtime.NODEJS_14_X)
.handler("index.handler")
.code(Code.fromAsset("lambda.zip"))
.build();
AccessPoint.Builder.create(stack, "MyObjectLambda")
.bucket(bucket)
.handler(handler)
.accessPointName("my-access-point")
.payload(Map.of(
"prop", "value"))
.build();
Handling range and part number requests
Lambdas are currently limited to only transforming GetObject requests. However, they can additionally support GetObject-Range and GetObject-PartNumber requests, which needs to be specified in the access point configuration:
import software.amazon.awscdk.services.lambda.*;
import software.amazon.awscdk.services.s3.*;
import software.amazon.awscdk.services.s3objectlambda.*;
import software.amazon.awscdk.core.*;
Stack stack = new Stack();
Bucket bucket = new Bucket(stack, "MyBucket");
Function handler = Function.Builder.create(stack, "MyFunction")
.runtime(Runtime.NODEJS_14_X)
.handler("index.handler")
.code(Code.fromAsset("lambda.zip"))
.build();
AccessPoint.Builder.create(stack, "MyObjectLambda")
.bucket(bucket)
.handler(handler)
.accessPointName("my-access-point")
.supportsGetObjectRange(true)
.supportsGetObjectPartNumber(true)
.build();
Pass additional data to Lambda function
You can specify an additional object that provides supplemental data to the Lambda function used to transform objects. The data is delivered as a JSON payload to the Lambda:
import software.amazon.awscdk.services.lambda.*;
import software.amazon.awscdk.services.s3.*;
import software.amazon.awscdk.services.s3objectlambda.*;
import software.amazon.awscdk.core.*;
Stack stack = new Stack();
Bucket bucket = new Bucket(stack, "MyBucket");
Function handler = Function.Builder.create(stack, "MyFunction")
.runtime(Runtime.NODEJS_14_X)
.handler("index.handler")
.code(Code.fromAsset("lambda.zip"))
.build();
AccessPoint.Builder.create(stack, "MyObjectLambda")
.bucket(bucket)
.handler(handler)
.accessPointName("my-access-point")
.payload(Map.of(
"prop", "value"))
.build();
Deprecated: AWS CDK v1 has reached End-of-Support on 2023-06-01.
This package is no longer being updated, and users should migrate to AWS CDK v2.
For more information on how to migrate, see https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html-
ClassDescription(experimental) An S3 object lambda access point for intercepting and transforming
GetObjectrequests.(experimental) A fluent builder forAccessPoint.(experimental) The access point resource attributes.A builder forAccessPointAttributesAn implementation forAccessPointAttributes(experimental) The S3 object lambda access point configuration.A builder forAccessPointPropsAn implementation forAccessPointPropsA CloudFormationAWS::S3ObjectLambda::AccessPoint.The alias of an Object Lambda Access Point.A builder forCfnAccessPoint.AliasPropertyAn implementation forCfnAccessPoint.AliasPropertyExample:A builder forCfnAccessPoint.AwsLambdaPropertyAn implementation forCfnAccessPoint.AwsLambdaPropertyA fluent builder forCfnAccessPoint.Example:A builder forCfnAccessPoint.ContentTransformationPropertyAn implementation forCfnAccessPoint.ContentTransformationPropertyA configuration used when creating an Object Lambda Access Point.A builder forCfnAccessPoint.ObjectLambdaConfigurationPropertyAn implementation forCfnAccessPoint.ObjectLambdaConfigurationPropertyIndicates whether this access point policy is public.A builder forCfnAccessPoint.PolicyStatusPropertyAn implementation forCfnAccessPoint.PolicyStatusPropertyThePublicAccessBlockconfiguration that you want to apply to this Amazon S3 account.A builder forCfnAccessPoint.PublicAccessBlockConfigurationPropertyAn implementation forCfnAccessPoint.PublicAccessBlockConfigurationPropertyA configuration used when creating an Object Lambda Access Point transformation.A builder forCfnAccessPoint.TransformationConfigurationPropertyAn implementation forCfnAccessPoint.TransformationConfigurationPropertyA CloudFormationAWS::S3ObjectLambda::AccessPointPolicy.A fluent builder forCfnAccessPointPolicy.Properties for defining aCfnAccessPointPolicy.A builder forCfnAccessPointPolicyPropsAn implementation forCfnAccessPointPolicyPropsProperties for defining aCfnAccessPoint.A builder forCfnAccessPointPropsAn implementation forCfnAccessPointProps(experimental) The interface that represents the AccessPoint resource.Internal default implementation forIAccessPoint.A proxy class which represents a concrete javascript instance of this type.