0

I'm having an issue with AWS CDK. I'm defining an SSM StringListParameter (https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ssm.StringListParameter.html) with a defined allowedPattern value of '^\w+$' the thing is that while this was possible to use if defined in a CF template, it seems that it is not usable from the "CDK side of things".

Any thoughts?

PS: For now I've solved this by modifying the pattern to something like '^[a-zA-Z0-9_]+$' but for longer patterns this gets difficult to read, really fast. This report was made for CDK version 1.84.0

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • It sounds as if you need to double the backslash. `'^\\w+$'`? – Wiktor Stribiżew Jan 13 '21 at 14:43
  • @WiktorStribiżew Thank you! I've been wondering what was wrong, it WAS the escaping. Still I find it odd that you would need it in CDK and not in CF template. This makes me wonder if the example in the docs are clear enough, where they have an example of **^\d+$** it should be read **^\\d+$** – João Miguel Jan 13 '21 at 14:58
  • It is a JavaScript related thing. – Wiktor Stribiżew Jan 13 '21 at 15:00

0 Answers0