Skip to content

fix(parameters): cache and transform mixed-batch decrypted parameters - #5841

Merged
dreamorosi merged 1 commit into
aws-powertools:mainfrom
thebadalov:fix/parameters-ssm-mixed-decrypt-batch
Oct 25, 2026
Merged

dreamorosi merged 1 commit into
aws-powertools:mainfrom
thebadalov:fix/parameters-ssm-mixed-decrypt-batch

Conversation

@thebadalov

Copy link
Copy Markdown
Contributor

Summary

When getParametersByName received a mix of parameters with and without decrypt: true, the decrypted ones were fetched through the raw _get(), so the transform was not applied and the values were never cached. This PR routes them through get(), so they get the same transform and cache handling as every other parameter.

Changes

  • Call this.get() instead of this._get() in SSMProvider.getParametersByNameWithDecryptOption, and note in its JSDoc that the transform and cache options apply to each parameter.
  • Add the two unit tests suggested in the issue to SSMProvider.test.ts: one checks that the transform is applied to the decrypted parameters, the other that they are served from the cache on the next call.
  • Since the values now go through get(), an SDK error on this path is wrapped in GetParameterError, as it already is on the other paths.

Issue number: closes #5831


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi
dreamorosi enabled auto-merge (squash) October 25, 2026 08:25
@dreamorosi
dreamorosi merged commit b31e79e into aws-powertools:main Oct 25, 2026
43 checks passed
@powertools-for-aws-oss-automation

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

@thebadalov
thebadalov deleted the fix/parameters-ssm-mixed-decrypt-batch branch October 25, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M PR between 30-99 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: getParametersByName skips transform and cache for decrypted parameters in a mixed batch

2 participants