amplify-hosting icon indicating copy to clipboard operation
amplify-hosting copied to clipboard

Cognito amplify_backend_manager_APPID deleted

Open tomacf opened this issue 2 years ago • 2 comments

Before opening, please confirm:

App Id

arn:aws:amplify:eu-west-1:770204761019:apps/d3azouarb564gt

Region

eu-west-1

Amplify Hosting feature

Access control

Describe the bug

I deleted the amplify_backend_manager_APPID userpool in Cognito by mistake. So I have :

  • lost the access on the Studio.
  • lost the possibility to push through the CLI which require a connection on the Studio.
  • lost the possibility to manage the access to the Studio from aws.console/amplify.

Expected behavior

The main aws profile still being the same, the possibility to recreate the a new userpool manually or using automatic process through the CLI would be helpful and to link it to the current project.

Reproduction steps

  1. Create an aws account.
  2. Follow the AWS amplify tutorial.
  3. Delete the automatically created pool on Cognito.
  4. Try to access the Studio or to push

Build Settings

No response

Additional information

No response

tomacf avatar Jul 20 '22 22:07 tomacf

Hi @tomacf 👋🏽 which AWS amplify tutorial did you follow?

ghost avatar Jul 21 '22 21:07 ghost

Hello @hloriana ! Thanks for your time.

I followed that one or a previous version of it few months ago. https://docs.amplify.aws/start/getting-started/installation/q/integration/react/#option-2-follow-the-instructions

But I'm not sure that the tutorial may impact any reproduction of the error issue, the amplify project was working correctly until I deleted by mistake the cognito user pool generated by amplify to handle the connection to the Studio and the interaction. I'm really looking for a solution to recreate that user pool or to replace it.

tomacf avatar Jul 22 '22 07:07 tomacf

Hi @tomacf,

Agreed, I do believe that the Console workflow of enabling/disabling Studio can be improved. Nevertheless, here's a workaround that you could use to move past this error -

  1. Create a new sample Amplify application from Amplify Console using option "Build an app".

  2. Check and verify new Amplify application created successfully and check Amplify App ID from "General" under App settings.

  3. Navigate to Cognito Userpool console and you will find a newly created Cognito userpool - amplify_backend_manager_[sample_amplify_App_ID] (Amplify App ID noted in step 2). Note down the below information for this Cognito userpool - i. Cognito Userpool ID ii. Cognito Userpool webclient ID iii. Cognito Userpool region

  4. Navigate to Cognito Federated Identities console and open the amplify_backend_manager_<sample_amplify_App_ID> identity pool, click on 'Edit identity pool' and note down - i. Cognito Identity PoolId

  5. In a local terminal, with AWS CLI setup execute the update-backend-config command :

    $ aws amplifybackend update-backend-config --app-id <affected_app_id> --login-auth-config AwsCognitoIdentityPoolId=<sample_identity_pool_id>,AwsCognitoRegion=<region>,AwsUserPoolsId=<sample_userpool_id>,AwsUserPoolsWebClientId=<sample_webclient_id>

    • Note, if you observe An error occurred (ResourceNotFoundException) when calling the UpdateBackendConfig operation, please re-run the command and it should go through the second time.
  6. Next, test whether you are able login (using Launch Studio button on console) into the affected backend environment.

  7. Now, you could toggle the Amplify Studio configuration to off and turn it on again to recreate the independent resources like userpool etc.

  8. Delete the sample Amplify app directly from console.

vishal-dms avatar Dec 05 '22 05:12 vishal-dms

I believe it is also possible to work around this by disabling/re-enabling Studio via the toggle in the AWS Console under Studio settings.

Can you please confirm that fixes it?

johnpc avatar Dec 13 '22 18:12 johnpc

I've tried enabling the studio through the settings, but it didn't work.

rafaelboschini avatar Jan 28 '23 20:01 rafaelboschini