Skip to content

Comments

fix(gen2-migration): handle resource dependency patterns in custom resource migration#14606

Open
sanjanaravikumar-az wants to merge 2 commits intogen2-migrationfrom
sanjrkmr/cdk-resource-dep-fixes
Open

fix(gen2-migration): handle resource dependency patterns in custom resource migration#14606
sanjanaravikumar-az wants to merge 2 commits intogen2-migrationfrom
sanjrkmr/cdk-resource-dep-fixes

Conversation

@sanjanaravikumar-az
Copy link

Fixes gaps in the custom resource transformer where Gen1 dependency patterns produced broken Gen2 output.

Changes:

  • Track dependency variable names from addResourceDependency calls and transform their property access chains to Gen2 paths
  • Transform cdk.Fn.ref() calls with property access arguments

Example:
cdk.Fn.ref(dependencies.api.app.GraphQLAPIIdOutput becomes backend.data.resources.cfnResources.cfnGraphqlApi.attrApiId

  • Remove AmplifyDependentResourcesAttributes type-annotated variable declarations and strip type assertions
  • Track and remove variable declarations calling functions imported from amplify-dependent-resources-ref
  • Pass a single backend: any parameter to the generated constructor instead of individual category parameters

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sanjanaravikumar-az sanjanaravikumar-az requested a review from a team as a code owner February 20, 2026 18:07
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.

1 participant