Conversation
|
The PR title does not conform to the required format. |
There was a problem hiding this comment.
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/cdkworkspace 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, |
| 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 |
| 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 | ||
|
|
Summary
Details
Initial cut of creating the stack with CDK