# AWS::S3ObjectLambda Construct Library
<!--BEGIN STABILITY BANNER-->---
![End-of-Support](https://img.shields.io/badge/End--of--Support-critical.svg?style=for-the-badge)
> 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](https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html).
---
<!--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 as s3objectlambda
import aws_cdk.core as cdk
stack = cdk.Stack()
bucket = s3.Bucket(stack, "MyBucket")
handler = lambda_.Function(stack, "MyFunction",
runtime=lambda_.Runtime.NODEJS_14_X,
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 as s3objectlambda
import aws_cdk.core as cdk
stack = cdk.Stack()
bucket = s3.Bucket(stack, "MyBucket")
handler = lambda_.Function(stack, "MyFunction",
runtime=lambda_.Runtime.NODEJS_14_X,
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 as s3objectlambda
import aws_cdk.core as cdk
stack = cdk.Stack()
bucket = s3.Bucket(stack, "MyBucket")
handler = lambda_.Function(stack, "MyFunction",
runtime=lambda_.Runtime.NODEJS_14_X,
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",
"maintainer": "",
"docs_url": null,
"requires_python": "~=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Amazon Web Services",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/95/00/afc46024bcbf5eaa33d297fb6414e909ff8410406e7b59dc08bf2e13bb77/aws-cdk.aws-s3objectlambda-1.204.0.tar.gz",
"platform": null,
"description": "# AWS::S3ObjectLambda Construct Library\n\n<!--BEGIN STABILITY BANNER-->---\n\n\n![End-of-Support](https://img.shields.io/badge/End--of--Support-critical.svg?style=for-the-badge)\n\n> AWS CDK v1 has reached End-of-Support on 2023-06-01.\n> This package is no longer being updated, and users should migrate to AWS CDK v2.\n>\n> For more information on how to migrate, see the [*Migrating to AWS CDK v2* guide](https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html).\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 as s3objectlambda\nimport aws_cdk.core as cdk\n\nstack = cdk.Stack()\nbucket = s3.Bucket(stack, \"MyBucket\")\nhandler = lambda_.Function(stack, \"MyFunction\",\n runtime=lambda_.Runtime.NODEJS_14_X,\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 as s3objectlambda\nimport aws_cdk.core as cdk\n\nstack = cdk.Stack()\nbucket = s3.Bucket(stack, \"MyBucket\")\nhandler = lambda_.Function(stack, \"MyFunction\",\n runtime=lambda_.Runtime.NODEJS_14_X,\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 as s3objectlambda\nimport aws_cdk.core as cdk\n\nstack = cdk.Stack()\nbucket = s3.Bucket(stack, \"MyBucket\")\nhandler = lambda_.Function(stack, \"MyFunction\",\n runtime=lambda_.Runtime.NODEJS_14_X,\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": "1.204.0",
"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": "eb14be30e2e8b99ee6d865d7e960d197c45bf09fd290269b7e57c3e125d87c89",
"md5": "4561359ebffb6476c02bb0377a67cbac",
"sha256": "46341be1b55ac659789eeaf4f239ab6707a2665e48675efbdbbda1765da7bc32"
},
"downloads": -1,
"filename": "aws_cdk.aws_s3objectlambda-1.204.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4561359ebffb6476c02bb0377a67cbac",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.7",
"size": 74312,
"upload_time": "2023-06-19T21:01:02",
"upload_time_iso_8601": "2023-06-19T21:01:02.484553Z",
"url": "https://files.pythonhosted.org/packages/eb/14/be30e2e8b99ee6d865d7e960d197c45bf09fd290269b7e57c3e125d87c89/aws_cdk.aws_s3objectlambda-1.204.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9500afc46024bcbf5eaa33d297fb6414e909ff8410406e7b59dc08bf2e13bb77",
"md5": "afba22981e771afaeb2f8582547d8fdf",
"sha256": "7cbd99ceb48afe3f74f9b5e06ffe3927c39243baaddcd94418dda2384624988e"
},
"downloads": -1,
"filename": "aws-cdk.aws-s3objectlambda-1.204.0.tar.gz",
"has_sig": false,
"md5_digest": "afba22981e771afaeb2f8582547d8fdf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.7",
"size": 75152,
"upload_time": "2023-06-19T21:07:12",
"upload_time_iso_8601": "2023-06-19T21:07:12.939946Z",
"url": "https://files.pythonhosted.org/packages/95/00/afc46024bcbf5eaa33d297fb6414e909ff8410406e7b59dc08bf2e13bb77/aws-cdk.aws-s3objectlambda-1.204.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-19 21:07:12",
"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"
}