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
amplify-meta.json
and see that while it's out of sync with your backend-config.json
it's strangely in sync with what seems to be happening in the CF Template.amplify env checkout …
to get amplify to read the changes on your local systemExpected 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.
Preemptively sorry for my semi sarcastic tone in my steps to repro, but this was an extremely frustrating thing to find, and honestly makes no sense to me as to why it is done this way.
If there’s a compelling reason that it is the way it is, could there at least be a comment put into the backend config that it only gets read when you do an env pull?
Hi @nagey we generally don't recommend modifying those files manually. Can you give us more information on what you were trying to do?
"generally don't recommend"?
Unless you mean modifying amplify-meta, which, yeah, I get. I was trying to pipe the endpoint URL of one of the rest services into a function, rather than just the endpoints "friendly" name.
@nagey Yes, the amplify-meta.json are runtime files which should not be modified. But yes, you're right the backend-config.json
has to be modified for adding custom resources/categories. And yes, as mentioned in step #4 of our documentation, we've mentioned to run amplify 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 your amplify push
process 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
wow. thanks for this... spent hours trying to figure out why suddenly adding sns to backend-config doesn't work... lol
goes into readme: run amplify env checkout
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 irfansenv
and then tried amplify push
again, then amplify finally asked me if I want to continue.
$ amplify -v
4.32.1
Most helpful comment
@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