title: How can I write nested IF in serverless.yml using yaml format file while using it for cloud formation?
body: <p>I'm trying to access secrets created in secrets manager(<a href="https://aws.amazon.com/secrets-manager/" rel="nofollow noreferrer">https://aws.amazon.com/secrets-manager/</a>) via SSM (Systems Manager- <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html</a> ) 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(<a href="https://serverless.com/" rel="nofollow noreferrer">https://serverless.com/</a>), and I am trying to implement a nested if statement in cloud formation for implementing the above using the code below.</p>
  
  <pre><code> stage: &amp;stage 'dev' #Hardcoded for now
   rdsMasterPassword:
   !If
    - !Equals [*stage,"prod"]
    - ${ssm:/aws/reference/secretsmanager/cred-prod~true:rdsMasterPassword}
    - !If 
        - !Equals [*stage,"staging"]
        - ${ssm:/aws/reference/secretsmanager/cred-staging~true:rdsMasterPassword}
        - ${ssm:/aws/reference/secretsmanager/cred-dev~true:rdsMasterPassword}
  </code></pre>
  
  <p>I have tried Cloud formation instrinsic functions Fn::If for this but facing this errror :
  <code>Fn::If requires a list argument with the first element being a condition</code></p>