Skip to content

Commit 7c99ff7

Browse files
teriufwang
andauthored
Added BUCKET_NAME & IAM details to Readme (#42)
* Added BUCKET_NAME & IAM details to Readme * Sync --------- Co-authored-by: Frank <wangfanjie@gmail.com>
1 parent db0cbb3 commit 7c99ff7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ public,max-age=0,s-maxage=31536000,must-revalidate
115115

116116
#### Image optimization function
117117

118-
Create a Lambda function using the code in the `.open-next/image-optimization-function` folder, with the handler `index.mjs`. Ensure that the **arm64** architecture is used.
118+
Create a Lambda function using the code in the `.open-next/image-optimization-function` folder, with the handler `index.mjs`. Also, ensure that the function is configured as follows:
119+
120+
- Set the architecture to `arm64`.
121+
- Set the `BUCKET_NAME` environment variable with the value being the name of the S3 bucket where the original images are stored.
122+
- Grant `s3:GetObject` permission.
119123

120124
This function handles image optimization requests when the Next.js `<Image>` component is used. The [sharp](https://www.npmjs.com/package/sharp) library, which is bundled with the function, is used to convert the image. The library is compiled against the `arm64` architecture and is intended to run on AWS Lambda Arm/Graviton2 architecture. [Learn about the better cost-performance offered by AWS Graviton2 processors.](https://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/)
121125

0 commit comments

Comments
 (0)