-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Item-level access for DynamoDB based on PK and cognito user pool username #10800
Comments
I was unable to achieve the same thing. Tried both |
I am facing the same. Any update on this issue? |
Marked as a feature request. |
@haverchuck Any update on this? This seems to be a pretty basic security pattern. |
Hi @beevor There's no update on the feature request yet. Amplify data category currently uses a different approach( To help us better prioritize this feature, can you describe how the proposed solution different to the existing owner based authorization rule? |
Hi @AllanZhengYP, Thanks for the quick reply. I am not using the Amplify Data category. I'm using CDK to create the API, and my schema and permissions will eventually become quite complex e.g., users in a group (not the owner) requiring temporary access to records owned by a different user. I felt that such patterns are easier handled via lamba resolvers. The identity tags approach ( |
@beevor Can you share more information on how you are using the Amplify library? I sounds to me that you are only using the Auth category and manage the DynamoDB yourself. Technically you can customize your CDK resource for identity pool, if you are using gen2, to achieve the resource access control supported by AWS. However when I look into this documentation from DynamoDB, I find it calls out:
Can you confirm this is a supported use case by DynamoDB? |
Thank you @AllanZhengYP. Indeed, the documentation states that DyamoDB does not support tag-based conditions. I wish I had seen that before I wasted time trying to get this to work. TL;DR: Tag-based conditions for dynamo is coming soon: announcement Before seeing the announcement, I saw solutions like this and this which imply that one can use tag-based conditions for the From my understanding, tags like For anyone reading this, one other thing to note is that All of this will be moot soon because of the announcement from AWS. They will soon implement tag-based conditions for dynamo. |
Is this related to another service?
DynamoDB, Amplify, API Gateway, Cognito
Describe the feature you'd like to request
Objective
Create a Policy to provide item-level access to the dynamodb using PrincipalTag and User Pool username. Users can access data only if the PK of dynamodb contains the User’s username.
Services
Amplify
,Cognito user-identity pool
,API Gateway
,DynamoDB
,Lambda
Describe the solution you'd like
trust policy
policy
Describe alternatives you've considered
Need to be able to add a policy that will allow items in dyamodb based on Cognito user pool username
Additional context
Error:
ClientError: An error occurred (AccessDeniedException) when calling the Query operation ... is not authorized to perform: dynamodb:Query on resource .... because no identity-based policy allows the dynamodb:Query action
The text was updated successfully, but these errors were encountered: