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,520 points
1,800 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
• 58,090 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,170 points
1,920 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, 2019 in AWS by Priyaj
• 58,090 points
1,508 views
0 votes
1 answer

Unable to connect to my windows instance

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

answered Mar 27, 2019 in AWS by Fuji
356 views
0 votes
1 answer

EC2 instance unable to connect to internet - aws

The security group attached to the instance’s ...READ MORE

answered Oct 9, 2019 in AWS by Neel
977 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
• 58,090 points
31,802 views
0 votes
1 answer
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, 2019 in AWS by Shashank
• 1,370 points
3,646 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP