- Newest
- Most votes
- Most comments
When you're encountering the "Resource already exists" error with Amplify, it's because your local Amplify configuration is trying to create resources that already exist in your AWS account. This commonly happens when resources were created outside of Amplify's workflow, such as through the AWS Console or API.
For your specific case with existing Cognito user pool groups, you have a few options:
-
Use the
referenceAuthapproach: Instead of having Amplify manage these Cognito resources, you can update your Amplify configuration to reference the existing Cognito resources. This requires configuring your project to use the existing user pool, user pool client, identity pool, and IAM roles. -
Delete the conflicting resources in AWS: If you're certain that the local Amplify configuration is correct, you could delete the existing resources in AWS (the user pool groups and IAM roles) and then run the push again. However, this might not be desirable if these resources are being used in production.
-
Update your Amplify configuration: You could modify your local Amplify configuration to match the existing resources in AWS. This would involve examining the current state of your AWS resources and updating your local configuration accordingly.
If you're working in a team environment where different branches might need to share resources, you can also consider using Amplify's resource sharing capabilities across branches, which allows you to have feature branches point to resources deployed by a main branch.
For your immediate issue with the user pool groups, the most straightforward approach would be to use the reference method to point to your existing Cognito resources rather than trying to create new ones.
Sources
Use existing Cognito resources - Swift - AWS Amplify Gen 2 Documentation
Share resources across branches - AWS Amplify Gen 2 Documentation
answered a year ago
Relevant content
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 10 months ago

Yeah, none of these answers are acceptable. I'm not using Gen2, I can't delete user groups with 1500 members, and if I edit the local configuration it won't push as stated in the original question.