Home > Software engineering >  Allowed Values in cloudformation
Allowed Values in cloudformation

Time:05-20

I am using a parameter to ask a user weather he wants a D drive or not, to do this I am using conditions.

I tried to give a Constraint Description and Allowed Values a parameter property.

  NeedVolumeD:
    Type: String
    Description: Do you want a D drive? Enter Yes or No
    ConstraintDescription: Enter Yes or No
    AllowedValues:
      - Yes
      - No

But this is giving me a dropdown of true and false whereas later in my code under Conditions I am trying to use Yes and No, although this is somehow working.

enter image description here

What am I not understanding here.

CodePudding user response:

You have to use single quotes:

  NeedVolumeD:
    Type: String
    Description: Do you want a D drive? Enter Yes or No
    ConstraintDescription: Enter Yes or No
    AllowedValues:
      - 'Yes'
      - 'No'

Otherwise, YAML (old version) will automatically convert Yes/No into true/false.

  • Related