Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 如何识别AWS云形成模板中逗号分隔列表参数的选择_Amazon Web Services_Cloud_Amazon Cloudformation - Fatal编程技术网

Amazon web services 如何识别AWS云形成模板中逗号分隔列表参数的选择

Amazon web services 如何识别AWS云形成模板中逗号分隔列表参数的选择,amazon-web-services,cloud,amazon-cloudformation,Amazon Web Services,Cloud,Amazon Cloudformation,我是AWS的新手,还在学习,但我有一个参数,使用CommaDelimitedList作为CFT中的类型,因此用户可以选择要在VPC上使用的子网。我需要能够在以后创建EC2实例和分配私有IP时引用选择 "SubnetParameterCidrBlock":{ "Description": "Comma-delimited list CIDR blocks for VPC", "Type" : "CommaDelimitedList", "Default": "10.200.

我是AWS的新手,还在学习,但我有一个参数,使用CommaDelimitedList作为CFT中的类型,因此用户可以选择要在VPC上使用的子网。我需要能够在以后创建EC2实例和分配私有IP时引用选择

"SubnetParameterCidrBlock":{
    "Description": "Comma-delimited list CIDR blocks for VPC",
    "Type" : "CommaDelimitedList",
    "Default": "10.200.1.0/24,10.200.2.0/24,10.200.3.0/24"
}
我想我可以做一些事情,比如:

"NetworkInterfaces": [
      {
        "DeleteOnTermination": "true",
        "Description": "Primary network interface",
        "DeviceIndex": 0,
        "SubnetId": {"Ref": "SecureVPCSubnet"},
        "PrivateIpAddresses": [
          {
            "PrivateIpAddress": "Fn::GetAtt" : [ "SubnetParameterCidrBlock" , "Value" ],
            "Primary": "true"
          }
        ],
        "GroupSet": [
          {
            "Ref": "SecurityGroup"
          }
        ]
      }
    ]
这是正确的还是我完全错了


我已经经历了大部分时间。是否还有其他文档提供了更好的示例?

您应该尝试使用
Fn::Select
AWS CFT函数。看看有没有开始……)

不幸的是,Fn::Select要求我知道他们选择了哪一个。这就是我试图解决的问题。我知道整个列表,只是不知道他们在参数选项中选择了哪一个。好吧,如果我理解正确,您只需要访问参数的值,您试试
{“Ref”:“SubnetParameterCidrBlock”}