Skip to main content

AWS Systems Manager Construct Library

---

cfn-resources: Stable

cdk-constructs: 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:

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.StringParameter.fromStringParameterAttributes:

# 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
string_value_version_from_token = ssm.StringParameter.from_string_parameter_attributes(self, "MyValueVersionFromToken",
    parameter_name="/My/Public/Parameter",
    # parameter version from token
    version=parameter_version
).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
)
secret_value_version_from_token = ssm.StringParameter.from_secure_string_parameter_attributes(self, "MySecureValueVersionFromToken",
    parameter_name="/My/Secret/Parameter",
    # parameter version from token
    version=parameter_version
)

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 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).

ssm.StringParameter(self, "Parameter",
    allowed_pattern=".*",
    description="The value Foo",
    parameter_name="FooParameter",
    string_value="Foo",
    tier=ssm.ParameterTier.ADVANCED
)
# 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.

Metadata

Release files for aws-cdk.aws-ssm 1.187.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aws-cdk.aws-ssm 1.187.0
File Size Uploaded Provenance Actions
aws-cdk.aws-ssm-1.187.0.tar.gz 289.3 kB Without provenance Details for aws-cdk.aws-ssm-1.187.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aws-cdk.aws-ssm 1.187.0
File Interpreter ABI Platform Actions
aws_cdk.aws_ssm-1.187.0-py3-none-any.whl Python 3 none any Details for aws_cdk.aws_ssm-1.187.0-py3-none-any.whl

Total release size: 579.0 kB

Release files / aws-cdk.aws-ssm-1.187.0.tar.gz

Download URL aws-cdk.aws-ssm-1.187.0.tar.gz
Size 289.3 kB
Tags Source
SHA-256 checksum
How to use checksums
562959485023b2047fe1b09b0dec19a22c23fe90359860c188f46c94991d5700
BLAKE2b-256 checksum
How to use checksums
b9699d40200ea8dbfd14f6b929482bcccf629697657c22d7b7fd764bc70b158d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / aws_cdk.aws_ssm-1.187.0-py3-none-any.whl

Download URL aws_cdk.aws_ssm-1.187.0-py3-none-any.whl
Size 289.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59efef02a9048093b337f34b930c89543bb613dac0b63159a301f518d1918bf0
BLAKE2b-256 checksum
How to use checksums
0079962f2b326912dcea33af7527b0b1df2e2d42759f944199891a6ebabdcb36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Security for aws-cdk.aws-ssm 1.187.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.187.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page