Skip to content

New: [AEA-6257] - scaffold app with cdk#2494

Draft
tstephen-nhs wants to merge 1 commit intomainfrom
aea-6257-cdk-shell
Draft

New: [AEA-6257] - scaffold app with cdk#2494
tstephen-nhs wants to merge 1 commit intomainfrom
aea-6257-cdk-shell

Conversation

@tstephen-nhs
Copy link
Contributor

Summary

  • 🤖 Operational or Infrastructure Change

Details

Initial cut of creating the stack with CDK

Copilot AI review requested due to automatic review settings March 19, 2026 17:56
@github-actions
Copy link
Contributor

The PR title does not conform to the required format.
Please ensure your PR title is prefixed with a change type (Fix, Update, New, Breaking, Docs, Build, Upgrade, Chore)
and contains a ticket reference (eg. 'Fix: [AEA-####] - ...', or 'Chore: [dependabot] - ...'),
then push an empty commit or recreate your PR.
See the contributing guide for more details:
https://github.com/NHSDigital/eps-common-workflows/blob/main/CONTRIBUTING.md

@tstephen-nhs tstephen-nhs changed the title New: [AEA6257] - scaffold app with cdk New: [AEA-6257] - scaffold app with cdk Mar 19, 2026
@tstephen-nhs tstephen-nhs marked this pull request as draft March 19, 2026 18:01
Copy link

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

Adds an initial AWS CDK application/workspace to provision the Prescriptions for Patients API infrastructure (lambdas, Step Functions state machine, and API Gateway), plus supporting scripts and Makefile targets.

Changes:

  • Introduces a new packages/cdk workspace containing CDK apps (bin/), stacks (stacks/), and constructs/resources (resources/).
  • Adds operational scripts for cleaning up PR/main stacks and a cdk-nag suppression configuration.
  • Wires the new workspace into the monorepo (workspaces, Makefile targets, and ignore rules).

Reviewed changes

Copilot reviewed 14 out of 18 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
packages/cdk/tsconfig.json TS config for the new CDK workspace
packages/cdk/package.json CDK workspace scripts and dependencies
packages/cdk/cdk.json CDK watch and feature-flag context configuration
packages/cdk/bin/PfPApiApp.ts Main CDK app entrypoint that instantiates PfPApiStack
packages/cdk/bin/PfPApiSandboxApp.ts Sandbox CDK app entrypoint that instantiates PfPApiSandboxStack
packages/cdk/stacks/PfPApiStack.ts Stack wiring Functions + StateMachines + Apis and nag suppressions
packages/cdk/stacks/PfPApiSandboxStack.ts Placeholder sandbox stack
packages/cdk/resources/Functions.ts Defines Lambda functions and shared env/policies/layer
packages/cdk/resources/StateMachines.ts Defines Step Functions state machine(s) and IAM for invoking imported Lambda
packages/cdk/resources/StateMachineDefinitions/GetMyPrescriptions.ts State machine definition chain/choice logic
packages/cdk/resources/Apis.ts API Gateway + endpoints wiring to state machine + status Lambda
packages/cdk/nagSuppressions.ts cdk-nag suppression configuration for IAM/APIGW findings
packages/cdk/scripts/deletePrStacks.ts Script to delete unused PR stacks
packages/cdk/scripts/deleteMainStacks.ts Script to delete unused main stacks based on active API versions
package.json Adds packages/cdk to npm workspaces
package-lock.json Workspace + dependency lock updates for CDK deps
Makefile Adds CDK targets and runs cdk workspace lint/test/clean
.gitignore Ignores cdk.out/ and .env

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"module": "commonjs",
"rootDir": ".",
"outDir": "lib",
"allowImportingTsExtensions": true,
"@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
"@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
"@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
"@aws-cdk/aws-route53-patters:useCertificate": true,
Comment on lines +42 to +46
reason: "Suppress error for not implementing authorization. Token endpoint should not have an authorizer"
},
{
id: "AwsSolutions-COG4",
reason: "Suppress error for not implementing a Cognito user pool authorizer. Token endpoint should not have an authorizer"
"tsx": "tsx"
},
"dependencies": {
"@nhsdigital/eps-cdk-constructs": "file:../../nhsdigital-eps-cdk-constructs-1.6.0.tgz",
"delete-main-stacks": "npm run tsx -- scripts/deleteMainStacks.ts",
"delete-old-pr-stacks": "npm run tsx -- scripts/deletePrStacks.ts",
"lint": "eslint --max-warnings 0 --fix --config ../../eslint.config.mjs .",
"test": "vitest run --coverage",
echo "Linting complete"

test: compile
npm run test --workspace packages/cdk
Comment on lines +124 to +135
cdk-deploy:
CDK_CONFIG_stackName=${stack_name} REQUIRE_APPROVAL="$${REQUIRE_APPROVAL:-any-change}" npm run cdk-deploy --workspace packages/cdk

cdk-synth: download-get-secrets-layer
CDK_CONFIG_stackName=${stack_name} npm run cdk-synth --workspace packages/cdk

cdk-diff:
CDK_CONFIG_stackName=${stack_name} npm run cdk-diff --workspace packages/cdk

cdk-watch:
CDK_CONFIG_stackName=${stack_name} REQUIRE_APPROVAL="$${REQUIRE_APPROVAL:-any-change}" npm run cdk-watch --workspace packages/cdk

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