About terraform json flag

I am trying to save the execution process and result of terraform binary in RDB with json flag.

This is an example showing the execution process among sub resources when creating an ec2 instance of the aws provider.

{
    "@level":"info",
    "@message":"module.aws-network-configs.aws_internet_gateway.test-gateway: Refreshing state... [id=igw-069696c3af5418a56]",
    "@module":"terraform.ui",
    "@timestamp":"2022-08-01T15:28:15.274581+09:00",
    "hook":{
      "resource":{
        "addr":"module.aws-network-configs.aws_internet_gateway.test-gateway",
        "module":"module.aws-network-configs",
        "resource":"aws_internet_gateway.test-gateway",
        "implied_provider":"aws",
        "resource_type":"aws_internet_gateway",
        "resource_name":"test-gateway","resource_key":null
    },
      "id_key":"id",
      "id_value":"igw-069696c3af5418a56"
    },
    "type":"refresh_start"
  }{
    "@level":"info",
    "@message":"module.aws-network-configs.aws_security_group.test-sg: Refreshing state... [id=sg-0429f9c5c8bd2768a]",
    "@module":"terraform.ui",
    "@timestamp":"2022-08-01T15:28:15.275096+09:00",
    "hook":{
      "resource":{
        "addr":"module.aws-network-configs.aws_security_group.test-sg",
        "module":"module.aws-network-configs",
        "resource":"aws_security_group.test-sg",
        "implied_provider":"aws",
        "resource_type":"aws_security_group",
        "resource_name":"test-sg","resource_key":null
      },
      "id_key":"id",
      "id_value":"sg-0429f9c5c8bd2768a"
    },
    "type":"refresh_start"
  }{
    "@level":"info",
    "@message":"module.aws-network-configs.aws_security_group.test-sg: Refresh complete [id=sg-0429f9c5c8bd2768a]",
    "@module":"terraform.ui",
    "@timestamp":"2022-08-01T15:28:15.492079+09:00",
    "hook":{
      "resource":{
        "addr":"module.aws-network-configs.aws_security_group.test-sg",
        "module":"module.aws-network-configs",
        "resource":"aws_security_group.test-sg",
        "implied_provider":"aws",
        "resource_type":"aws_security_group",
        "resource_name":"test-sg",
        "resource_key":null
      },
      "id_key":"id",
      "id_value":"sg-0429f9c5c8bd2768a"
    },
    "type":"refresh_complete"
  },

  1. You can see that only the value changes and the key in the following form is repeated. Is it fixed as @level, @message, @module, @timestamp, hook, and type for all resources?

  2. Also I’m curious what the maximum depth of json is.

And this is an example when the tfstate file created after creating an ec2 instance is received as a json flag.

