Edit: take special note of Dylan's comment below:
This will erase the amplify project and resources in the cloud, then re-create. You can view instructions how to re-pull the existing environment within the amplify console under the "backend environments tab".
amplify pull --appId {amplify app id} --envName {env name}
I was just recently struggling with the same blocker, after creating/deploying/testing an AWS Amplify project in my personal profile, I added a profile for my "client" (in this case, my brother), who created a specific AWS IAM user for me in his account.
The solution that I discovered, as per this AWS blog post, was to do the following from inside my project root folder:
- (if not already done) remove the currently deployed Amplify stack, using
amplify delete
- delete the local "deployment information" file, using
rm amplify/team-provider.info.json
- re-initialise a new AWS Amplify stack (i.e.: in the cloud) and generate the relevant local files for it, using
amplify init
- be sure to select the correct AWS profile or Key here for the new deployment, adding a new one if required..
- push your project to the newly initialised AWS Amplify stack, using
amplify push
for backend-only, or using amplify publish
if you use Amplify Hosting
Disclaimer: as I'm still learning AWS, so I may possibly use incorrect terms and/or examples to explain what I've learnt. This answer is most definitely open to clarification by the community.. Either way, I hope it helps.