Chalice: Unable to connect with DynamoDB through pynamodb

0 votes

It works fine on my local machine with .aws configured. However, lambda is unable to connect with the dynamodb tables through the auto-generated iam role. I even tried adding a policy explicitly to the role via IAM console:

{
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": "dynamodb:*",
            "Resource": "arn:aws:dynamodb:ap-south-1:*:table/*"
}

But still getting this error (Debug Logs):

An error occurred (AccessDeniedException) on request (SQ60ECK3UMM6LLEBC2K04S6HE7VV4KQNSO5AEMVJF66Q9ASUAAJG) on table (lmk_staging_posts) when calling the DescribeTable operation:
2018-02-26 00:11:18.723000 3ca1b0 [DEBUG]       2018-02-25T18:41:18.722Z                Calling DescribeTable with arguments {'TableName': 'lmk_staging_posts'}
2018-02-26 00:19:16.045000 5e175a [DEBUG]       2018-02-25T18:49:16.45Z         Calling DescribeTable with arguments {'TableName': 'lmk_staging_posts'}
2018-02-26 00:19:16.110000 5e175a [DEBUG]       2018-02-25T18:49:16.110Z                Calling DescribeTable with arguments {'TableName': 'lmk_staging_comments'}
2018-02-26 00:19:16.157000 5e175a [DEBUG]       2018-02-25T18:49:16.157Z                Calling DescribeTable with arguments {'TableName': 'lmk_staging_groups'}
2018-02-26 00:19:16.200000 5e175a [DEBUG]       2018-02-25T18:49:16.199Z                Calling DescribeTable with arguments {'TableName': 'lmk_staging_user_profile'}

Sep 10, 2018 in AWS by bug_seeker
• 15,320 points
127 views

1 answer to this question.

0 votes

You have to add "autogen_policy":false, to config.json and put all your policies in policy-dev.json, for example:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "logs:CreateLogGroup",
        "logs:CreateLogStream",
        "logs:PutLogEvents",
        "s3:*",
        "dynamodb:*"
      ],
      "Resource": "*"
    }
  ]
}

In this way you setup your policies manually.

answered Sep 10, 2018 by Priyaj
• 56,200 points

Related Questions In AWS

+1 vote
1 answer

Do i need to use Amazon EC2 with DynamoDB?

You can use Amazon DynamoDB without restrictions ...READ MORE

answered Oct 11, 2018 in AWS by Archana
• 4,090 points
126 views
0 votes
1 answer

Unable to insert record in DynamoDB using a Json file in CLI

The best practice will be: running this command ...READ MORE

answered Feb 22 in AWS by Priyaj
• 56,200 points
32 views
0 votes
1 answer

Unable to connect to my windows instance

Maybe when you were installing different packages ...READ MORE

answered Mar 27 in AWS by Fuji
35 views
+1 vote
3 answers

Unable to login to parse dashboard on AWS

I had the same issue, which I ...READ MORE

answered Aug 28, 2018 in AWS by eatcodesleeprepeat
• 4,670 points
518 views
0 votes
1 answer

DynamoDB : The provided key element does not match the schema

The following applies to the Node.js AWS ...READ MORE

answered Nov 13, 2018 in AWS by Priyaj
• 56,200 points
1,830 views
0 votes
2 answers

Unable to insert item to DynamoDb from command Line

Basically your command line here is unable ...READ MORE

answered Feb 23 in AWS by Shashank
• 1,350 points
70 views