{
  "version": 4,
  "terraform_version": "1.2.2",
  "serial": 849,
  "lineage": "8571411a-235d-fd65-0e89-0a3d201fd03c",
  "outputs": {},
  "resources": [
    {
      "mode": "managed",
      "type": "aws_instance",
      "name": "ubuntu-ssh-server",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "index_key": 0,
          "schema_version": 1,
          "attributes": {
            "ami": "ami-0b9064170e32bde34",
            "arn": "arn:aws:ec2:us-east-2:006837851637:instance/i-04de86ff6e9956c14",
            "associate_public_ip_address": true,
            "availability_zone": "us-east-2a",
            "capacity_reservation_specification": [
              {
                "capacity_reservation_preference": "open",
                "capacity_reservation_target": []
              }
            ],
            "cpu_core_count": 1,
            "cpu_threads_per_core": 1,
            "credit_specification": [
              {
                "cpu_credits": "standard"
              }
            ],
            "disable_api_termination": false,
            "ebs_block_device": [],
            "ebs_optimized": false,
            "enclave_options": [
              {
                "enabled": false
              }
            ],
            "ephemeral_block_device": [],
            "get_password_data": false,
            "hibernation": false,
            "host_id": null,
            "iam_instance_profile": "",
            "id": "i-04de86ff6e9956c14",
            "instance_initiated_shutdown_behavior": "stop",
            "instance_state": "running",
            "instance_type": "t2.micro",
            "ipv6_address_count": 0,
            "ipv6_addresses": [],
            "key_name": "aws-key",
            "launch_template": [],
            "metadata_options": [
              {
                "http_endpoint": "enabled",
                "http_put_response_hop_limit": 1,
                "http_tokens": "optional",
                "instance_metadata_tags": "disabled"
              }
            ],
            "monitoring": false,
            "network_interface": [],
            "outpost_arn": "",
            "password_data": "",
            "placement_group": "",
            "placement_partition_number": null,
            "primary_network_interface_id": "eni-09bd44ce34d5e13b9",
            "private_dns": "ip-10-0-1-11.us-east-2.compute.internal",
            "private_ip": "10.0.1.11",
            "public_dns": "",
            "public_ip": "3.145.82.157",
            "root_block_device": [
              {
                "delete_on_termination": true,
                "device_name": "/dev/sda1",
                "encrypted": false,
                "iops": 100,
                "kms_key_id": "",
                "tags": {},
                "throughput": 0,
                "volume_id": "vol-0d44e9dcb7843c38b",
                "volume_size": 8,
                "volume_type": "gp2"
              }
            ],
            "secondary_private_ips": [],
            "security_groups": [],
            "source_dest_check": true,
            "subnet_id": "subnet-073318457c64c606c",
            "tags": {
              "Name": "test-instance"
            },
            "tags_all": {
              "Name": "test-instance"
            },
            "tenancy": "default",
            "timeouts": null,
            "user_data": null,
            "user_data_base64": null,
            "user_data_replace_on_change": false,
            "volume_tags": null,
            "vpc_security_group_ids": [
              "sg-08b45cf8158ddadd7"
            ]
          },
          "sensitive_attributes": [],
          "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwidXBkYXRlIjo2MDAwMDAwMDAwMDB9LCJzY2hlbWFfdmVyc2lvbiI6IjEifQ==",
          "dependencies": [
            "module.aws-network-configs.aws_security_group.test-sg",
            "module.aws-network-configs.aws_subnet.test-subnet-a",
            "module.aws-network-configs.aws_vpc.test-vpc"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "aws_key_pair",
      "name": "terraform-key",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 1,
          "attributes": {
            "arn": "arn:aws:ec2:us-east-2:006837851637:key-pair/aws-key",
            "fingerprint": "d1:a6:d8:8d:85:45:db:b4:b4:ab:3b:db:cc:98:86:d7",
            "id": "aws-key",
            "key_name": "aws-key",
            "key_name_prefix": "",
            "key_pair_id": "key-05e650292c0dc43a2",
            "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCVIH8v7zO4mJypNkkizP3kfnDSQ7IdwYgOvfC338eoA0+peY9qnOPGF8bqY56yrYBeTdYyJUl60abhQguqmgUQ1fGsTm6IFXa1ZFFINVUfg+GoTsKTU1X8J6m+bNOPlk9tXQ2mS7fzz26ShgWm62Sz72KJ56+MCdcITW0ShmEUs2nl6CSxSyK1Adfw39bZ3t7j5MDZDfjfHLWrmn8euxHN6Gm84qCuS3xFo8H2bgjsPxpt3JDqjJrkxkMggeOdORelNNF8fzaqmdMIQbm642U3REr9oGXtsKe7kYlcwENH0Tq3SYteKOdFl9Xc7npjyLhRX3BqyHXlZPL3Unt7bSYQg4SYRF5xbVMlG1HAPLVkTJkS2a5W0WajL/Vs048c03ck11fAYIacKqnQvZsTurxfDpa60vTy3URFfMf9rdHshxGS/tmL0rd6TilsqhYRXivZFat23CDkiElSV8KoOpMLaEYd3IuMBlKfkeY5ltiDVl7c0lelrGaIdZ2iRh+kCFLZPMbOK8cagj0xSaU6XwqlNQAwYXlpu6Z9Li+F1FYyMzDEJZyqL51/9jBc/UwUkACTxhHEnljPCZA9YH9xmV3U8p84EW78ejFKBZ1+aTYYdCLl3IC0Nl22iKxVrGd63iA58BTJJqwgLifdanMKpfKgw9M5bM07qFlarraDI8STLw==",
            "tags": null,
            "tags_all": {}
          },
          "sensitive_attributes": [],
          "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ==",
          "dependencies": [
            "tls_private_key.example"
          ]
        }
      ]
    },
    {
      "mode": "managed",
      "type": "tls_private_key",
      "name": "example",
      "provider": "provider[\"registry.terraform.io/hashicorp/tls\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "algorithm": "RSA",
            "ecdsa_curve": "P224",
            "id": "800aa08adc14d83fc5777b6d9a9ca96c5ebd00c3",
            "private_key_openssh": "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdz\nc2gtcnNhAAAAAwEAAQAAAgEAlSB/L+8zuJicqTZJIsz95H5w0kOyHcGIDr3wt9/H\nqANPqXmPapzjxhfG6mOesq2AXk3WMiVJetGm4UILqpoFENXxrE5uiBV2tWRRSDVV\nH4PhqE7Ck1N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a3:45:78:a3:10:81:74:54:41:8d:1e:93",
            "public_key_fingerprint_sha256": "SHA256:8gl9zH3+9Qm17pJVL5fpXyaaBjs9O3VC7g5SMYv5xDw",
            "public_key_openssh": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCVIH8v7zO4mJypNkkizP3kfnDSQ7IdwYgOvfC338eoA0+peY9qnOPGF8bqY56yrYBeTdYyJUl60abhQguqmgUQ1fGsTm6IFXa1ZFFINVUfg+GoTsKTU1X8J6m+bNOPlk9tXQ2mS7fzz26ShgWm62Sz72KJ56+MCdcITW0ShmEUs2nl6CSxSyK1Adfw39bZ3t7j5MDZDfjfHLWrmn8euxHN6Gm84qCuS3xFo8H2bgjsPxpt3JDqjJrkxkMggeOdORelNNF8fzaqmdMIQbm642U3REr9oGXtsKe7kYlcwENH0Tq3SYteKOdFl9Xc7npjyLhRX3BqyHXlZPL3Unt7bSYQg4SYRF5xbVMlG1HAPLVkTJkS2a5W0WajL/Vs048c03ck11fAYIacKqnQvZsTurxfDpa60vTy3URFfMf9rdHshxGS/tmL0rd6TilsqhYRXivZFat23CDkiElSV8KoOpMLaEYd3IuMBlKfkeY5ltiDVl7c0lelrGaIdZ2iRh+kCFLZPMbOK8cagj0xSaU6XwqlNQAwYXlpu6Z9Li+F1FYyMzDEJZyqL51/9jBc/UwUkACTxhHEnljPCZA9YH9xmV3U8p84EW78ejFKBZ1+aTYYdCLl3IC0Nl22iKxVrGd63iA58BTJJqwgLifdanMKpfKgw9M5bM07qFlarraDI8STLw==\n",
            "public_key_pem": "-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlSB/L+8zuJicqTZJIsz9\n5H5w0kOyHcGIDr3wt9/HqANPqXmPapzjxhfG6mOesq2AXk3WMiVJetGm4UILqpoF\nENXxrE5uiBV2tWRRSDVVH4PhqE7Ck1NV/CepvmzTj5ZPbV0Npku3889ukoYFputk\ns+9iieevjAnXCE1tEoZhFLNp5egksUsitQHX8N/W2d7e4+TA2Q343xy1q5p/HrsR\nzehpvOKgrkt8RaPB9m4I7D8abdyQ6oya5MZDIIHjnTkXpTTRfH82qpnTCEG5uuNl\nN0RK/aBl7bCnu5GJXMBDR9E6t0mLXijnRZfV3O56Y8i4UV9wash15WTy91J7e20m\nEIOEmERecW1TJRtRwDy1ZEyZEtmuVtFmoy/1bNOPHNN3JNdXwGCGnCqp0L2bE7q8\nXw6WutL08t1ERXzH/a3R7IcRkv7Zi9K3ek4pbKoWEV4r2RWrdtwg5IhJUlfCqDqT\nC2hGHdyLjAZSn5HmOZbYg1Ze3NJXpaxmiHWdokYfpAhS2TzGzivHGoI9MUmlOl8K\npTUAMGF5abumfS4vhdRWMjMwxCWcqi+df/YwXP1MFJAAk8YRxJ5YzwmQPWB/cZld\n1PKfOBFu/HoxSgWdfmk2GHQi5dyAtDZdtoisVaxnet4gOfAUySasIC4n3WpzCqXy\noMPTOWzNO6hZWq62gyPEky8CAwEAAQ==\n-----END PUBLIC KEY-----\n",
            "rsa_bits": 4096
          },
          "sensitive_attributes": [],
          "private": "bnVsbA=="
        }
      ]
    },
    {
      "module": "module.aws-network-configs",
      "mode": "managed",
      "type": "aws_internet_gateway",
      "name": "test-gateway",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "arn": "arn:aws:ec2:us-east-2:006837851637:internet-gateway/igw-0b8fb1b6dc65a6e3d",
            "id": "igw-0b8fb1b6dc65a6e3d",
            "owner_id": "006837851637",
            "tags": {
              "Name": "test-gateway"
            },
            "tags_all": {
              "Name": "test-gateway"
            },
            "vpc_id": "vpc-041d8418382be5673"
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "module.aws-network-configs.aws_vpc.test-vpc"
          ]
        }
      ]
    },
    {
      "module": "module.aws-network-configs",
      "mode": "managed",
      "type": "aws_route_table",
      "name": "test-route-table",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "arn": "arn:aws:ec2:us-east-2:006837851637:route-table/rtb-0e66c82f8fbffe07c",
            "id": "rtb-0e66c82f8fbffe07c",
            "owner_id": "006837851637",
            "propagating_vgws": [],
            "route": [
              {
                "carrier_gateway_id": "",
                "cidr_block": "0.0.0.0/0",
                "core_network_arn": "",
                "destination_prefix_list_id": "",
                "egress_only_gateway_id": "",
                "gateway_id": "igw-0b8fb1b6dc65a6e3d",
                "instance_id": "",
                "ipv6_cidr_block": "",
                "local_gateway_id": "",
                "nat_gateway_id": "",
                "network_interface_id": "",
                "transit_gateway_id": "",
                "vpc_endpoint_id": "",
                "vpc_peering_connection_id": ""
              }
            ],
            "tags": {
              "Name": "test-route-table"
            },
            "tags_all": {
              "Name": "test-route-table"
            },
            "timeouts": null,
            "vpc_id": "vpc-041d8418382be5673"
          },
          "sensitive_attributes": [],
          "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJ1cGRhdGUiOjEyMDAwMDAwMDAwMH19",
          "dependencies": [
            "module.aws-network-configs.aws_internet_gateway.test-gateway",
            "module.aws-network-configs.aws_vpc.test-vpc"
          ]
        }
      ]
    },
    {
      "module": "module.aws-network-configs",
      "mode": "managed",
      "type": "aws_route_table_association",
      "name": "my-subnet-association",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "gateway_id": "",
            "id": "rtbassoc-03f7b2b3ca784438e",
            "route_table_id": "rtb-0e66c82f8fbffe07c",
            "subnet_id": "subnet-073318457c64c606c"
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "module.aws-network-configs.aws_internet_gateway.test-gateway",
            "module.aws-network-configs.aws_route_table.test-route-table",
            "module.aws-network-configs.aws_subnet.test-subnet-a",
            "module.aws-network-configs.aws_vpc.test-vpc"
          ]
        }
      ]
    },
    {
      "module": "module.aws-network-configs",
      "mode": "managed",
      "type": "aws_security_group",
      "name": "test-sg",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 1,
          "attributes": {
            "arn": "arn:aws:ec2:us-east-2:006837851637:security-group/sg-08b45cf8158ddadd7",
            "description": "This security group is for Terraform Test",
            "egress": [],
            "id": "sg-08b45cf8158ddadd7",
            "ingress": [],
            "name": "test-sg",
            "name_prefix": "",
            "owner_id": "006837851637",
            "revoke_rules_on_delete": false,
            "tags": {
              "Name": "test-sg"
            },
            "tags_all": {
              "Name": "test-sg"
            },
            "timeouts": null,
            "vpc_id": "vpc-041d8418382be5673"
          },
          "sensitive_attributes": [],
          "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6OTAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIxIn0=",
          "dependencies": [
            "module.aws-network-configs.aws_vpc.test-vpc"
          ]
        }
      ]
    },
    {
      "module": "module.aws-network-configs",
      "mode": "managed",
      "type": "aws_security_group_rule",
      "name": "instance-ssh",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 2,
          "attributes": {
            "cidr_blocks": [
              "0.0.0.0/0"
            ],
            "description": null,
            "from_port": 22,
            "id": "sgrule-3294667080",
            "ipv6_cidr_blocks": null,
            "prefix_list_ids": null,
            "protocol": "tcp",
            "security_group_id": "sg-08b45cf8158ddadd7",
            "self": false,
            "source_security_group_id": null,
            "to_port": 22,
            "type": "ingress"
          },
          "sensitive_attributes": [],
          "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==",
          "dependencies": [
            "module.aws-network-configs.aws_security_group.test-sg",
            "module.aws-network-configs.aws_vpc.test-vpc"
          ]
        }
      ]
    },
    {
      "module": "module.aws-network-configs",
      "mode": "managed",
      "type": "aws_security_group_rule",
      "name": "outbound-traffic",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 2,
          "attributes": {
            "cidr_blocks": [
              "0.0.0.0/0"
            ],
            "description": null,
            "from_port": 0,
            "id": "sgrule-1668892050",
            "ipv6_cidr_blocks": null,
            "prefix_list_ids": null,
            "protocol": "-1",
            "security_group_id": "sg-08b45cf8158ddadd7",
            "self": false,
            "source_security_group_id": null,
            "to_port": 0,
            "type": "egress"
          },
          "sensitive_attributes": [],
          "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==",
          "dependencies": [
            "module.aws-network-configs.aws_security_group.test-sg",
            "module.aws-network-configs.aws_vpc.test-vpc"
          ]
        }
      ]
    },
    {
      "module": "module.aws-network-configs",
      "mode": "managed",
      "type": "aws_security_group_rule",
      "name": "test-cluster-traffic",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 2,
          "attributes": {
            "cidr_blocks": [
              "10.0.0.0/16"
            ],
            "description": null,
            "from_port": 0,
            "id": "sgrule-156277519",
            "ipv6_cidr_blocks": null,
            "prefix_list_ids": null,
            "protocol": "-1",
            "security_group_id": "sg-08b45cf8158ddadd7",
            "self": false,
            "source_security_group_id": null,
            "to_port": 0,
            "type": "ingress"
          },
          "sensitive_attributes": [],
          "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjIifQ==",
          "dependencies": [
            "module.aws-network-configs.aws_security_group.test-sg",
            "module.aws-network-configs.aws_vpc.test-vpc"
          ]
        }
      ]
    },
    {
      "module": "module.aws-network-configs",
      "mode": "managed",
      "type": "aws_subnet",
      "name": "test-subnet-a",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 1,
          "attributes": {
            "arn": "arn:aws:ec2:us-east-2:006837851637:subnet/subnet-073318457c64c606c",
            "assign_ipv6_address_on_creation": false,
            "availability_zone": "us-east-2a",
            "availability_zone_id": "use2-az1",
            "cidr_block": "10.0.1.0/24",
            "customer_owned_ipv4_pool": "",
            "enable_dns64": false,
            "enable_resource_name_dns_a_record_on_launch": false,
            "enable_resource_name_dns_aaaa_record_on_launch": false,
            "id": "subnet-073318457c64c606c",
            "ipv6_cidr_block": "",
            "ipv6_cidr_block_association_id": "",
            "ipv6_native": false,
            "map_customer_owned_ip_on_launch": false,
            "map_public_ip_on_launch": false,
            "outpost_arn": "",
            "owner_id": "006837851637",
            "private_dns_hostname_type_on_launch": "ip-name",
            "tags": null,
            "tags_all": {},
            "timeouts": null,
            "vpc_id": "vpc-041d8418382be5673"
          },
          "sensitive_attributes": [],
          "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9",
          "dependencies": [
            "module.aws-network-configs.aws_vpc.test-vpc"
          ]
        }
      ]
    },
    {
      "module": "module.aws-network-configs",
      "mode": "managed",
      "type": "aws_vpc",
      "name": "test-vpc",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 1,
          "attributes": {
            "arn": "arn:aws:ec2:us-east-2:006837851637:vpc/vpc-041d8418382be5673",
            "assign_generated_ipv6_cidr_block": false,
            "cidr_block": "10.0.0.0/16",
            "default_network_acl_id": "acl-045a0f351bd4d8af7",
            "default_route_table_id": "rtb-048e82f1417d4d840",
            "default_security_group_id": "sg-0188be1a090ccb23b",
            "dhcp_options_id": "dopt-fa43bf91",
            "enable_classiclink": false,
            "enable_classiclink_dns_support": false,
            "enable_dns_hostnames": false,
            "enable_dns_support": true,
            "id": "vpc-041d8418382be5673",
            "instance_tenancy": "default",
            "ipv4_ipam_pool_id": null,
            "ipv4_netmask_length": null,
            "ipv6_association_id": "",
            "ipv6_cidr_block": "",
            "ipv6_cidr_block_network_border_group": "",
            "ipv6_ipam_pool_id": "",
            "ipv6_netmask_length": 0,
            "main_route_table_id": "rtb-048e82f1417d4d840",
            "owner_id": "006837851637",
            "tags": {
              "Name": "test-vpc"
            },
            "tags_all": {
              "Name": "test-vpc"
            }
          },
          "sensitive_attributes": [],
          "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ=="
        }
      ]
    }
  ]
}

  1. Likewise, I wonder if the key is fixed or what the maximum depth is.

Hi @zmrdltl,

The first output you’ve shown is the json structured run output, used for converting the CLI output to another UI format. It will generally mirror the CLI output in what is shown, and is really only intended for human consumption, not as a complete record of operation.

The data in your second example is unrelated to the -json flag, it is the stored state which is always json data. That is not intended for direct consumption externally, and the format may continue to change slightly between Terraform versions.

The supported interface for terraform output is documented here: Internals: JSON Output Format | Terraform by HashiCorp
The artifact you want to store from a plan, is the plan file itself. The plan file and the final state can both be queried using the terraform show -json command, which will extract the supported information and structure from each.

Thanks! @jbardin

Then…
Wouldn’t it be a good way to store values ​​as a column with a key that is determined in the first result?

What values and key are we referring to here?

If the “first result” you are referring to is the structured run output with the "@level", "@message", etc keys, that is to recreate the human readable CLI output, it is not meant to provide direct correlation to anything else.