Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recover from a deleted imported identity pool #13588

Closed
dan-hook opened this issue Feb 12, 2024 · 5 comments
Closed

Recover from a deleted imported identity pool #13588

dan-hook opened this issue Feb 12, 2024 · 5 comments
Labels
auth Issues tied to the auth category of the CLI pending-triage Issue is pending triage question General question

Comments

@dan-hook
Copy link

Amplify CLI Version

12.10.1

Question

My amplify application uses an imported user pool and identity pool. The identity pool was accidentally deleted, but the user pool is intact, as well as the authRole used by the identity pool. This allowed me to recreate the identity pool. Unfortunately, it has a different id so when I try to push the environment I get the error:
✖ There was an error initializing your environment. 🛑 The previously configured Identity Pool: 'genepanelapi8323d4d5_identitypool_8323d4d5__int' (us-east-1:2c54f815-40af-4e81-a1c8-45134d3d9b18) cannot be found.

I can't easily remove and reimport the auth, since my API is dependent on the auth and removing the API would end up being similar in effort to destroying the environment, then recreating it (and importing backups of the DDB tables).

@dan-hook dan-hook added pending-triage Issue is pending triage question General question labels Feb 12, 2024
@dan-hook
Copy link
Author

I filed a support request with AWS, but I think the developers here are much better placed to answer the question than first line support is. Where is the CLI getting the old value of the identitypool, and is there a way we can change that value through the console or AWS cli that bypasses any issues the amplify CLI may be having?

@ykethan
Copy link
Member

ykethan commented Feb 14, 2024

@dan-hook thank you for reaching out. Currently diving into this and will provide an update here.

@ykethan
Copy link
Member

ykethan commented Feb 14, 2024

Hey @dan-hook, On diving into this. I was able to update a imported auth resource that dependant on a project by utilizing the following steps.

  1. update the team-provider-info.json file, auth block with new user pool and identity pool resource values.
          "userPoolId": "",
          "userPoolName": "",
          "webClientId": "",
          "nativeClientId": "",
          "identityPoolId": "",
          "identityPoolName": "",
          "allowUnauthenticatedIdentities": <false>,
          "authRoleArn": "",
          "authRoleName": "",
          "unauthRoleArn": "",
          "unauthRoleName": ""

<> with new resources values
2. update the amplify-meta.json file , auth block output values to new user pool and identity pool resource values similar to above values.
3. amplify status if this does not have an update on any resource, trigger an update by say adding an lambda function which we can remove later
4. amplify push
After push completes, verify the amplifyconfiguration.json and amplify-meta.json has new Cognito resource values.
This should also update api as well, we can confirm this on the AppSync console.
5. if it does not update the API, we will need to trigger an update on the API by adding an empty line or via the amplify update api

Do let us know if this mitigates the issue. Recommend testing this in a dev/test environments.

@ykethan ykethan added auth Issues tied to the auth category of the CLI pending-response Issue is pending response from the issue author and removed investigating This issue is being investigated labels Feb 14, 2024
@dan-hook
Copy link
Author

Do let us know if this mitigates the issue. Recommend testing this in a dev/test environments.

That worked! Thank you for your help.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Feb 15, 2024
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues tied to the auth category of the CLI pending-triage Issue is pending triage question General question
Projects
None yet
Development

No branches or pull requests

2 participants