Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

505
Views
AccessDeniedException: User is not authorized to perform dynamodb BatchWriteItem on resource: table

I am using nodejs, serverless and aws dynamodb. I am trying to create a lambda where I am calling an API, getting the data (1000 records) and now, I want to insert this data into my dynamodb.

I am using batchWrite for this and using it by creating buckets of 25 json objects each. But I am getting an error:
AccessDeniedException: <Username> is not authorized to perform dynamodb BatchWriteItem on resource <table-name>

When I do the same without batchWrite and individual PUT operations, it works fine (but I need to use batch because that gives throughput exceeded error).

I have given all administrative rights in AWS to the user which I am using with serverless.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

in your serverless.yml file, you should add a new role

    - Effect: Allow
  Action:
    - dynamodb:DescribeTable
    - dynamodb:Query
    - dynamodb:Scan
    - dynamodb:GetItem
    - dynamodb:PutItem
    - dynamodb:UpdateItem
    - dynamodb:DeleteItem
    - dynamodb:BatchWriteItem
  Resource: "arn:aws:dynamodb:${self:custom.region}:*:table/*"
over 4 years ago · Santiago Trujillo Report

0

Here is how I set it when using Amplify CLI project:

{
    "Effect": "Allow",
    "Action": [
        "dynamodb:PutItem",
        "dynamodb:DeleteItem",
        "dynamodb:GetItem",
        "dynamodb:Query",
        "dynamodb:Scan",
        "dynamodb:UpdateItem",
        "dynamodb:BatchWriteItem",
        "dynamodb:Scan"
    ],
    "Resource": "arn:aws:dynamodb:*:*:table/*"
},
{
    "Effect": "Allow",
    "Action": "dynamodb:Query",
    "Resource": "arn:aws:dynamodb:*:*:table/*/index/*"
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!