I'm working with the amplify cli
for a month now and to be honest it has been getting a frustrating process.
If you have let's say around 5 different types and a couple of connections things get tricky.
When I removed a named @connection you have to remove both ends.
about 90% of my push commands ended up in a Resource is not in the state stackUpdateComplete
Most of the times because of there was a resolver that couldn't be deleted.
If you mess around manually on the Appsync side, thinks get completely out of sync with your project and I ended up having to delete the whole stack.
It would be nice to be able to do a amplify push --force
to mark the local schema as leading structure. Or the other way around, tweaking thinks in AppSync and do amplify pull
to get it properly synced it locally.
amplify env pull ENV_NAME --restore
currently exists, does this help your use case?
I didn't know that option was available
This pulls in the latest graph structure that is made in AppSync?
I had this situation before, and i ended up recreating the stack.
@jkeys-ecg-nmsu - it will pull the wrong version, what we want to to overwrite the wrong one.
@kaustavghosh06 @junejie that sounds different from the behavior described here.
Are you sure you didn't push your changes to the cloud before trying a --restore?
similar issue.
A push to one environment previously failed and now each time a do a amplify push
I get
UPDATE_FAILED apiaaaVolunteer AWS::CloudFormation::Stack Fri May 08 2020 18:15:58 GMT-0400 (Eastern Daylight Time) Parameters: [PiloteBaseURL] do not exist in the template
...
Following resources failed
✖ An error occurred when pushing the resources to the cloud
Resource is not in the state stackUpdateComplete
An error occurred during the push operation: Resource is not in the state stackUpdateComplete
But then, right after, amplify status
reports No Change
for all resources.
Current Environment: ci
| Category | Resource name | Operation | Provider plugin |
| -------- | --------------------------------------- | --------- | ----------------- |
| Auth | aaaVolunteer | No Change | awscloudformation |
| Api | aaaVolunteer | No Change | awscloudformation |
| Function | aaaVolunteerCreateAuthChallenge | No Change | awscloudformation |
| Function | aaaVolunteerDefineAuthChallenge | No Change | awscloudformation |
| Function | aaaVolunteerPreSignup | No Change | awscloudformation |
| Function | aaaVolunteerVerifyAuthChallengeResponse | No Change | awscloudformation |
I do not know I to repair the Environment except recreating it altogether.
I want my git repository to be the single source of truth and thus a command like amplify push --force
would help reset an environment to the state in the git.
Same problem as @Nr9
+1 for --force
option. I often get into situations where I mess up something and there is no way to fix it without blowing everything away.
@amcdnl assuming you mean mess up something _locally_, I believe the new-ish amplify pull
command will get you out of hot water.
While powerful, Amplify is delicate and temperamental at best. A --force option is desperately needed. I am trying to add a composite key to an existing model and it fails. SO suggestions are to remove the model. I did this and now I have
An error occurred when pushing the resources to the cloud
Attempting to edit the key schema of the DeckTable table in the Deck stack.
An error occurred during the push operation: Attempting to edit the key schema of the DeckTable table in the Deck stack.
Which as an error message is a waste of characters on my screen. A force would have allowed me to overwrite and get my changes through.
Since there is no way of overwriting or undoing I have to recreate my entire project from scratch again.
@tforster - 100% agree. I got into a similar situation too.
Would also need a force push when working on a graphql transformer. I don't want to each time go to the schema add an empty line or remove an empty line to force the cli to discover a change and allow me to push :(
For getting back into your last successful push state, you can run amplify env pull --restore
command. Is that something you've tried before and what issues have you'll seen with it?
Also, there exists a amplify push --force
command today - for force pushing changes made outside the schema or CloudFormation template.
Most helpful comment
similar issue.
A push to one environment previously failed and now each time a do a
amplify push
I getBut then, right after,
amplify status
reportsNo Change
for all resources.I do not know I to repair the Environment except recreating it altogether.
I want my git repository to be the single source of truth and thus a command like
amplify push --force
would help reset an environment to the state in the git.