npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ssm-string-parameter-helper

v0.6.2

Published

Small helpers for reading and writing AWS Systems Manager (SSM) Parameter Store parameters in AWS CDK v2, with a consistent tagging convention.

Readme

SSM String Parameter Helper (CDK v2)

npm version license Node.js build

View on Construct Hub

Small helpers for reading and writing AWS Systems Manager (SSM) Parameter Store parameters in AWS CDK v2, with a consistent tagging convention. The public API is exposed as static methods on SsmParameterHelper (jsii-compatible; the class cannot be instantiated).

Features

  • Read SSM String parameters with SsmParameterHelper.readFromStringParameter (CloudFormation dynamic references; return value may be a CDK token)
  • Read SSM StringList parameters with SsmParameterHelper.readFromStringListParameter (return value may include CDK tokens)
  • Optionally validate Parameter Store value types at deploy time via ssm.ParameterValueType
  • Create String / StringList parameters with SsmParameterHelper.writeToStringParameter / SsmParameterHelper.writeToStringListParameter
  • Apply a default ssm:managed-by=ssm-string-parameter-helper tag on created parameters, plus optional custom tags
  • Expand a StringList token into a fixed-length CloudFormation string[] with SsmParameterHelper.splitListTokenToStrings

How it works

Call a static method on SsmParameterHelper from a CDK stack.

Reads use CloudFormation dynamic references. The returned value may be a token and is resolved at deploy time. Pass ssm.ParameterValueType when deploy time should check the Parameter Store value type.

Writes create an SSM parameter and always add the tag ssm:managed-by=ssm-string-parameter-helper. Tags in props.tags are applied as well. writeToStringListParameter stores the list as one comma-separated string. The list must contain at least one value, and a resolved value must not contain a comma. Unresolved CDK tokens are not inspected.

splitListTokenToStrings turns a StringList token into a fixed-length string[]. The length must be an integer greater than or equal to 0 and known at synthesis.

This helper covers String and StringList only. It does not read or write SecureString parameters, and it does not resolve parameter values during cdk synth.

Installation

npm

npm install ssm-string-parameter-helper

yarn

yarn add ssm-string-parameter-helper

pnpm

pnpm add ssm-string-parameter-helper

Usage

import { Stack } from 'aws-cdk-lib';
import { SsmParameterHelper } from 'ssm-string-parameter-helper';

const stack = new Stack();

SsmParameterHelper.writeToStringParameter(stack, 'ParamString', {
  parameterName: '/my/app/value',
  stringValue: 'hello',
});

Typed reads and StringList values

import * as ssm from 'aws-cdk-lib/aws-ssm';
import { Stack } from 'aws-cdk-lib';
import { SsmParameterHelper } from 'ssm-string-parameter-helper';

const stack = new Stack();

const imageId = SsmParameterHelper.readFromStringParameter(stack, '/my/ami', ssm.ParameterValueType.AWS_EC2_IMAGE_ID);

const subnetsTokenList = SsmParameterHelper.readFromStringListParameter(stack, '/my/subnet-ids', ssm.ParameterValueType.STRING);
const subnets = SsmParameterHelper.splitListTokenToStrings(subnetsTokenList, 3);

SsmParameterHelper.writeToStringListParameter(stack, 'ParamList', {
  parameterName: '/my/app/list',
  stringListValue: ['a', 'b'],
  description: 'application list',
  tier: ssm.ParameterTier.STANDARD,
  tags: { team: 'platform' },
});

Options

SsmParameterHelper.readFromStringParameter(scope, parameterName, type?)

| Name | Required | Description | | --- | --- | --- | | scope | yes | Construct scope used to bind the lookup token. | | parameterName | yes | Parameter name (for example, /my/app/value). | | type | no | ssm.ParameterValueType validated at deploy time. |

Returns a string that may be a CDK token.

SsmParameterHelper.readFromStringListParameter(scope, parameterName, type?)

| Name | Required | Description | | --- | --- | --- | | scope | yes | Construct scope used to bind the lookup token. | | parameterName | yes | Parameter name (for example, /my/app/list). | | type | no | ssm.ParameterValueType validated at deploy time. |

Returns a string[] that may contain CDK tokens.

SsmParameterHelper.writeToStringParameter(scope, id, props)

| Name | Required | Description | | --- | --- | --- | | scope | yes | Construct scope to define the parameter in. | | id | yes | CDK construct id for the parameter resource. | | props.parameterName | yes | Parameter name (for example, /my/app/value). | | props.stringValue | yes | Parameter value. | | props.description | no | Parameter description. | | props.tier | no | SSM parameter tier. Defaults to STANDARD. | | props.tags | no | Additional tags, applied in addition to ssm:managed-by=ssm-string-parameter-helper. |

Returns the created ssm.StringParameter.

SsmParameterHelper.writeToStringListParameter(scope, id, props)

| Name | Required | Description | | --- | --- | --- | | scope | yes | Construct scope to define the parameter in. | | id | yes | CDK construct id for the parameter resource. | | props.parameterName | yes | Parameter name (for example, /my/app/list). | | props.stringListValue | yes | List of strings. Must contain at least one value. A resolved value must not contain a comma. Unresolved CDK tokens are not inspected. | | props.description | no | Parameter description. | | props.tier | no | SSM parameter tier. Defaults to STANDARD. | | props.tags | no | Additional tags, applied in addition to ssm:managed-by=ssm-string-parameter-helper. |

Returns the created ssm.StringListParameter.

SsmParameterHelper.splitListTokenToStrings(listToken, length)

| Name | Required | Description | | --- | --- | --- | | listToken | yes | Token list produced by an SSM StringList lookup. | | length | yes | Fixed output length. Must be an integer greater than or equal to 0 and known at synthesis. |

Returns a CloudFormation-level fixed-length string[].

API

See API.md.

Requirements

  • Node.js >= 20.0.0
  • aws-cdk-lib ^2.232.0
  • constructs ^10.5.1

License

This project is licensed under the (Apache-2.0) License.