Navigate to S3 bucket: book-image-stores
Click Add files
Select image to upload, then click Upload
Wait for the Lambda function running, then check whether the image has been deleted
Navigate to S3 bucket: book-image-resize-stores
Click Object URL to download image
But error occurs - Access Denied.
To download image, need add policy for bucket to allow public access.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::book-image-resize-stores/*"
}
]
}
Then, repeat steps 6 and 7 to download image to local to download an image to your device to compare it with the one you’ve already uploaded. So Lambda resizes function is working properly.