0
votes

I am trying to walk through the tutorial. Why am I getting below error as below:

2016-04-16T16:49:28.286Z   2f034bdd-03f3-11e6-8855-c9c0e483eadd    Reading options from event:
 { Records: 
   [ { eventVersion: '2.0',
       eventTime: '1970-01-01T00:00:00.000Z',
       requestParameters: { sourceIPAddress: '127.0.0.1' },
       s3: 
        { configurationId: 'testConfigRule',
          object: 
           { eTag: '0123456789abcdef0123456789abcdef',
             sequencer: '0A1B2C3D4E5F678901',
             key: 'HappyFace.jpg',
             size: 1024 },
          bucket: 
           { arn: 'arn:aws:s3:::mybucket',
             name: 'sourcebucket',
             ownerIdentity: { principalId: 'EXAMPLE' } },
          s3SchemaVersion: '1.0' },
       responseElements: 
        { 'x-amz-id-2': 'EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH',
          'x-amz-request-id': 'EXAMPLE123456789' },
       awsRegion: 'us-east-1',
       eventName: 'ObjectCreated:Put',
       userIdentity: { principalId: 'EXAMPLE' },
       eventSource: 'aws:s3' } ] }
2016-04-16T16:49:28.327Z    2f034bdd-03f3-11e6-8855-c9c0e483eadd    Unable to resize sourcebucket/HappyFace.jpg and upload to sourcebucketresized/resized-HappyFace.jpg due to an error: AccessDenied: Access Denied
END RequestId: 2f034bdd-03f3-11e6-8855-c9c0e483eadd
REPORT RequestId: 2f034bdd-03f3-11e6-8855-c9c0e483eadd  Duration: 42.44 ms  Billed Duration: 100 ms     Memory Size: 1024 MB    Max Memory Used: 54 MB`
1

1 Answers

0
votes

I think the execution role that you have assinged to lambda doesn't have permission on the buckets you are using. You can try this like go to s3 bucket you are using and click the properties tab on right side and than go in permissions section.You can give appropriate access in that or for testing purpose you case give access to everyone. http://docs.aws.amazon.com/AmazonS3/latest/dev/intro-managing-access-s3-resources.html