AWS cloud environment dependency

I am trying to do the following:

"Parameters": {
    "InterfaceMode" : {
        "Description": "Configure instance to run in onearm or inline mode",
        "Type": "String",
        "Default": "onearm",
        "AllowedValues": [ "onearm", "inline" ], 
    }
    "InlineSubnetId" : {
        "Description": "Name of a subnet assigned to the VPC to use for second interface in inline mode.", 
        "Type": "AWS::EC2::Subnet::Id",
        "Default": "None"
    },

Now, if the user selects onearm, only one interface is needed, and InlineSubnetId is not needed. Typically, the user leaves "InlineSubnetId" empty, but this does not work with cloud validation because it requires a value for AWS types. I can't just use the string type, since I want the user to select from the SUS-supplied SubnetIds.

How to get around this?

  • Is there a way around the validation by letting the selected AWS type be empty?
  • Any way to add another None parameter to the Subnet :: Id list?
  • Is there a way to hide the inlineSubnetId parameter only if the mode is inline?
  • What about the second parameter page, which depends on the output of the first parameter page?

Thanks for the help.

+4
3

, . , , - AWS:: NoValue , , .

0

, , , - AWS (.. AWS::*). . String AllowedPattern - ^(subnet-[0-9a-fA-F]{8})?$, .

0

Source: https://habr.com/ru/post/1658491/


All Articles