How can I write nested IF in serverless.yml using yaml format file while using it for cloud formation?


I’m trying to access secrets created in secrets manager( via SSM (Systems Manager- ) i.e. AWS Parameter store, and store it in a custom YAML variable in serverless.yml file?
I am trying to implement cloud formation through serverless framework(, and I am trying to implement a nested if statement in cloud formation for implementing the above using the code below.

I have tried Cloud formation instrinsic functions Fn::If for this but facing this errror :
Fn::If requires a list argument with the first element being a condition


Just want to point out that if you’re looking to load different SSM paths based on environment, you can achieve this many ways, outlined here

I’ve had a pleasant time loading through json files, for example

Hope this helps whoever else lands here from a search

Leave a Reply