aws-cdk-lib.aws_ssm.StringListParameter

class StringListParameter (construct)

LanguageType name
.NETAmazon.CDK.AWS.SSM.StringListParameter
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsssm#StringListParameter
Javasoftware.amazon.awscdk.services.ssm.StringListParameter
Pythonaws_cdk.aws_ssm.StringListParameter
TypeScript (source)aws-cdk-lib » aws_ssm » StringListParameter

Implements IConstruct, IDependable, IResource, IStringListParameter, IParameter

Creates a new StringList SSM Parameter.

Example

ssm.StringListParameter.valueForTypedListParameter(this, '/My/Public/Parameter', ssm.ParameterValueType.AWS_EC2_IMAGE_ID);

Initializer

new StringListParameter(scope: Construct, id: string, props: StringListParameterProps)

Parameters

  • scope Construct
  • id string
  • props StringListParameterProps

Construct Props

NameTypeDescription
stringListValuestring[]The values of the parameter.
allowedPattern?stringA regular expression used to validate the parameter value.
description?stringInformation about the parameter that you want to add to the system.
parameterName?stringThe name of the parameter.
simpleName?booleanIndicates of the parameter name is a simple name (i.e. does not include "/" separators).
tier?ParameterTierThe tier of the string parameter.

stringListValue

Type: string[]

The values of the parameter.

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


allowedPattern?

Type: string (optional, default: no validation is performed)

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+$


description?

Type: string (optional, default: none)

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


parameterName?

Type: string (optional, default: a name will be generated by CloudFormation)

The name of the parameter.


simpleName?

Type: boolean (optional, default: auto-detect based on parameterName)

Indicates of the parameter name is a simple name (i.e. does not include "/" separators).

This is only 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.


tier?

Type: ParameterTier (optional, default: undefined)

The tier of the string parameter.

Properties

NameTypeDescription
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
parameterArnstringThe ARN of the SSM Parameter resource.
parameterNamestringThe name of the SSM Parameter resource.
parameterTypestringThe type of the SSM Parameter resource.
stackStackThe stack in which this resource is defined.
stringListValuestring[]The parameter value.
encryptionKey?IKeyThe encryption key that is used to encrypt this parameter.

env

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node

Type: Node

The tree node.


parameterArn

Type: string

The ARN of the SSM Parameter resource.


parameterName

Type: string

The name of the SSM Parameter resource.


parameterType

Type: string

The type of the SSM Parameter resource.


stack

Type: Stack

The stack in which this resource is defined.


stringListValue

Type: string[]

The parameter value.

Value must not nest another parameter. Do not use {{}} in the value. Values in the array cannot contain commas (,).


encryptionKey?

Type: IKey (optional)

The encryption key that is used to encrypt this parameter.

  • @default - default master key

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
grantRead(grantee)Grants read (DescribeParameter, GetParameter, GetParameterHistory) permissions on the SSM Parameter.
grantWrite(grantee)Grants write (PutParameter) permissions on the SSM Parameter.
toString()Returns a string representation of this construct.
static fromListParameterAttributes(scope, id, attrs)Imports an external string list parameter with name and optional version.
static fromStringListParameterName(scope, id, stringListParameterName)Imports an external parameter of type string list.
static valueForTypedListParameter(scope, parameterName, type?, version?)Returns a token that will resolve (during deployment) to the list value of an SSM StringList parameter.

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


grantRead(grantee)

public grantRead(grantee: IGrantable): Grant

Parameters

  • grantee IGrantable

Returns

  • Grant

Grants read (DescribeParameter, GetParameter, GetParameterHistory) permissions on the SSM Parameter.


grantWrite(grantee)

public grantWrite(grantee: IGrantable): Grant

Parameters

  • grantee IGrantable

Returns

  • Grant

Grants write (PutParameter) permissions on the SSM Parameter.


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromListParameterAttributes(scope, id, attrs)

public static fromListParameterAttributes(scope: Construct, id: string, attrs: ListParameterAttributes): IStringListParameter

Parameters

  • scope Construct
  • id string
  • attrs ListParameterAttributes

Returns

  • IStringListParameter

Imports an external string list parameter with name and optional version.


static fromStringListParameterName(scope, id, stringListParameterName)

public static fromStringListParameterName(scope: Construct, id: string, stringListParameterName: string): IStringListParameter

Parameters

  • scope Construct
  • id string
  • stringListParameterName string

Returns

  • IStringListParameter

Imports an external parameter of type string list.

Returns a token and should not be parsed.


static valueForTypedListParameter(scope, parameterName, type?, version?)

public static valueForTypedListParameter(scope: Construct, parameterName: string, type?: ParameterValueType, version?: number): string[]

Parameters

  • scope Construct — Some scope within a stack.
  • parameterName string — The name of the SSM parameter.
  • type ParameterValueType — the type of the SSM list parameter.
  • version number — The parameter version (recommended in order to ensure that the value won't change during deployment).

Returns

  • string[]

Returns a token that will resolve (during deployment) to the list value of an SSM StringList parameter.