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

Can't access DynamoDB tables created by GraphQL API on a new lambda function #3693

Closed
idanlo opened this issue Mar 18, 2020 · 13 comments
Closed
Labels
api-rest Issues tied to REST APIs feature-request Request a new feature functions Issues tied to the functions category pending-review Pending review from core-team

Comments

@idanlo
Copy link

idanlo commented Mar 18, 2020

Describe the bug
Whenever creating a new lambda function using amplify add function or adding a REST API using amplify add api and choosing REST, the CLI asks for a function template to use, and when I choose CRUD function for Amazon DynamoDB table (Integration with Amazon API Gateway and Amazon DynamoDB) and I try to use existing DynamoDB tables, it says there aren't any tables. I guess you could use #2463 in order to make it work for creating lambda functions for accessing tables, and not just triggers for tables.

To Reproduce
amplify add api, choose GraphQL, create some @models, then amplify add api, choose REST, and use CRUD function for Amazon DynamoDB table (Integration with Amazon API Gateway and Amazon DynamoDB) as template, select DynamoDB table configured in the current Amplify project and you get an error.

Expected behavior
The user should be able to see a list of all tables, also tables created using the @model directive on the GraphQL schema

@UnleashedMind
Copy link
Contributor

I will mark this as an enhancement.
In the current implementation, only DynamoDB tables created using the amplify storage category is checked.

@UnleashedMind UnleashedMind added enhancement api-rest Issues tied to REST APIs functions Issues tied to the functions category pending-review Pending review from core-team labels Mar 18, 2020
@iShavgula
Copy link

I'm using amplify version 4.16.1 and this works for me.

@idanlo
Copy link
Author

idanlo commented Mar 20, 2020

@iShavgula Are you sure? can you share a screenshot of a lambda function creation with access to DynamoDB tables created by AppSync?

@iShavgula
Copy link

Capture d’écran 2020-03-20 à 13 02 06

@idanlo
Copy link
Author

idanlo commented Mar 20, 2020

@iShavgula That's amazing, I didn't know it was in the storage category. This helps a lot, I was doing it manually until now. Weird how @UnleashedMind marked this as an enhancement if it already exists

@idanlo
Copy link
Author

idanlo commented Mar 20, 2020

@iShavgula I tried doing this all along, guess I needed to create a Hello World function
image

@iShavgula
Copy link

@idanlo it has not been long time since it’s available, maybe couple of days.

@idanlo idanlo closed this as completed Mar 23, 2020
@davidhgray
Copy link

i would also like to see this functionality described by @idanlo. i have an IoT device that can only write a REST API (i.e., POST), but i want to be able to read that data on a mobile device using AppSync/GraphQL. so two different APIs (GQL and REST) need to be able to talk to the same DynamoDB. i created the DB using "amplify create api" > "graphql ", and now need to create a REST API that points to that @model-created DB.

@idanlo
Copy link
Author

idanlo commented Jul 13, 2020

@davidhgray look at the comments above, there is an image showing how to do that

@davidhgray
Copy link

davidhgray commented Jul 13, 2020

@idanlo for some reason, at the "select the category" step, when i select "storage", no DBs are shown to me. it's as if the CLI is just skipping this step.
Screenshot from 2020-07-13 01-15-51

@idanlo
Copy link
Author

idanlo commented Jul 13, 2020

@davidhgray maybe you should create a new issue, this one is already buried in the list and no one will see it if I re open

@ripley
Copy link

ripley commented Sep 30, 2020

From the image you have not selected "storage" category. Need to press space to select when the item is highlighted.

@idanlo for some reason, at the "select the category" step, when i select "storage", no DBs are shown to me. it's as if the CLI is just skipping this step. Screenshot from 2020-07-13 01-15-51

@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 25, 2021
@josefaidt josefaidt added feature-request Request a new feature and removed enhancement labels Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-rest Issues tied to REST APIs feature-request Request a new feature functions Issues tied to the functions category pending-review Pending review from core-team
Projects
None yet
Development

No branches or pull requests

6 participants