-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Cognito Construct: Add grant* methods #7112
Comments
Can you give more details on your use case? What do these lambda functions do? I am looking to see how we can organize these grant methods, and it looks like Cognito Identity Provider has quite a number of APIs. As an example, we have a number of grant methods organized by use case for S3 buckets, similar for Lambda functions and DynamoDB tables. |
As per the example code in my original post, they’re needing to use the API calls, in this case for a number of the ‘admin*’ methods in Cognito User Pools. Even if it was just a single grant method that had types that made it easy to add any of the valid methods (eg, array of enum type thing) |
I just figured this out too and got an answer from Gitter before finding this. My use case is "a user wants to grant another user permission to do something". In order to do that the other user has to be found using Cognito API calls in a lambda function. Once the user is found, update dynamodb with the relevant permission and ID of the other user. |
I think this explains why I've been getting a permission error on my lambda while trying to use AdminResetUserPassword. I'm setting a policy in CDK like this:
I'm still getting an access denied error though. Is this the same issue? Has there been any progress on this or other solutions? I tried posting in stackoverflow, but nothing yet. Glad I found this. Thanks! |
Here is my use case. I have a Lambda Function that is the handler for a serverless web backend. When the backend Lambda Function is invoked, I want it to be able to call Without the required permission, my Lambda Function is logging:
|
gh-274 Taken from the workaround in the issue description here: aws/aws-cdk#7112. My error noted here: aws/aws-cdk#7112 (comment)
Yep, our use-case is a fairly obvious one really. When we create a lambda to execute off the |
Why this feature has not been added yet :/ Even after paying people to write code seems like lot of work. Now I will have to create a new IAM policy and pass it to lambda so that it can access my user pool. It really sad @aws that these important features are not getting added even after years |
Thanks for the workaround @0xdevalias, this was an incredibly frustrating issue to try and work through. After 2 years could this maybe get actioned? |
Not sure if this ticket is outdated or if it has been implemented in the meantime, but this works for me: |
In CDK const userPool = UserPool.fromUserPoolId(this, 'UserPool', userPoolId) I can see that the |
This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue. |
It seems like CDK 2.x has a |
Hi. Does anyone have any use cases where the grant method is needed, along with supporting documentation? |
I've just looked up the codebase that I originally raised this for:
|
Unless the question is more related to this earlier question:
If we look at the CDK
It's been quite a while since I've worked on this code/with
And the high level goal was to, based on events sent from Stripe, be able to:
If I was to generalise that into a 'higher level category' that a |
Hi @0xdevalias! It seems like this issue was opened quite some time ago, and a lot has changed in the Cognito module since then. If your original issue has been addressed with the |
Comments on closed issues and PRs are hard for our team to see. |
As per #6765 (comment), the
UserPool
construct should havegrant*
methods on it to give other resources (eg. lambda functions) access to various API/SDK methods.Use Case
I want to be able to easily give my lambda functions access to call AWS API/SDK methods against my
UserPool
.Proposed Solution
References
CDK
Cognito
Based on:
eg.
Workaround:
Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: