StringParameterProps

class aws_cdk.aws_ssm.StringParameterProps(*, allowed_pattern=None, description=None, parameter_name=None, simple_name=None, tier=None, string_value, data_type=None, type=None)

Bases: ParameterOptions

Properties needed to create a String SSM parameter.

Parameters:
  • allowed_pattern (Optional[str]) – A regular expression used to validate the parameter value. For example, for String types with values restricted to numbers, you can specify the following: ^\d+$ Default: no validation is performed

  • description (Optional[str]) – Information about the parameter that you want to add to the system. Default: none

  • parameter_name (Optional[str]) – The name of the parameter. Default: - a name will be generated by CloudFormation

  • simple_name (Optional[bool]) – Indicates whether the parameter name is a simple name. A parameter name without any “/” is considered a simple name. If the parameter name includes “/”, setting simpleName to true might cause unintended issues such as duplicate “/” in the resulting ARN. This is required only if parameterName is a token, which means we are unable to detect if the name is simple or “path-like” for the purpose of rendering SSM parameter ARNs. If parameterName is not specified, simpleName must be true (or undefined) since the name generated by AWS CloudFormation is always a simple name. Default: - auto-detect based on parameterName

  • tier (Optional[ParameterTier]) – The tier of the string parameter. Default: - undefined

  • string_value (str) – The value of the parameter. It may not reference another parameter and {{}} cannot be used in the value.

  • data_type (Optional[ParameterDataType]) – The data type of the parameter, such as text or aws:ec2:image. Default: ParameterDataType.TEXT

  • type (Optional[ParameterType]) – (deprecated) The type of the string parameter. Default: ParameterType.STRING

ExampleMetadata:

infused

Example:

import aws_cdk.aws_lambda as lambda_

# func: lambda.IFunction


simple_parameter = ssm.StringParameter(self, "StringParameter",
    # the parameter name doesn't contain any '/'
    parameter_name="parameter",
    string_value="SOME_VALUE",
    simple_name=True
)
non_simple_parameter = ssm.StringParameter(self, "StringParameter",
    # the parameter name contains '/'
    parameter_name=f"/{func.functionName}/my/app/param",
    string_value="SOME_VALUE",
    simple_name=False
)

Attributes

allowed_pattern

A regular expression used to validate the parameter value.

For example, for String types with values restricted to numbers, you can specify the following: ^\d+$

Default:

no validation is performed

data_type

The data type of the parameter, such as text or aws:ec2:image.

Default:

ParameterDataType.TEXT

description

Information about the parameter that you want to add to the system.

Default:

none

parameter_name

The name of the parameter.

Default:
  • a name will be generated by CloudFormation

simple_name

Indicates whether the parameter name is a simple name.

A parameter name without any “/” is considered a simple name. If the parameter name includes “/”, setting simpleName to true might cause unintended issues such as duplicate “/” in the resulting ARN.

This is required only if parameterName is a token, which means we are unable to detect if the name is simple or “path-like” for the purpose of rendering SSM parameter ARNs.

If parameterName is not specified, simpleName must be true (or undefined) since the name generated by AWS CloudFormation is always a simple name.

Default:
  • auto-detect based on parameterName

string_value

The value of the parameter.

It may not reference another parameter and {{}} cannot be used in the value.

tier

The tier of the string parameter.

Default:
  • undefined

type

(deprecated) The type of the string parameter.

Default:

ParameterType.STRING

Deprecated:
  • type will always be ‘String’

Stability:

deprecated