Skip to content

Commit

Permalink
feat(ssm): Add ConfigProvider with default decryption
Browse files Browse the repository at this point in the history
The ConfigProvider now has the ability to retrieve parameters from the parameter store with decryption enabled by default.

Fixes #63
  • Loading branch information
floydspace committed Sep 26, 2024
1 parent 7088fc4 commit f45941d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/plenty-coins-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect-aws/ssm": patch
---

**ConfigProvider** get parameter with decryption by default
5 changes: 4 additions & 1 deletion packages/ssm/src/ConfigProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export const fromParameterStore = (config?: {
primitive: Config.Config.Primitive<A>,
): Effect.Effect<Array<A>, ConfigError.ConfigError> => {
const pathString = makePathString(path);
return SSMService.getParameter({ Name: pathString }).pipe(
return SSMService.getParameter({
Name: pathString,
WithDecryption: true,
}).pipe(
Effect.flatMap((value) => Option.fromNullable(value.Parameter?.Value)),
Effect.catchTag("ParameterNotFound", () =>
Effect.fail(
Expand Down

0 comments on commit f45941d

Please sign in to comment.