Reproduction Steps
myTable.grantReadData(myLambda);
Then we query on a secondary index on myTable and get
What did you expect to happen?
Expected the lambda to be able to query the table, including on secondary indices.
What actually happened?
Environment
- CDK CLI Version : v1.89.0
- Framework Version: v1.89.0
- Node.js Version: v15.10.0
- OS : MacOS
- Language (Version): TypeScript (4.2.2)
Other
Resolved / workaround by adding
myLambda.addToRolePolicy(
new iam.PolicyStatement({
actions: ['dynamodb:Query'],
resources: [`${myTable.arn}/index/*`],
}),
);
The fix probably belongs somewhere near
This is 🐛 Bug Report
Reproduction Steps
Then we query on a secondary index on myTable and get
What did you expect to happen?
Expected the lambda to be able to query the table, including on secondary indices.
What actually happened?
Environment
Other
Resolved / workaround by adding
The fix probably belongs somewhere near
aws-cdk/packages/@aws-cdk/aws-dynamodb/lib/table.ts
Line 906 in 0ea4b19
This is 🐛 Bug Report