Skip to content

Conversation

@kakakakakku
Copy link
Contributor

Issue #, if available:
N/A

Description of changes:
Hi😀 Thanks for the useful patterns!

To prevent future deployment issues, I updated the Lambda Node.js runtime version to nodejs22.x.

While testing terraform-s3-object-lambda, I noticed that the Lambda runtime version nodejs16.x was deprecated. Although it's still deployable at the moment, it will not be allowed after October 1, 2025.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

Check

terraform apply completed successfully and works good.

$ aws s3 cp ./images/sample.jpg s3://decent-raccoon-bucket --region eu-west-1
upload: images/sample.jpg to s3://decent-raccoon-bucket/sample.jpg

$ mkdir ./thumbs

$ aws s3api get-object --bucket resize-olap-i4x6dzs1zybd5unxx14qx7freuw1a--ol-s3 --key sample.jpg ./thumbs/sample-thumbnail.jpg --region eu-west-1
{
    "ContentLength": 31891,
    "ContentType": "text/plain",
    "Metadata": {}
}
image

Thank you😀


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Body: await resized.toBuffer(),
};
await s3.writeGetObjectResponse(params).promise();
await s3.send(new WriteGetObjectResponseCommand(params));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Some error occurs. Because in Node.js 18 and later runtimes, AWS SDK v3 is bundled, so I rewrote it to v3. See articles below.


```shell
mkdir ./thumbs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I added mkdir command because it had the following error.

$ aws s3api get-object --bucket decent-raccoon-bucket --key sample.jpg ./thumbs/sample-thumbnail.jpg --region eu-west-1
[Errno 2] No such file or directory: './thumbs/sample-thumbnail.jpg'

@marakere
Copy link
Contributor

@kakakakakku - Thank you for contributing and keep the pattern up to date.
When trying to access the thumbnail from S3 through the access point, it fails with Request failed with status code 403 when Lambda attempts to fetch from the presigned URL. Could you check the permissions in main.tf? It might be granting bucket access but not the access point permissions that Lambda needs to use the presigned URL.

@marakere
Copy link
Contributor

it would be beneficial to add the deployment steps (terraform init, plan, apply) and stack deletion commands for end users who will be using your pattern.

@kakakakakku
Copy link
Contributor Author

@marakere
Thank you for your replying😀

About the error, I created this pull request on 2025/08/23, but it seems that Amazon S3 Object Lambda cannot be newly used after 2025/11/07 for EOL. I am wondering if this service change is affecting the current behavior. What do you think?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants