Search code examples
amazon-web-servicesyamlaws-cloudformationserverless-framework

How to retrieve ssm parameter value using serverless


I have a AWS SSM parameter which is stringlist type and it contains 3 subnet ids. I want to get the first subnet id and below code I am using

SubnetId: !Select [0, !Split [",", "${ssm:/subnet-ids}"]]

This is giving below error:

Template error: every Fn::Split object requires two parameters, (1) a string delimiter and (2) a string to be split or a function that returns a string to be split.

How can I use intrinsic function to fetch the value of the string list parameter?


Solution

  • Recent releases of Serverless Framework handles this automatically by default. No need to use the !Split intrinsic function anymore. Read more here: https://serverless.com/framework/docs/providers/aws/guide/variables#resolve-stringlist-as-array-of-strings