Skip to content

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

Open
tstephen-nhs wants to merge 64 commits intomainfrom
aea-6257-cdk-shell
Open

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

Conversation

@tstephen-nhs
Copy link
Copy Markdown
Contributor

@tstephen-nhs tstephen-nhs commented Mar 19, 2026

Summary

  • 🤖 Operational or Infrastructure Change

Details

Deploy functionally equivalent PfP using CDK.
NOTE: Proxygen deployment is not included so regression tests for CDK-based stack only pass for the PfP-AWS product.

Local testing

. .env # source your own version of template.env
make aws-login
make deploy
curl --header "nhsd-nhslogin-user: P9:9446041481" --header "x-request-id: $(cat /proc/sys/kernel/random/uuid)"   https://${stack_name}.dev.eps.national.nhs.uk/Bundle

my example returned

{"resourceType":"Bundle","id":"a7e8f6a6-c20f-4a79-8e0d-6d6c0832d944","meta":{"lastUpdated":"2026-03-24T18:52:13+00:00"},"type":"searchset","total":0,"entry":[]}

To run regression tests prefix PULL_REQUEST_ID with 'cdk-', as in:

product=pfp-aws env=internal-dev PULL_REQUEST_ID=cdk-pr-2494 tags=smoke make run-tests

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

github-actions bot commented Mar 19, 2026

This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket:

AEA-6257

@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
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

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.

@tstephen-nhs tstephen-nhs changed the title New: [AEA-6257] - scaffold app with cdk New: [AEA-6257] - scaffold app with [CDK] Apr 2, 2026
tstephen-nhs and others added 2 commits April 10, 2026 14:12
CDK PR stack names pfp-cdk-pr-N did not match the pfp-api prefix
expected by deletePrStacks.ts. Rename to pfp-api-pr-N so that the
automated PR stack cleanup works correctly.

Also drop the CDK- prefix from VERSION_NUMBER (PR-N is sufficient
since SAM PR stacks use pfp-pr-N and there is no collision).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

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