amplify-cli: `amplify push` doesn't read from `backend-config`, but does read from `amplify-meta`
Describe the bug
When running amplify push I expect it to consult the backend-config.json file, especially the dependsOn array for various services.
Apparently though, running amplify env checkout … is the magic sauce to convert the items in backend-config into amplify-meta.
Amplify CLI Version 4.13.1
To Reproduce
- Make a change to your backend-config.json.
- Push to the cloud.
- Stare at your cloudformation stacks in the console, wonder why change isn’t being reflected
- Deliberately break backend-config.json
- push to the cloud. not broken.
- google a bunch of things
- get frustrated
- have dinner
- come back, and repeat steps 1-7
- On a whim, look at
amplify-meta.jsonand see that while it’s out of sync with yourbackend-config.jsonit’s strangely in sync with what seems to be happening in the CF Template. - Finally have someone point out to you the 4th item #1 under https://aws-amplify.github.io/docs/cli-toolchain/quickstart#custom-cloudformation-stacks and see the bit about having to run
amplify env checkout …to get amplify to read the changes on your local system
Expected behavior
The build processes associated with amplify push should read backend-config in a similar fashion to how it reads all of the various cloudformation templates, schemas, functions, and everything else that’re kept in source control.
Additional context I would really like to get these three hours back, but they’re gone forever, sitting contently in a nice crowded room with all of the other (numerous) hours that I’ve lost to poorly documented, or buggy, pieces of the amplify codebase.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 1
- Comments: 16 (5 by maintainers)
@nagey Yes, the amplify-meta.json are runtime files which should not be modified. But yes, you’re right the
backend-config.jsonhas to be modified for adding custom resources/categories. And yes, as mentioned in step #4 of our documentation, we’ve mentioned to runamplify env checkout <env-name>after making any changes to your backend-config.json. But at the same time, I agree this could be a part of youramplify pushprocess to make the experience better.@kaustavghosh06 I’ve made sure to add the checkout step to our workflow when changing resources, but would love to hear it getting added to the amplify push
I have a custom stack to take care of assigning permissions to my Cognito user groups and Lambda functions. This issue bit me 6 months ago, today I added a new Lambda function and it bites me again. I’ve lost at least a day because of this…
backend-config.jsonis not a file developers update everyday, WHO ON EARTH WOULD REMEMBER TO RUNamplify env checkoutAFTER SIX MONTHS??!!amplify pushshould updateamplify-meta.jsonautomatically! Does it make sense for anyone to updatebackend-config.jsonbut not want the change to take effect the next time they push? If making it fully automatic is not possible (I’d love to know why), the push command should at least check ifbackend-config.jsonhas been updated and warn the user in bold red text to run checkout.Before Amplify fixes this problem, for anyone who wants to add a reminder for themselves, you can comment in
backend-config.json, for example I added the following comment to mine:@kaustavghosh06 any update on this? 2 years after your messages and
amplify-meta.jsonis still not updated afteramplify pushI just burned 8 hours on this issue. Can we please prioritize to update amplify-meta.json on
amplify pushI just burned 6 hours on similar problem, it was a badly performd merge (from a conflict) on backend-config.json that got me.
amplify push should rebuild everything and not leave some changes unbuilt.
I have had same issue today, even you don’t have to go to aws console, you can see in your terminal output that there is nothing to push.
I executed
amplify env checkout irfansenvand then triedamplify pushagain, then amplify finally asked me if I want to continue.$ amplify -v 4.32.1