Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

AWS::S3ObjectLambda Construct Library

---

cdk-constructs: Experimental

The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


This construct library allows you to define S3 object lambda access points.

import aws_cdk.aws_lambda as lambda_
import aws_cdk.aws_s3 as s3
import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
import aws_cdk as cdk

stack = cdk.Stack()
bucket = s3.Bucket(stack, "MyBucket")
handler = lambda_.Function(stack, "MyFunction",
    runtime=lambda_.Runtime.NODEJS_LATEST,
    handler="index.handler",
    code=lambda_.Code.from_asset("lambda.zip")
)
s3objectlambda.AccessPoint(stack, "MyObjectLambda",
    bucket=bucket,
    handler=handler,
    access_point_name="my-access-point",
    payload={
        "prop": "value"
    }
)

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 aws_cdk.aws_lambda as lambda_
import aws_cdk.aws_s3 as s3
import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
import aws_cdk as cdk

stack = cdk.Stack()
bucket = s3.Bucket(stack, "MyBucket")
handler = lambda_.Function(stack, "MyFunction",
    runtime=lambda_.Runtime.NODEJS_LATEST,
    handler="index.handler",
    code=lambda_.Code.from_asset("lambda.zip")
)
s3objectlambda.AccessPoint(stack, "MyObjectLambda",
    bucket=bucket,
    handler=handler,
    access_point_name="my-access-point",
    supports_get_object_range=True,
    supports_get_object_part_number=True
)

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 aws_cdk.aws_lambda as lambda_
import aws_cdk.aws_s3 as s3
import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
import aws_cdk as cdk

stack = cdk.Stack()
bucket = s3.Bucket(stack, "MyBucket")
handler = lambda_.Function(stack, "MyFunction",
    runtime=lambda_.Runtime.NODEJS_LATEST,
    handler="index.handler",
    code=lambda_.Code.from_asset("lambda.zip")
)
s3objectlambda.AccessPoint(stack, "MyObjectLambda",
    bucket=bucket,
    handler=handler,
    access_point_name="my-access-point",
    payload={
        "prop": "value"
    }
)

Accessing the S3 AccessPoint ARN

If you need access to the s3 accesspoint, you can get its ARN like so:

import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda

# access_point: s3objectlambda.AccessPoint
s3_access_point_arn = access_point.s3_access_point_arn

This is only supported for AccessPoints created in the stack - currently you're unable to get the S3 AccessPoint ARN for imported AccessPoints. To do that you'd have to know the S3 bucket name beforehand.

Metadata

Release files for aws-cdk.aws-s3objectlambda-alpha 2.262.2a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aws-cdk.aws-s3objectlambda-alpha 2.262.2a0
File Size Uploaded Provenance Actions
aws_cdk_aws_s3objectlambda_alpha-2.262.2a0.tar.gz 55.9 kB Without provenance Details for aws_cdk_aws_s3objectlambda_alpha-2.262.2a0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aws-cdk.aws-s3objectlambda-alpha 2.262.2a0
File Interpreter ABI Platform Actions
aws_cdk_aws_s3objectlambda_alpha-2.262.2a0-py3-none-any.whl Python 3 none any Details for aws_cdk_aws_s3objectlambda_alpha-2.262.2a0-py3-none-any.whl

Total release size: 110.5 kB

Release files / aws_cdk_aws_s3objectlambda_alpha-2.262.2a0.tar.gz

Download URL aws_cdk_aws_s3objectlambda_alpha-2.262.2a0.tar.gz
Size 55.9 kB
Tags Source
SHA-256 checksum
How to use checksums
25c5d2fbbd2af111f57a796d7fb4801d36b1ea465fb00d20bc3eb0f33a032d24
BLAKE2b-256 checksum
How to use checksums
9a6853cced242e7b6a325c1a27d4f4a33a290dc7dbd47102b3dd9d0bfb4b1fa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / aws_cdk_aws_s3objectlambda_alpha-2.262.2a0-py3-none-any.whl

Download URL aws_cdk_aws_s3objectlambda_alpha-2.262.2a0-py3-none-any.whl
Size 54.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8808f3db4ab717f32827f9dd456d779018ef35eb7d3a8660eb2db847369480db
BLAKE2b-256 checksum
How to use checksums
7ab5eb1d6dfff8e654f74de2ccdbf2c5cfd9df4e3fc874373e3b9a8d9b48eab5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for aws-cdk.aws-s3objectlambda-alpha 2.262.2a0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page