Creating a Lambda Function for Image Processing
Creating a Lambda Function
- Navigate to AWS Lambda Console and select Create function.

- On the Create function page:
- Select Author from scratch
- Name your function (e.g., resize-image)
- Choose Node.js 24.x as the Runtime
- Keep other settings at their defaults and click Create function


Configuring Source Code
Download the sample source code: function.zip
On the resize-image page:
- Select Upload from
- Choose .zip file

- In the Upload a .zip file dialog:
- Click Upload and select your downloaded source code file
- Click Save to confirm

Setting Up the Environment
- On the resize-image function page:
- Switch to the Configuration tab
- Select Environment variables from the left menu
- Click Edit


- On the Edit environment variables page:
- Add the following environment variables:
- WIDTH: New image width (e.g., 200px)
- HEIGHT: New image height (e.g., 280px)
- DES_BUCKET: Destination S3 bucket name (e.g., book-image-resize-stores-by-myself)
- Click Save to apply the configuration

Next Steps
After completing the Lambda function configuration and environment variables setup, the next step is to create S3 buckets for storing both original and processed images.