Skip to content

Build: [AEA-6516] - Move the stateless stack to a CDK deployment#2952

Draft
wildjames wants to merge 11 commits intomainfrom
aea-6516-stateless-cdk
Draft

Build: [AEA-6516] - Move the stateless stack to a CDK deployment#2952
wildjames wants to merge 11 commits intomainfrom
aea-6516-stateless-cdk

Conversation

@wildjames
Copy link
Copy Markdown
Contributor

Summary

  • 🤖 Operational or Infrastructure Change

Details

I will migrate the stateless stack to CDK, but I will not be removing any of the SAM template deployments in this PR just yet. I may do that later, depending on how challenging the stateful migration is.

Copilot AI review requested due to automatic review settings April 9, 2026 11:42
@wildjames wildjames marked this pull request as draft April 9, 2026 11:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an initial AWS CDK workspace and deployment pipeline for the PSU “stateless” infrastructure, alongside existing SAM-based deployments, to support a phased migration.

Changes:

  • Adds a new packages/cdk workspace with a placeholder PsuStatelessStack and app entrypoint.
  • Extends CI/PR/release GitHub Actions pipelines to package and deploy the CDK app.
  • Updates repository tooling (Makefile targets, .gitignore, VS Code workspace) to support CDK development and outputs.

Reviewed changes

Copilot reviewed 14 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/cdk/tsconfig.json Adds TypeScript config for the new CDK workspace.
packages/cdk/stacks/PsuStatelessStack.ts Introduces an empty CDK stack placeholder for future SAM-to-CDK migration.
packages/cdk/package.json Defines CDK scripts and dependencies for synth/diff/deploy/watch.
packages/cdk/nagSuppressions.ts Adds a placeholder for cdk-nag suppressions.
packages/cdk/bin/PsuStatelessApp.ts Adds CDK app entrypoint wiring config/env into the stack.
package.json Registers packages/cdk as an npm workspace.
package-lock.json Locks new CDK workspace dependencies.
Makefile Adds CDK targets and cleans CDK outputs; includes CDK lint in lint-node.
.vscode/eps-prescription-status-update-api.code-workspace Adds the CDK package folder to the workspace.
.pre-commit-config.yaml Comments out a local Grype scanning hook.
.gitignore Ignores cdk.out and .npmrc.
.github/workflows/release.yml Adds CDK package/deploy jobs and renames SAM packaging job references.
.github/workflows/pull_request.yml Adds CDK package/deploy jobs for PR environments and renames SAM job references.
.github/workflows/ci.yml Adds CDK package/deploy jobs on merge to main and renames SAM job references.
.github/workflows/cdk_release_code.yml New reusable workflow to deploy the CDK app.
.github/workflows/cdk_package_code.yml New reusable workflow to package build artifacts for CDK deployment.
.github/actions/install_dependencies/action.yml New composite action to centralize npm auth + dependency installation.

"module": "commonjs",
"rootDir": ".",
"outDir": "lib",
"allowImportingTsExtensions": true,
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allowImportingTsExtensions is enabled while this tsconfig extends tsconfig.defaults.json, which sets moduleResolution to node. TypeScript requires allowImportingTsExtensions to be used with moduleResolution set to bundler, node16, or nodenext (and noEmit/emitDeclarationOnly). As-is, tsc -p packages/cdk will fail. Either remove allowImportingTsExtensions (if you don’t need .ts import specifiers) or override moduleResolution accordingly in this tsconfig.

Suggested change
"allowImportingTsExtensions": true,

Copilot uses AI. Check for mistakes.
Comment on lines +247 to +250
cdk-deploy:
REQUIRE_APPROVAL="$${REQUIRE_APPROVAL:-any-change}" && \
npm run cdk-deploy --workspace packages/cdk

Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this recipe, REQUIRE_APPROVAL="..." && npm run ... only sets a shell variable and does not pass it through to the npm run process environment. As a result, ${REQUIRE_APPROVAL} in the cdk-deploy script may expand to an empty string. Use an env assignment directly on the command (e.g., REQUIRE_APPROVAL=... npm run ...) or export it before invoking npm.

Copilot uses AI. Check for mistakes.
Comment on lines +258 to +260
cdk-watch:
REQUIRE_APPROVAL="$${REQUIRE_APPROVAL:-any-change}" && \
npm run cdk-watch --workspace packages/cdk
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as cdk-deploy: REQUIRE_APPROVAL="..." && npm run ... does not export the variable to the npm run environment, so --require-approval ${REQUIRE_APPROVAL} may not receive the intended value. Pass it as an environment variable on the npm run invocation (or export it).

Copilot uses AI. Check for mistakes.

inputs:
npm-required:
description: "Set to true if npm dependencies are already installed"
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The npm-required input description is inverted relative to how it’s used. The action runs make install-node when npm-required == 'true', so the description should indicate that setting it to true installs npm dependencies (or the condition should be flipped). As written, callers are likely to pass the wrong value.

Suggested change
description: "Set to true if npm dependencies are already installed"
description: "Set to true to install npm dependencies"

Copilot uses AI. Check for mistakes.
…ack so that it can access the stateful resources, e.g. tables, SQS, params.
@wildjames
Copy link
Copy Markdown
Contributor Author

At this point in development, the stateless stack is partially migrated. However, I need to pass in the SAM stack name, as the stateless stack needs to access resources on the stateful stack as well. Later, this needs to be removed!

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 9, 2026

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.

2 participants