chore(gen2-migration): add changes to product-catalog app#14714
Draft
sanjanaravikumar-az wants to merge 4 commits intogen2-migrationfrom
Draft
chore(gen2-migration): add changes to product-catalog app#14714sanjanaravikumar-az wants to merge 4 commits intogen2-migrationfrom
sanjanaravikumar-az wants to merge 4 commits intogen2-migrationfrom
Conversation
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
Adds e2e migration support for the product-catalog app. This app uses IAM as the default GraphQL auth mode with Lambda functions that call back into the AppSync API, which requires additional wiring that the e2e system's
addFunction(Hello World template) doesn't provide.Why these changes are needed:
The e2e system creates Lambda functions using the Hello World template without configuring API access, secrets, or environment variables through the interactive CLI prompts. The manual setup (per the README) uses
amplify add functionwith "Yes" to advanced settings, which automatically wires up CFN parameters, IAM policies, env vars, and secret paths. The changes below compensate for that gap.App-level changes (amplify-migration-apps/product-catalog/):
configure.sh:custom-roles.jsonplaceholder using deployment name from project-config.json.appsync:GraphQLpermission, anddependsOnwiring inbackend-config.jsonandfunction-parameters.json.custom-roles.json:amplifyAuthauthenticatedU) as admin roles.lowstockproducts.js:API_*_GRAPHQLAPIENDPOINTOUTPUT.ListGraphqlApisSDK discovery with event host header extraction — the original approach picked up stale APIs from previous test runs.onimageuploaded.js:post-generate.ts:edits: branchName → sandbox, aws_iam import + appsync:GraphQL policy, userPoolConfig awsRegion fix lowstockproducts ESM conversion + secret(), S3 trigger ESM conversion, frontend import update.
post-refactor.ts:s3Bucket.bucketNamein backend.ts after refactor (same as project-boards).E2e system changes:
category-initializer.ts:authTypesConfigin the order specified by migration-config.json so the first auth mode becomes the default (was always defaulting to API_KEY).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.