Skip to main content

The CDK Construct Library for AWS::SSM

Project description

AWS Systems Manager Construct Library


Stability: Experimental

This API is still under active development and subject to non-backward compatible changes or removal in any future version. Use of the API is not recommended in production environments. Experimental APIs are not subject to the Semantic Versioning model.


This module is part of the AWS Cloud Development Kit project.

Installation

Install the module:

$ npm i @aws-cdk/aws-ssm

Import it into your code:

import ssm = require('@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.ParameterStoreString:

    // Retrieve the latest value of the non-secret parameter
    // with name "/My/String/Parameter".
    const stringValue = new ssm.ParameterStoreString(this, 'MyValue', {
      parameterName: '/My/Public/Parameter',
      // 'version' can be specified but is optional.
    }).stringValue;

    // Retrieve a specific version of the secret (SecureString) parameter.
    // 'version' is always required.
    const secretValue = new ssm.ParameterStoreSecureString({
      parameterName: '/My/Secret/Parameter',
      version: 5
    });

Creating new SSM Parameters in your CDK app

You can create either ssm.StringParameter or ssm.StringListParameters in a CDK app. These are public (not secret) values. Parameters of type SecretString 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).

// Create a new SSM Parameter holding a String
const param = new ssm.StringParameter(stack, 'StringParameter', {
  // description: 'Some user-friendly description',
  // name: 'ParameterName',
  stringValue: 'Initial parameter value',
  // allowedPattern: '.*',
});

// Grant read access to some Role
param.grantRead(role);

// Create a new SSM Parameter holding a StringList
const listParameter = new ssm.StringListParameter(stack, 'StringListParameter', {
  // description: 'Some user-friendly description',
  // name: 'ParameterName',
  stringListValue: ['Initial parameter value A', 'Initial parameter value B'],
  // allowedPattern: '.*',
});

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws-cdk.aws-ssm-0.34.0.tar.gz (82.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aws_cdk.aws_ssm-0.34.0-py3-none-any.whl (80.1 kB view details)

Uploaded Python 3

File details

Details for the file aws-cdk.aws-ssm-0.34.0.tar.gz.

File metadata

  • Download URL: aws-cdk.aws-ssm-0.34.0.tar.gz
  • Upload date:
  • Size: 82.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5

File hashes

Hashes for aws-cdk.aws-ssm-0.34.0.tar.gz
Algorithm Hash digest
SHA256 4e545465dde479edb81c2f86f3f9a6a7e300dbe42d7b736ae87b9035c87343c6
MD5 7084f3f1bc5e8416750e18829f239465
BLAKE2b-256 8151e19490cdad7b6731693441186a7d63be8a0d29c63e500c5c161b9af1cbe4

See more details on using hashes here.

File details

Details for the file aws_cdk.aws_ssm-0.34.0-py3-none-any.whl.

File metadata

  • Download URL: aws_cdk.aws_ssm-0.34.0-py3-none-any.whl
  • Upload date:
  • Size: 80.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5

File hashes

Hashes for aws_cdk.aws_ssm-0.34.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11d54771f4ac663ff8eb056393f79e1a5697b7d0e29073aeaaf7a1e91e7f84bf
MD5 f41615d43fb8768d26984ca6436f596a
BLAKE2b-256 230986db75d17b99c9cbc96eb91bd41e3dcd5f3b06f7c372cc86736dbf0ea9d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page