Testing Lambda Function Operations
Upload and Test Image in S3 Bucket
- Access S3 Bucket book-image-stores-by-myself:

- Click the Upload button to begin the upload process

- In the Upload interface:
- Select Add files to add files

- Select the image file to upload and click Upload

- Wait for Lambda Function to process:

- Check if the original image has been moved (source bucket will be empty)

Access Processed Image
- Open destination S3 Bucket book-image-resize-stores-by-myself:

- Find and select the processed image file

- Access the image:
- Click on Object URL to download the image

- Handle access error:
- You will receive an Access Denied message

- Set up Bucket policy:
- Return to Bucket configuration, select the Permissions tab
- Click Edit in the Bucket policy section

- Add the following JSON policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::book-image-resize-stores-by-myself/*"
}
]
}
- Click Save changes to save the policy

- Confirm the policy has been saved successfully

- Verify operation:
- Try accessing the Object URL again to view the image
- Compare the resized image with the original to verify the result
- Lambda Function resize has operated successfully
