feat(gen2-migration): add imported-resources app#14709
Merged
iliapolo merged 12 commits intogen2-migrationfrom Mar 30, 2026
Merged
feat(gen2-migration): add imported-resources app#14709iliapolo merged 12 commits intogen2-migrationfrom
iliapolo merged 12 commits intogen2-migrationfrom
Conversation
Imported (reference) auth resources have no nested CloudFormation stack — they reference externally-managed Cognito resources. The refactor step was unconditionally creating an AuthCognitoForwardRefactorer for every auth:Cognito resource, which then failed with "unable to find source stack" because there is no stack to find. Now checks serviceType === 'imported' in amplify-meta.json before creating the refactorer, matching the existing pattern in the generate step. Added tests for both forward and rollback paths. --- Prompt: In the gen2-migration tool, I am getting this error when trying to refactor an app with an imported auth resource - "[AuthCognitoForwardRefactorer] unable to find source stack"
Add generate/refactor snapshots and update CognitoIdentityMock to support imported auth resources.
04acfd3 to
b8a6785
Compare
iliapolo
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
This pr adds the imported-resources migration app — the first app with imported auth (external Cognito resources via amplify import auth). Includes all four snapshot directories and generate/refactor snapshot tests.
This pr also updated the Cognito SDK mocks to handle imported auth: added GetIdentityPoolRolesCommand mock, and made DescribeIdentityPoolCommand and ListGroupsCommand fall back gracefully when cli-inputs.json doesn't exist (imported resources don't have one).
Fixed the refactor step crashing with "unable to find source stack" for imported auth by checking serviceType === 'imported' before creating the auth refactorer.
Resolves #14711
Description of how you validated changes
Ran generate and refactor snapshot tests for imported-resources — both pass. Existing app snapshot tests unaffected.