Skip to content
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

Function resolver using AppSync's DDB tables #2575

Closed
TeoTN opened this issue Oct 12, 2019 · 3 comments
Closed

Function resolver using AppSync's DDB tables #2575

TeoTN opened this issue Oct 12, 2019 · 3 comments
Assignees
Labels
feature-request Request a new feature graphql-transformer-v1 Issue related to GraphQL Transformer v1

Comments

@TeoTN
Copy link

TeoTN commented Oct 12, 2019

Hey, I'm trying to define a mutation using function resolver created with amplify function add, that would perform a batch update on dynamodb tables created by appsync graphql api - I basically need to perform a few updates as one atomic operation.

When I call the mutation though, it fails with following error:

GraphQL error: User: arn:aws:sts::111111111111:assumed-role/appnameLambdaRole1234abcd-dev/appname-resolvers-dev is not authorized to perform: dynamodb:GetItem on resource: arn:aws:dynamodb:eu-west-1:111111111111:table/Tablename-dev

While I could attach appropriate policy to the role, it doesn't seem a good solution, I'd like to keep that in my code. I've tried using amplify function update but it doesn't let me allow the function to access the storage used by appsync.
How can I actually do this?

@attilah attilah added graphql-transformer-v1 Issue related to GraphQL Transformer v1 pending-triage Issue is pending triage question General question labels Oct 14, 2019
@kaustavghosh06
Copy link
Contributor

@TeoTN Currently the function module doesn't allow you to add/edit permissions for the DDB tables created by the GraphQL transformer. But there's a PR out for it - #2463 which would enable you to do that. For now you would have to maintain a custom stack to do this.

@kaustavghosh06 kaustavghosh06 self-assigned this Oct 17, 2019
@kaustavghosh06 kaustavghosh06 added feature-request Request a new feature and removed pending-triage Issue is pending triage question General question labels Oct 17, 2019
@kaustavghosh06
Copy link
Contributor

We recently added a feature to attach a trigger to the DDB tables generated by the GraphQL transformer. You can checkout the documentation out here - https://aws-amplify.github.io/docs/cli-toolchain/quickstart#as-a-part-of-the-graphql-api-types-with-model-annotation

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request a new feature graphql-transformer-v1 Issue related to GraphQL Transformer v1
Projects
None yet
Development

No branches or pull requests

3 participants