Skip to content

Bug in s3-java example #173

@anarwal

Description

@anarwal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions