anantab / serverless-plugin-ifelse

A Serverless Plugin to write If Else conditions in serverless YAML file
69 stars 21 forks source link

How to write nested If using this ? Is this feature avalaible yet ? #8

Closed GurpreetSingh5 closed 5 years ago

GurpreetSingh5 commented 5 years ago

How to write nested If using this? Is this feature available yet? I want to check multiple nested conditions?

anantab commented 5 years ago

How to write nested If using this? Is this feature available yet? I want to check multiple nested conditions?

You can easily achieve nested conditions by writing multiple if conditions. Eg

- If: '"${self:custom.currentStage}" == "dev"'
        Set:
          provider.profile: dev
- If: '"${self:custom.currentStage}" == "test"'
        Set:
          provider.profile: test
- If: '"${self:custom.currentStage}" != "dev" && ${self:custom.currentStage}" != "test"'
        Set:
          provider.profile: prod
anantab commented 5 years ago

Duplicate of #5