Skip to content

feat(gen2-migration): add imported-resources app#14709

Merged
iliapolo merged 12 commits intogen2-migrationfrom
dgandhi62-patch-2
Mar 30, 2026
Merged

feat(gen2-migration): add imported-resources app#14709
iliapolo merged 12 commits intogen2-migrationfrom
dgandhi62-patch-2

Conversation

@dgandhi62
Copy link
Copy Markdown
Contributor

@dgandhi62 dgandhi62 commented Mar 26, 2026

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.

@dgandhi62 dgandhi62 requested a review from a team as a code owner March 26, 2026 20:03
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.
@dgandhi62 dgandhi62 marked this pull request as draft March 30, 2026 18:45
@dgandhi62 dgandhi62 changed the title fix(cli-internal): skip imported auth resources in refactor step feat(gen2-migration): add imported-resources app Mar 30, 2026
@dgandhi62 dgandhi62 marked this pull request as ready for review March 30, 2026 19:13
@iliapolo iliapolo changed the base branch from gen2-migration to dev March 30, 2026 20:25
@iliapolo iliapolo changed the base branch from dev to gen2-migration March 30, 2026 20:25
@dgandhi62 dgandhi62 requested a review from iliapolo March 30, 2026 20:43
@iliapolo iliapolo enabled auto-merge (squash) March 30, 2026 20:50
@iliapolo iliapolo merged commit a5fd8f7 into gen2-migration Mar 30, 2026
4 checks passed
@iliapolo iliapolo deleted the dgandhi62-patch-2 branch March 30, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants