Skip to content

New: [AEA-6258] - Add SSM Parameter construct#619

Merged
wildjames merged 35 commits intomainfrom
aea-6258-ssm-parameters
Mar 27, 2026
Merged

New: [AEA-6258] - Add SSM Parameter construct#619
wildjames merged 35 commits intomainfrom
aea-6258-ssm-parameters

Conversation

@wildjames
Copy link
Copy Markdown
Contributor

Summary

  • ✨ New Feature

Details

CDK exposes a StringParameter which builds an SSM parameter. I've added an SsmParametersConstruct which takes an array of parameter definitions, and handles making the StringParameter for each, creates a policy to read the parameters, and produces relevant outputs.

Copilot AI review requested due to automatic review settings March 24, 2026 13:06
@github-actions
Copy link
Copy Markdown
Contributor

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

AEA-6258

Copy link
Copy Markdown
Contributor

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 a new CDK construct for defining multiple SSM parameters in a single place, automatically generating the corresponding StringParameter resources, an IAM managed policy granting read access, and CloudFormation outputs/exports for downstream consumption.

Changes:

  • Added SsmParametersConstruct to create a bundle of SSM parameters + a read managed policy + outputs.
  • Exported the new construct from the @nhsdigital/eps-cdk-constructs entrypoint.
  • Added Vitest coverage validating parameter creation, policy generation, and output exports.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/cdkConstructs/src/constructs/SsmParametersConstruct.ts New construct that synthesizes SSM parameters, an IAM read policy, and CFN outputs/exports.
packages/cdkConstructs/src/index.ts Re-export the new construct from the package entrypoint.
packages/cdkConstructs/tests/constructs/ssmParametersConstruct.test.ts New unit tests covering the synthesized resources/outputs for the construct.

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

@wildjames wildjames marked this pull request as draft March 26, 2026 10:20
@wildjames wildjames marked this pull request as ready for review March 27, 2026 15:57
*/
export const stateMachineRequestTemplate = (stateMachineArn: string) => {
return `## Velocity Template used for API Gateway request mapping template
return `## Velocity Template used for API Gateway request mapping template
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this one was correct before? 2 space indent

export function getConfigFromEnvVar(
varName: string,
prefix: string = "CDK_CONFIG_",
defaultValue: string | undefined = undefined
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I know the idiomatic way to do this would be to use an options object, but that would break downstream things and for this I don't want to mess about with that if we can avoid it...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
defaultValue: string | undefined = undefined
defaultValue: string | undefined

explicitly initialising to undefined feels a bit excessive.
There a couple of these

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 7 out of 9 changed files in this pull request and generated 5 comments.

export function getConfigFromEnvVar(
varName: string,
prefix: string = "CDK_CONFIG_",
defaultValue: string | undefined = undefined
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
defaultValue: string | undefined = undefined
defaultValue: string | undefined

explicitly initialising to undefined feels a bit excessive.
There a couple of these

@wildjames wildjames enabled auto-merge (squash) March 27, 2026 16:43
@sonarqubecloud
Copy link
Copy Markdown

@wildjames wildjames merged commit 65307a7 into main Mar 27, 2026
14 of 16 checks passed
@wildjames wildjames deleted the aea-6258-ssm-parameters branch March 27, 2026 16:52
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.

4 participants