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.195.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.195.0
File Size Uploaded Provenance Actions
aws-cdk.aws-ssm-1.195.0.tar.gz 288.4 kB Without provenance Details for aws-cdk.aws-ssm-1.195.0.tar.gz

Built distribution (wheel)

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

Total release size: 577.1 kB

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

Download URL aws-cdk.aws-ssm-1.195.0.tar.gz
Size 288.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2ee5400b00754b1eb120ff32bfd74314a161ba33f4eeeacf0a1043443e89a1a5
BLAKE2b-256 checksum
How to use checksums
1ec01f3c668a9b6282569197fca7442ceb1d1e6dabdeb4f26b605b4c3f85cc47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

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

Download URL aws_cdk.aws_ssm-1.195.0-py3-none-any.whl
Size 288.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28921e85bbc832b221bf33b5ac38f8e8c32179eeea53ba014d01e61467354c2e
BLAKE2b-256 checksum
How to use checksums
0c2935acdc8c94228ed0386277c2c4cd78dc05ce87d0bf9521712eb9c4230cfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Security for aws-cdk.aws-ssm 1.195.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.195.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