1. Go to AWS IAM Console

  2. Find your Lambda’s role

    • Click on the role name
    • Click “Add permissions” → “Create inline policy”
  3. In the JSON editor, paste this policy:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "dynamodb:Scan",
                    "dynamodb:GetItem",
                    "dynamodb:Query"
                ],
                "Resource": "arn:aws:dynamodb:ap-southeast-2:6850********:table/user_list"
            }
        ]
    }
    
  4. Click “Review policy”

    • Name it something like “DynamoDBScanPolicy”
    • Click “Create policy”

After adding this policy, wait a few seconds and try your Lambda function again. The error should be resolved.


See also:

AWS Credentials for CLI

AWS STS - Temporary Access Tokens

Amazon DynamoDB - Create a Table

Amazon DynamoDB - Import CSV Data

AWS Lambda - Create a Function

AWS Lambda - Grant Access

API Gateway - Usage Plan

API Gateway - API Key

API Gateway - Configuration