Sagar
Sagar

Reputation: 4957

Cannot access stream arn:aws:dynamodb:us-east-2:144091332251:table/users/stream/2019-06-05T08:00:51.428

I want to trigger lambda function as soon as new records are inserted into dynamodb or existing record is updated. For the same, I'm using aws dynamodb stream features. I trying to do so but it throws me below error.

Cannot access stream arn:aws:dynamodb:us-east-2:144091332251:table/users/stream/2019-06-05T08:00:51.428. Please ensure the role can perform the GetRecords, GetShardIterator, DescribeStream, and ListStreams Actions on your stream in IAM. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: c88c1297-438b-11e1-a338-e57e98788b7c)

Upvotes: 4

Views: 7205

Answers (1)

Dikshit Kathuria
Dikshit Kathuria

Reputation: 1302

I think your IAM role misses necessary policy to access the streams.

Please follow the further steps if you are still getting the same error-

  1. Open your role that your DynamoDB stream lambda is using. You can find in in your Lambda function webpage at the bottom.

enter image description here

  1. Open this role in IAM console and click on Attach Policy.

enter image description here

  1. Add the following policy to it- "AWSLambdaDynamoDBExecutionRole"

This policy has the required permissionss that you need to be able to fire streams lambda. See, the JSON doc attached with this policy -

enter image description here

I hope, now it should work.

Hope it helps.

Upvotes: 11

Related Questions