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

update-stack not updating data even though JSON has been changed (now more of a feature request to tell people how to update the db.json on AWS) #829

Open
dwertheimer opened this issue Sep 17, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@dwertheimer
Copy link

dwertheimer commented Sep 17, 2021

Describe the bug
update-stack seems to deploy but does not actually update the JSON data in the API. Note: running locally works perfectly. Swagger shows proper data locally but not on AWS version after update-stack. Maybe worth noting that the db.json in the deployment folder has been updated. Just seems that it's not being uploaded/deployed. As a work-around, I am having to create a brand new Lambda stack every time I edit the JSON (can't keep doing)

To Reproduce

Deploy a JSON jsonsls create-stack ../DB/db.all--.json
Make a change to the JSON shape.
Run local:
jsonsls run ../DB/db.all--.json
[Works great]

Update the deploy with the exact same DB:
jsonsls update-stack ../DB/db.all--.json
...passes all the tests and "deploys", but the deployment is the old JSON data
Have done this several times. Does not update the API. Swagger still shows old fields and old results (using the new link that the script generates)

Check AWS Identity... done

  ✔ Validate JSON Serverless Directory
  ✔ Copy Template Files
  ✔ Update AuthSettings
  ✔ Update Appconfig
  ✔ Validate JSON Serverless Directory
  ✔ Validate JSON Serverless Directory
  ✔ Validate JSON Serverless Directory
  ✔ Copy Template Files
  ✔ Update AuthSettings
  ✔ Update Appconfig
  ✔ Update Dependencies
  ✔ Build Code
  ✔ Deploy Stack on AWS

The Api proto-api has been successfully deployed

Check swagger (using the new link provided in the terminal after deploy). See nothing has changed

Expected behavior
jsonsls would update the swagger and API with the new JSON data

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • MacOS, Node 14.9.0
@pharindoko
Copy link
Owner

Hey David,

please delete the file in the s3 bucket after you executed the stack update.
After that the first request will recreate the file in the s3 bucket with the new content.

You can chain this together as well...

  1. sls update-stack
  2. aws s3 rm
  3. curl api-url

Hope this helps.

br,

pharindoko

@dwertheimer
Copy link
Author

dwertheimer commented Sep 17, 2021 via email

@dwertheimer dwertheimer changed the title update-stack not updating data even though JSON has been changed update-stack not updating data even though JSON has been changed (now more of a feature request to tell people how to update the db.json on AWS) Sep 18, 2021
@pharindoko
Copy link
Owner

I remember that I had describe it in the readme:
https://github.com/pharindoko/json-serverless#update-content-of-dbjson

But you`re right - when you wrote this I thought the same.
Would be nice to make this easier and give the user the choice to update the file immediately.
Additionally the versioning for the bucket can be set. So no data loss but direct updates.

@pharindoko pharindoko self-assigned this Sep 24, 2021
@pharindoko pharindoko added the enhancement New feature or request label Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants