# AWS::S3ObjectLambda Construct Library
<!--BEGIN STABILITY BANNER-->---
![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)
> 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](https://semver.org/) 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.
---
<!--END STABILITY BANNER-->
This construct library allows you to define S3 object lambda access points.
```python
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:
```python
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:
```python
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"
}
)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/aws/aws-cdk",
"name": "aws-cdk.aws-s3objectlambda-alpha",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Amazon Web Services",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/1c/bf/fbbb8b0613a42c58e32d691abe1c1976d66caf8e3581144b98b22cfc7330/aws_cdk_aws_s3objectlambda_alpha-2.170.0a0.tar.gz",
"platform": null,
"description": "# AWS::S3ObjectLambda Construct Library\n\n<!--BEGIN STABILITY BANNER-->---\n\n\n![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n<!--END STABILITY BANNER-->\n\nThis construct library allows you to define S3 object lambda access points.\n\n```python\nimport aws_cdk.aws_lambda as lambda_\nimport aws_cdk.aws_s3 as s3\nimport aws_cdk.aws_s3objectlambda_alpha as s3objectlambda\nimport aws_cdk as cdk\n\nstack = cdk.Stack()\nbucket = s3.Bucket(stack, \"MyBucket\")\nhandler = lambda_.Function(stack, \"MyFunction\",\n runtime=lambda_.Runtime.NODEJS_LATEST,\n handler=\"index.handler\",\n code=lambda_.Code.from_asset(\"lambda.zip\")\n)\ns3objectlambda.AccessPoint(stack, \"MyObjectLambda\",\n bucket=bucket,\n handler=handler,\n access_point_name=\"my-access-point\",\n payload={\n \"prop\": \"value\"\n }\n)\n```\n\n## Handling range and part number requests\n\nLambdas 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:\n\n```python\nimport aws_cdk.aws_lambda as lambda_\nimport aws_cdk.aws_s3 as s3\nimport aws_cdk.aws_s3objectlambda_alpha as s3objectlambda\nimport aws_cdk as cdk\n\nstack = cdk.Stack()\nbucket = s3.Bucket(stack, \"MyBucket\")\nhandler = lambda_.Function(stack, \"MyFunction\",\n runtime=lambda_.Runtime.NODEJS_LATEST,\n handler=\"index.handler\",\n code=lambda_.Code.from_asset(\"lambda.zip\")\n)\ns3objectlambda.AccessPoint(stack, \"MyObjectLambda\",\n bucket=bucket,\n handler=handler,\n access_point_name=\"my-access-point\",\n supports_get_object_range=True,\n supports_get_object_part_number=True\n)\n```\n\n## Pass additional data to Lambda function\n\nYou 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:\n\n```python\nimport aws_cdk.aws_lambda as lambda_\nimport aws_cdk.aws_s3 as s3\nimport aws_cdk.aws_s3objectlambda_alpha as s3objectlambda\nimport aws_cdk as cdk\n\nstack = cdk.Stack()\nbucket = s3.Bucket(stack, \"MyBucket\")\nhandler = lambda_.Function(stack, \"MyFunction\",\n runtime=lambda_.Runtime.NODEJS_LATEST,\n handler=\"index.handler\",\n code=lambda_.Code.from_asset(\"lambda.zip\")\n)\ns3objectlambda.AccessPoint(stack, \"MyObjectLambda\",\n bucket=bucket,\n handler=handler,\n access_point_name=\"my-access-point\",\n payload={\n \"prop\": \"value\"\n }\n)\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "The CDK Construct Library for AWS::S3ObjectLambda",
"version": "2.170.0a0",
"project_urls": {
"Homepage": "https://github.com/aws/aws-cdk",
"Source": "https://github.com/aws/aws-cdk.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4c78b01d168c6e51d9c2ca5eb3b4acceaaafe4dd1e8d2b91d955906ff00d0b3c",
"md5": "742166e153f19fdf8d5b50962abee580",
"sha256": "92a92dff5d367684dd2dceb63329c85faef6599f7c1ec3a9b9f49bcb70ab5fdd"
},
"downloads": -1,
"filename": "aws_cdk.aws_s3objectlambda_alpha-2.170.0a0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "742166e153f19fdf8d5b50962abee580",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.8",
"size": 42981,
"upload_time": "2024-11-22T04:41:57",
"upload_time_iso_8601": "2024-11-22T04:41:57.743342Z",
"url": "https://files.pythonhosted.org/packages/4c/78/b01d168c6e51d9c2ca5eb3b4acceaaafe4dd1e8d2b91d955906ff00d0b3c/aws_cdk.aws_s3objectlambda_alpha-2.170.0a0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1cbffbbb8b0613a42c58e32d691abe1c1976d66caf8e3581144b98b22cfc7330",
"md5": "3c37233e50dff73158321714ab23429d",
"sha256": "6e9d03bb31c67c7463f6a2ec8ce7e5f83caf450a102b9b9ee8101632b852b593"
},
"downloads": -1,
"filename": "aws_cdk_aws_s3objectlambda_alpha-2.170.0a0.tar.gz",
"has_sig": false,
"md5_digest": "3c37233e50dff73158321714ab23429d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 43726,
"upload_time": "2024-11-22T04:42:42",
"upload_time_iso_8601": "2024-11-22T04:42:42.189791Z",
"url": "https://files.pythonhosted.org/packages/1c/bf/fbbb8b0613a42c58e32d691abe1c1976d66caf8e3581144b98b22cfc7330/aws_cdk_aws_s3objectlambda_alpha-2.170.0a0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-22 04:42:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aws",
"github_project": "aws-cdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aws-cdk.aws-s3objectlambda-alpha"
}