StringListParameter

class aws_cdk.aws_ssm.StringListParameter(scope, id, *, string_list_value, allowed_pattern=None, description=None, parameter_name=None, simple_name=None, tier=None)

Bases: Resource

Creates a new StringList SSM Parameter.

Resource:

AWS::SSM::Parameter

ExampleMetadata:

lit=test/integ.parameter.lit.ts infused

Example:

# 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"]
)
Parameters:
  • scope (Construct) –

  • id (str) –

  • string_list_value (Sequence[str]) – The values of the parameter. It may not reference another parameter and {{}} cannot be used in the value.

  • 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 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. Default: - auto-detect based on parameterName

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

Methods

apply_removal_policy(policy)

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

Parameters:

policy (RemovalPolicy) –

Return type:

None

grant_read(grantee)

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

Parameters:

grantee (IGrantable) –

Return type:

Grant

grant_write(grantee)

Grants write (PutParameter) permissions on the SSM Parameter.

Parameters:

grantee (IGrantable) –

Return type:

Grant

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

encryption_key

The encryption key that is used to encrypt this parameter.

  • @default - default master key

env

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

The construct tree node associated with this construct.

parameter_arn

The ARN of the SSM Parameter resource.

parameter_name

The name of the SSM Parameter resource.

parameter_type

The type of the SSM Parameter resource.

stack

The stack in which this resource is defined.

string_list_value

The parameter value.

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

Static Methods

classmethod from_string_list_parameter_name(scope, id, string_list_parameter_name)

Imports an external parameter of type string list.

Returns a token and should not be parsed.

Parameters:
  • scope (Construct) –

  • id (str) –

  • string_list_parameter_name (str) –

Return type:

IStringListParameter

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool

classmethod is_resource(construct)

Check whether the given construct is a Resource.

Parameters:

construct (IConstruct) –

Return type:

bool