Skip to main content

The CDK Construct Library for AWS::SSM

Project description

AWS Systems Manager Construct Library

---

Stability: Stable


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:

# Example may have issues. See https://github.com/aws/jsii/issues/826
import aws_cdk.aws_ssm as 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:

# Example may have issues. See https://github.com/aws/jsii/issues/826
# Retrieve the latest value of the non-secret parameter
# with name "/My/String/Parameter".
string_value = ssm.StringParameter.from_string_parameter_attributes(self, "MyValue",
    parameter_name="/My/Public/Parameter"
).string_value

# Retrieve a specific version of the secret (SecureString) parameter.
# 'version' is always required.
secret_value = ssm.StringParameter.from_secure_string_parameter_attributes(self, "MySecureValue",
    parameter_name="/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).

# Example may have issues. See https://github.com/aws/jsii/issues/826
# Create a new SSM Parameter holding a String
param = ssm.StringParameter(stack, "StringParameter",
    # description: 'Some user-friendly description',
    # name: 'ParameterName',
    string_value="Initial parameter value"
)

# Grant read access to some Role
param.grant_read(role)

# Create a new SSM Parameter holding a StringList
list_parameter = ssm.StringListParameter(stack, "StringListParameter",
    # description: 'Some user-friendly description',
    # name: 'ParameterName',
    string_list_value=["Initial parameter value A", "Initial parameter value B"]
)

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-1.16.1.tar.gz (124.2 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-1.16.1-py3-none-any.whl (122.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aws-cdk.aws-ssm-1.16.1.tar.gz
Algorithm Hash digest
SHA256 15ce17494752a5f95e13ba6bb5e3d40d9613b9f30d4748c39fb844c15599f3bd
MD5 5d869bfc3cdb4e59034404af8f1ae800
BLAKE2b-256 cd18618113f44d2252f926a94689812da746a5500bf28e4a6fbacc996c32a73f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for aws_cdk.aws_ssm-1.16.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d8ec77ff33cb2871830740bd61c078d9061b57ba642f5a269f5f1572dbfa436
MD5 a1aa625b254d5fc78fd7e74d7b383a8d
BLAKE2b-256 66098d13fdd34c11c0af2004645c43b68bd6026d66a0f75cf9529641f8ab3866

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