Skip to content

Conversation

@mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Jan 14, 2026

When using a custom bootstrap template, users may choose to store the bootstrap version in a SecureString SSM parameter instead the default String type. The CDK CLI currently doesn't request decryption, causing it to fail when reading such parameters. While the parameter contains no sensitive data, overly aggressively configured checkers might flag the parameter.

This PR resolves #955, at least in most cases. It should now be possible to use a custom bootstrap template and encrypt the CDK Bootstrap version parameter.

The change adds WithDecryption: true to the SSM getParameter call. The flag is safe to always set because it's ignored for unencrypted parameters. When using AWS Managed Keys, SSM already has the necessary decryption permissions by default via Key policy. Otherwise it is up to the user to ensure sufficient decryption permissions.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team January 14, 2026 13:49
@mrgrain mrgrain changed the title fix(toolkit-lib): request SSM parameters with decryption enabled fix: checking CdkBootstrapVersion when the SSM parameter is encrypted Jan 14, 2026
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.75%. Comparing base (647111e) to head (deef367).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1025      +/-   ##
==========================================
+ Coverage   87.71%   87.75%   +0.03%     
==========================================
  Files          72       72              
  Lines       10087    10087              
  Branches     1330     1330              
==========================================
+ Hits         8848     8852       +4     
+ Misses       1214     1210       -4     
  Partials       25       25              
Flag Coverage Δ
suite.unit 87.75% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Jan 14, 2026
Merged via the queue into main with commit 92af268 Jan 14, 2026
51 checks passed
@aws-cdk-automation aws-cdk-automation deleted the mrgrain/fix/toolkit-lib/ssm-with-decryption branch January 14, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-cdk, cli): Allowing Encrypted/Custom String value for CdkBootstrapVersion

4 participants