mardi 13 octobre 2015

Accessing s3 from java aws lambda

I'm trying to list keys on a s3 bucket from an aws lambda function written in Java. Running the code locally works fine (with hardcoded credentials).

When running the same code in an aws java (aws)lambda, it hangs at "listObjects"

        AmazonS3 s3client = new AmazonS3Client(new BasicAWSCredentials("XXXXXXXXXXXx", "XXXXXXXXXXZZZZZZZZZZz"));


        ListObjectsRequest listObjectsRequest = new ListObjectsRequest()
                .withBucketName(bucketName)
                .withMaxKeys(10);
        ObjectListing objectListing;

        do {
            objectListing = s3client.listObjects(listObjectsRequest);

The hardcoded user credentials and the lambda execution role both have full full access to s3.

Why hangs the s3 access without andy error / what permission configuration is wrong?

(Running something comparable in as nodejs lambda works)

Best wishes
stephan




Aucun commentaire:

Enregistrer un commentaire