UNPKG

@aws-cdk/aws-ssm

Version:

The CDK Construct Library for AWS::SSM

65 lines (45 loc) 1.87 kB
# AWS Systems Manager Construct Library <!--BEGIN STABILITY BANNER--> --- ![End-of-Support](https://img.shields.io/badge/End--of--Support-critical.svg?style=for-the-badge) > AWS CDK v1 has reached End-of-Support on 2023-06-01. > This package is no longer being updated, and users should migrate to AWS CDK v2. > > For more information on how to migrate, see the [_Migrating to AWS CDK v2_ guide][doc]. > > [doc]: https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html --- <!--END STABILITY BANNER--> This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. ## Installation Install the module: ```console $ npm i @aws-cdk/aws-ssm ``` Import it into your code: ```ts nofixture import * as ssm from '@aws-cdk/aws-ssm'; ``` ## Using existing SSM Parameters in your CDK app You can reference existing SSM Parameter Store values that you want to use in your CDK app by using `ssm.StringParameter.fromStringParameterAttributes`: [using SSM parameter](test/integ.parameter-store-string.lit.ts) ## Creating new SSM Parameters in your CDK app You can create either `ssm.StringParameter` or `ssm.StringListParameter`s in a CDK app. These are public (not secret) values. Parameters of type *SecureString* cannot be created directly from a CDK application; if you want to provision secrets automatically, use Secrets Manager Secrets (see the `@aws-cdk/aws-secretsmanager` package). ```ts new ssm.StringParameter(this, 'Parameter', { allowedPattern: '.*', description: 'The value Foo', parameterName: 'FooParameter', stringValue: 'Foo', tier: ssm.ParameterTier.ADVANCED, }); ``` [creating SSM parameters](test/integ.parameter.lit.ts) When specifying an `allowedPattern`, the values provided as string literals are validated against the pattern and an exception is raised if a value provided does not comply.