Skip to content

fix(create-blocks-app): register Amplify auth config#233

Open
ikenyal wants to merge 1 commit into
aws-devtools-labs:mainfrom
ikenyal:fix/amplify-auth-runtime-config
Open

fix(create-blocks-app): register Amplify auth config#233
ikenyal wants to merge 1 commit into
aws-devtools-labs:mainfrom
ikenyal:fix/amplify-auth-runtime-config

Conversation

@ikenyal

@ikenyal ikenyal commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Problem

The Amplify Gen 2 overlay adds Cognito values directly to the shared Blocks Lambda environment. This bypasses the shared config registry and consumes the Lambda environment-variable budget. It also injects COGNITO_REGION, which the generated Cognito verifier does not read.

Issue #, if available: N/A

Changes

  • Register the generated Cognito verifier's User Pool ID and Client ID through registerConfig() from @aws-blocks/blocks/cdk.
  • Remove the unused COGNITO_REGION injection.
  • Keep the Amplify Gen 2 integration fixture aligned with the generated overlay.
  • Add a scaffold test that verifies the copied overlay uses the config registry and does not directly inject Cognito environment variables.
  • Add a patch changeset for @aws-blocks/create-blocks-app.

Validation

  • npm run build --workspace @aws-blocks/create-blocks-app
  • npm test --workspace @aws-blocks/create-blocks-app (50 passing tests)
  • npx tsc --noEmit --target ES2022 --module NodeNext --moduleResolution NodeNext --skipLibCheck test-apps/amplify-gen2/amplify/blocks.ts
  • npm run lint:deps
  • changeset status --since=origin/main

Checklist

  • PR description included
  • Tests are changed or added
  • Relevant documentation is changed or added (not applicable: the generated auth API and workflow are unchanged)

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

@ikenyal
ikenyal requested a review from a team as a code owner July 18, 2026 06:58
@changeset-bot

changeset-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a7e7769

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@aws-blocks/create-blocks-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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