Skip to content

(aws-ssm): aws-ssm.ParameterType.STRING_LIST value is incorrect #12477

@akuma12

Description

@akuma12

In Python, when trying to get the value of a StringList type SSM Parameter at deploy-time using ssm.StringParameter.value_for_typed_string_parameter(), the enum value for aws-ssm.ParameterType.STRING_LIST returns 'StringList'. This generates a CFN Parameter like:

SsmParameterValueMyParameterC96584B6F00A464EAD1953AFF4B05118Parameter:
    Type: AWS::SSM::Parameter::Value<StringList>
    Default: /my/string/list/parameter

However, AWS::SSM::Parameter::Value<StringList> is not a valid CloudFormation parameter type. It should be AWS::SSM::Parameter::Value<List<String>> or AWS::SSM::Parameter::Value<CommaDelimitedList>

Reproduction Steps

Reference a StringList type SSM parameter like:

my_string_list_parameter = aws_ssm.StringParameter.value_for_typed_string_parameter(
            self,
            parameter_name="/my/string/list/parameter",
            type=aws_ssm.ParameterType.STRING_LIST
        )

What did you expect to happen?

A correct SSM List type parameter is added to the CDK output file, like:

SsmParameterValueMyParameterC96584B6F00A464EAD1953AFF4B05118Parameter:
    Type: AWS::SSM::Parameter::Value<List<String>>
    Default: /my/string/list/parameter

What actually happened?

An invalid SSM parameter type is generated:

SsmParameterValueMyParameterC96584B6F00A464EAD1953AFF4B05118Parameter:
    Type: AWS::SSM::Parameter::Value<StringList>
    Default: /my/string/list/parameter

When I try to deploy this project, I get the error Template format error: Unrecognized parameter type: StringList

Environment

  • CDK CLI Version: 1.83.0
  • Framework Version: 1.83.0
  • Node.js Version: v12.18.3
  • OS: MacOS 10.15.7
  • Language (Version): Python (3.8.5)

This is 🐛 Bug Report

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-ssmRelated to AWS Systems ManagerbugThis issue is a bug.effort/mediumMedium work item – several days of effortp1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions