Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.
I'm submitting a ...
What is the current behavior?
If the current behavior is a :beetle:bug:beetle:: Please provide the steps to reproduce
At the moment StringListParameter class has fromStringListParameterName parameter is rendered using CfnDynamicReference
As a result ssm.StringListParameter.string_list_value creates AWS Cloudformation code block like this:
{
"Fn::Split": [
",",
"{{resolve:ssm:parameter-name}}"
]
}
That means that StringListParameter should have parameter-name and version. At the moment aws cdk renders parameter-name only.
AWS Cloudformation shows Validation error
ValidationError: Incorrect format is used in the following SSM reference: [{{resolve:ssm:parameter-name}}]
Incorrect format is used in the following SSM reference: [{{resolve:ssm:parameter-name}}]
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)
ValidationError: Incorrect format is used in the following SSM reference: [{{resolve:ssm:parameter-name}}]
at Request.extractError (/home/user/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/protocol/query.js:50:29)
at Request.callListeners (/home/user/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/home/user/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/home/user/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/home/user/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/home/user/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /home/user/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/home/user/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/home/user/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/home/user/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
This isn't just a python issue, happening with typescript as well. I tried the following which does give me a valid cloudformation template but this wont work due to limitiations and buggy behaviour with how cloudformation executes rather than aws-cdk
const lambda = new Function(this, 'Lambda', {...}) // No need to set vpc here. Added benifit is actuall less code
const cfnLambda = lambda.node.defaultChild as CfnFunction;
cfnLambda.vpcConfig = {
securityGroupIds: [vpcSecurityGroup.stringValue],
subnetIds: Fn.split(',', new CfnDynamicReference(CfnDynamicReferenceService.SSM, `${vpcSubnetId.parameterName}:1`).toString()),
}; // where `:1` is assigning the version i wanted
It's been a year, and it appears we cannot use StringListParameter yet.
What is the workaround?
If this cannot be fixed please annotate the documentation for StringListParameter and say it cannot be used.
I ran into this as well. It makes using StringListParameter in CDK impossible, currently. Any plan to fix this?
The workaround for me is to use a StringParameter with comma-separated values and to the splitting and joining myself.
Just ran into this problem. So :+1: in favor of a solution.
I would try and fix this myself. Any hint on were/how to get going @MrArnoldPalmer ?
Most helpful comment
I ran into this as well. It makes using
StringListParameterin CDK impossible, currently. Any plan to fix this?The workaround for me is to use a
StringParameterwith comma-separated values and to the splitting and joining myself.