Python CDK DynamoDB Table.grant_read_write doesn't include PartiQL permissions.

0

I am using the python CDK to grant a lambda function permissions to a DynamoDB table.

if I use: my_table.grant_read_write(my_lambda) the lambda fails with error "no identity-based policy allows the dynamodb:PartiQLUpdate action'"

however, if I use: my_table.grant_full_access(my_lambda) the lambda succeeds and I can confirm the updates were made.

I don't want to grant full access. I can add a inline policy to the lambda, but I am trying to understand why the builtin method doesn't work.

Why doesn't the read/write permissions cover the partiQL statements?

1개 답변
1

That is the current expected behavior:

  • BatchGetItem

  • GetRecords

  • GetShardIterator

  • Query

  • GetItem

  • Scan

  • BatchWriteItem

  • PutItem

  • UpdateItem

  • DeleteItem

Whereas grantFullAccess simply allows all: Permits all DynamoDB operations ("dynamodb:*") to an IAM principal.

In order to allow PartiQL operations you can do the following:

table.grant(my_lambda, 'dynamodb:PartiQLSelect');

Moreover, you can contribute to CDK to make amends as it is open source, or simply create a feature request on the GitHub: https://github.com/aws/aws-cdk

profile pictureAWS
전문가
답변함 3달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