terraform-plan-parser icon indicating copy to clipboard operation
terraform-plan-parser copied to clipboard

Parsing map and array attributes

Open gordonbondon opened this issue 7 years ago • 0 comments

Parse complex attributes as maps and arrays instead of separate attribute per item.

Given resource:

resource "null_resource" "cluster" {
  triggers {
    cluster_instance_ids = "id"
  }

Current output:

 "changedAttributes": {
        "id": {
          "new": {
            "type": "computed"
          }
        },
        "triggers.%": {
          "new": {
            "type": "string",
            "value": "1"
          }
        },
        "triggers.cluster_instance_ids": {
          "new": {
            "type": "string",
            "value": "id"
          }
        }
      }

Expected output:

"changedAttributes": {
        "id": {
          "new": {
            "type": "computed"
          }
        },
        "triggers": {
          "new": {
            "type": "map",
            "value": {
                "cluster_instance_ids": "id",
            }
          }
        }
      }

gordonbondon avatar May 20 '18 21:05 gordonbondon