# 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](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:
```python
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`:
```python
# 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.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).
```python
ssm.StringParameter(self, "Parameter",
allowed_pattern=".*",
description="The value Foo",
parameter_name="FooParameter",
string_value="Foo",
tier=ssm.ParameterTier.ADVANCED
)
```
```python
# 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/aws/aws-cdk",
"name": "aws-cdk.aws-ssm",
"maintainer": "",
"docs_url": null,
"requires_python": "~=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Amazon Web Services",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/37/3d/25d837696b0cb868c8caefbae8ab1f0cb8f233197d925ca9372a2b889d90/aws-cdk.aws-ssm-1.204.0.tar.gz",
"platform": null,
"description": "# AWS Systems Manager Construct Library\n\n<!--BEGIN STABILITY BANNER-->---\n\n\n![End-of-Support](https://img.shields.io/badge/End--of--Support-critical.svg?style=for-the-badge)\n\n> AWS CDK v1 has reached End-of-Support on 2023-06-01.\n> This package is no longer being updated, and users should migrate to AWS CDK v2.\n>\n> For more information on how to migrate, see the [*Migrating to AWS CDK v2* guide](https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html).\n\n---\n<!--END STABILITY BANNER-->\n\nThis module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.\n\n## Installation\n\nInstall the module:\n\n```console\n$ npm i @aws-cdk/aws-ssm\n```\n\nImport it into your code:\n\n```python\nimport aws_cdk.aws_ssm as ssm\n```\n\n## Using existing SSM Parameters in your CDK app\n\nYou can reference existing SSM Parameter Store values that you want to use in\nyour CDK app by using `ssm.StringParameter.fromStringParameterAttributes`:\n\n```python\n# Retrieve the latest value of the non-secret parameter\n# with name \"/My/String/Parameter\".\nstring_value = ssm.StringParameter.from_string_parameter_attributes(self, \"MyValue\",\n parameter_name=\"/My/Public/Parameter\"\n).string_value\nstring_value_version_from_token = ssm.StringParameter.from_string_parameter_attributes(self, \"MyValueVersionFromToken\",\n parameter_name=\"/My/Public/Parameter\",\n # parameter version from token\n version=parameter_version\n).string_value\n\n# Retrieve a specific version of the secret (SecureString) parameter.\n# 'version' is always required.\nsecret_value = ssm.StringParameter.from_secure_string_parameter_attributes(self, \"MySecureValue\",\n parameter_name=\"/My/Secret/Parameter\",\n version=5\n)\nsecret_value_version_from_token = ssm.StringParameter.from_secure_string_parameter_attributes(self, \"MySecureValueVersionFromToken\",\n parameter_name=\"/My/Secret/Parameter\",\n # parameter version from token\n version=parameter_version\n)\n```\n\n## Creating new SSM Parameters in your CDK app\n\nYou can create either `ssm.StringParameter` or `ssm.StringListParameter`s in\na CDK app. These are public (not secret) values. Parameters of type\n*SecureString* cannot be created directly from a CDK application; if you want\nto provision secrets automatically, use Secrets Manager Secrets (see the\n`@aws-cdk/aws-secretsmanager` package).\n\n```python\nssm.StringParameter(self, \"Parameter\",\n allowed_pattern=\".*\",\n description=\"The value Foo\",\n parameter_name=\"FooParameter\",\n string_value=\"Foo\",\n tier=ssm.ParameterTier.ADVANCED\n)\n```\n\n```python\n# Create a new SSM Parameter holding a String\nparam = ssm.StringParameter(stack, \"StringParameter\",\n # description: 'Some user-friendly description',\n # name: 'ParameterName',\n string_value=\"Initial parameter value\"\n)\n\n# Grant read access to some Role\nparam.grant_read(role)\n\n# Create a new SSM Parameter holding a StringList\nlist_parameter = ssm.StringListParameter(stack, \"StringListParameter\",\n # description: 'Some user-friendly description',\n # name: 'ParameterName',\n string_list_value=[\"Initial parameter value A\", \"Initial parameter value B\"]\n)\n```\n\nWhen specifying an `allowedPattern`, the values provided as string literals\nare validated against the pattern and an exception is raised if a value\nprovided does not comply.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "The CDK Construct Library for AWS::SSM",
"version": "1.204.0",
"project_urls": {
"Homepage": "https://github.com/aws/aws-cdk",
"Source": "https://github.com/aws/aws-cdk.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a9169594402d7ae6d9381231715c0df3b72e04a202a03ea360bda5f6fbad020f",
"md5": "316a1d7a73d4b60d7df9868d50671b55",
"sha256": "7364f68e6622077e9f4a0a9a47ee4e6d8ec8723b62755cb788f62a323190e1a0"
},
"downloads": -1,
"filename": "aws_cdk.aws_ssm-1.204.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "316a1d7a73d4b60d7df9868d50671b55",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.7",
"size": 285112,
"upload_time": "2023-06-19T21:01:34",
"upload_time_iso_8601": "2023-06-19T21:01:34.461638Z",
"url": "https://files.pythonhosted.org/packages/a9/16/9594402d7ae6d9381231715c0df3b72e04a202a03ea360bda5f6fbad020f/aws_cdk.aws_ssm-1.204.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "373d25d837696b0cb868c8caefbae8ab1f0cb8f233197d925ca9372a2b889d90",
"md5": "4e9a5192604263c15c9539793150bb7c",
"sha256": "c44183e4f1889aafe6d1d233e1b529858614ab7752ee9a9cbe2e3caf368e5415"
},
"downloads": -1,
"filename": "aws-cdk.aws-ssm-1.204.0.tar.gz",
"has_sig": false,
"md5_digest": "4e9a5192604263c15c9539793150bb7c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.7",
"size": 284723,
"upload_time": "2023-06-19T21:07:44",
"upload_time_iso_8601": "2023-06-19T21:07:44.234618Z",
"url": "https://files.pythonhosted.org/packages/37/3d/25d837696b0cb868c8caefbae8ab1f0cb8f233197d925ca9372a2b889d90/aws-cdk.aws-ssm-1.204.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-19 21:07:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aws",
"github_project": "aws-cdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aws-cdk.aws-ssm"
}