Skip to content

Remove unused cloudformation parameter from image copier stack#1801

Open
philmcmahon wants to merge 4 commits intomainfrom
pm-support-kms-key-override
Open

Remove unused cloudformation parameter from image copier stack#1801
philmcmahon wants to merge 4 commits intomainfrom
pm-support-kms-key-override

Conversation

@philmcmahon
Copy link
Copy Markdown
Contributor

@philmcmahon philmcmahon commented Mar 13, 2026

What does this change?

Somewhere along the road of the CDK migration (I'm assuming) we stopped respecting the KmsKeyArn cloudformation parameter in the image copier CDK. I initially set about to get it working again, but, because I was scared of pushing out a change that would impact teams who had unknowingly set that parameter, I've instead removed it entirely.

How to test

This should be a noop, I've tested it on the investigations account

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 13, 2026

@philmcmahon philmcmahon added the fix Departmental tracking: fix label Mar 19, 2026
@philmcmahon philmcmahon marked this pull request as ready for review March 19, 2026 16:54
@philmcmahon philmcmahon requested a review from a team as a code owner March 19, 2026 16:54
Comment on lines +31 to +34
const kmsKeyArn =
kmsKeyArnParameter.valueAsString.length > 0
? kmsKeyArnParameter.valueAsString
: Fn.importValue('amigo-imagecopier-key');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this ternary will work as the value of kmsKeyArnParameter is known at runtime, however this check is evaluated at compile time.

I think we could drop Fn.importValue('amigo-imagecopier-key') entirely TBH. Do we know what creates the image copier key? Could it also create a SSM Parameter on a known path, and that becomes the default of the CFN Parameter in this stack?

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.

Ah yes sorry, that is very obvious in the snapshots that it just just replaced one thing with another. The image copier key is created in another stack within this repo, I could definitely update it to do as you suggest

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.

(will do that then submit for review again)

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've ended up just removing the parameter entirely

@philmcmahon philmcmahon marked this pull request as draft March 20, 2026 11:36
@philmcmahon philmcmahon changed the title Support overriding the kms key used by image copier Remove unused cloudformation parameter from image copier stack Mar 26, 2026
@philmcmahon philmcmahon self-assigned this Mar 26, 2026
@philmcmahon philmcmahon force-pushed the pm-support-kms-key-override branch from a73a172 to 0be0a81 Compare March 26, 2026 13:35
@philmcmahon philmcmahon force-pushed the pm-support-kms-key-override branch from 0be0a81 to 2fb6d48 Compare March 31, 2026 09:56
@philmcmahon philmcmahon marked this pull request as ready for review March 31, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Departmental tracking: fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants