10

I am trying to add AWS Cognito to my iOS application using AWS Amplify. The docs suggest to use amplify add auth on the CLI, but this does not seem to work with an existing User Pool (i.e. you have to create a new one). Is it possible to integrate AWS Cognito into my iOS (Swift) project using an existing User Pool?

sluijs
  • 4,146
  • 4
  • 30
  • 36
  • Same problem here, and what about if we want to use the same user pool for an iOS and Android app? Can't we keep the awsconfiguration.json file synced other than by copy paste? – YoanGJ Dec 05 '18 at 13:00

2 Answers2

8

Amplify CLI doesn't support existing resources at the moment but you can manually edit your awsconfiguration.json to include the User Pool that is already present as outlined here.

Richard
  • 1,750
  • 11
  • 11
  • 2
    I tested this and it works indeed but it's still inconvenient. – sluijs Dec 10 '18 at 15:16
  • 2
    Thank you. I have the same problem with ReactJS project and your answer has saved my day! BTW the manual edit guide for JS: https://aws-amplify.github.io/docs/js/start?platform=purejs#step-5-host-your-app – Lavande Jan 23 '19 at 02:11
5

Update: Since 2020 Amplify allows you to use existing User Pools (yeah!). Just run:

amplify import auth

Source: https://aws.amazon.com/de/about-aws/whats-new/2020/10/use-existing-cognito-user-pools-identity-pools-for-amplify-project/

morgler
  • 1,669
  • 1
  • 18
  • 26