-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
S3-java example to rename file uses incorrect destination bucket name here: https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/s3-java/src/main/java/example/Handler.java#L54
It should be:
String dstBucket = srcBucket + "-resized";
Otherwise it ends up using srcBucket as desBucket and Lambda function runs in loop causing below error:
If your Lambda function uses the same bucket that triggers it, it could cause the function to execute in a loop. For example, if the bucket triggers a function each time an object is uploaded, and the function uploads an object to the bucket, then the function indirectly triggers itself. To avoid this, use two buckets, or configure the trigger to only apply to a prefix used for incoming objects.