Testing Lambda Function Operations

  1. Access your target S3 bucket named book-image-stores-by-myself

    • Click the Upload button to begin the file upload process S3 Bucket Interface
  2. On the Upload interface

    • Select Add files to choose your images
    • After selection, click Upload to initiate the transfer Upload Interface
  3. Monitor the Lambda function execution and verify image processing completion Processing Status

  4. Navigate to your destination S3 bucket: book-image-resize-stores-by-myself

    • Locate and click on the processed image file Destination Bucket
  5. Access the Object URL to retrieve your processed image Object URL Location

  6. Note: You may encounter an Access Denied error at this stage Access Denied Error

  7. To enable public image access, configure the bucket policy:

    • Return to the bucket settings and select Permissions
    • Locate and click Edit in the Bucket policy section Bucket Permissions
    • Insert 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/*"
              }
          ]
      }
      
    • Confirm by clicking Save changes Policy Configuration
  8. After policy configuration, repeat steps 4 and 5 to download the processed image. Compare it with your original upload to verify that the Lambda resize function has performed correctly.