ngneat / nx-serverless

🚀 The Ultimate Monorepo Starter for Node.js Serverless Applications
https://netbasal.com
MIT License
399 stars 26 forks source link

Dynamo #11

Closed iwarner closed 2 years ago

iwarner commented 2 years ago

Issue with Table generation

POST /dev/auth/sign-up (λ: sign-up) One of the tables was not found, verify table exists before retrying. Error: Cannot do operations on a non-existent table

Run the create user curl and get the above

NB// Also add docs about setting up AWS credentials and the defaults needed perhaps

NetanelBasal commented 2 years ago

Did you run npm run localstack?

jhonpedro commented 2 years ago

I did it over here and this error continues to happen.

What should happen when we run our docker-compose? It should create the tables?

NetanelBasal commented 2 years ago

It starts dynamodb, then you need to run npm run serve

jhonpedro commented 2 years ago

Strange that it doesn't work

But if the sls offline starts it, creates the Dynamo tables in the Localstack instance too?

NetanelBasal commented 2 years ago

Yes

ghost commented 2 years ago

I had the same issue. After running npm run localstack and npm run serve the dev-AppTable was not created. I'm not sure the process in which this would be created in the localstack env but the core service does not include a sls offline command.

The workaround for me was to use the NoSQL Workbench as described in the README.MD. Once you connect to your localstack dynamoDB, you can simply create the table.

I would, however, like to know how to automate this process so local development is not so manual if you need to add another table/queue/etc...

NetanelBasal commented 2 years ago

Interesting. I'll take a look.

NetanelBasal commented 2 years ago

npx nx deploy core --stage local

NetanelBasal commented 2 years ago

I added it to the docs.

ghost commented 2 years ago

Thanks! Does npx nx deploy core --stage local not deploy things to your cloud env?

I currently do not have a local aws profile. Is that something that needs to be setup?

NetanelBasal commented 2 years ago

No, this is how you deploy it to localstack. Yes, you need to create it and put dummy values.

ghost commented 2 years ago

Ah okay, makes sense. Ty for this.