Nested lists in yaml

后端 未结 3 982
隐瞒了意图╮
隐瞒了意图╮ 2021-01-03 19:28

How can I create nested lists in YAML? I want to get:

 {\"Hello\": [\"as\", [\"http://\", [\"cat\"]]]}

Here\'s my YAML that doesn\'t work (

3条回答
  •  不知归路
    2021-01-03 19:51

    start nested list from a new line. using this approach it is easy to figure out.

    Read this and this articles. They have a lot of examples.

    try like this:

    YAML

    Value:
        "Fn::Join":
          - ""
          -
             - "http://"
             - "Fn::GetAtt":
                  - ElasticLoadBalancer
                  - DNSName
    

    Equivalent JSON

    {
      "URL": {
        "Description": "URL of the website",
        "Value": {
          "Fn::Join": [
            "",
            [
              "http://",
              {
                "Fn::GetAtt": [
                  "ElasticLoadBalancer",
                  "DNSName"
                ]
              }
            ]
          ]
        }
      }
    }
    

提交回复
热议问题