lifeomic / terraform-plan-parser

Command line utility and JavaScript API for parsing stdout from "terraform plan" and converting it to JSON.
MIT License
149 stars 16 forks source link

terraform-plan-parser is unable to parse terraform plan with terraform version 13.2 #53

Open dhirajn72 opened 3 years ago

dhirajn72 commented 3 years ago

Hi, I'm running plan in terraform 13 and getting this parsing error(pasted below). Unable to manage the infrastructure.

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

module.lcm_compartments.module.data.data.oci_identity_compartments.this[0]: Refreshing state... [id=IdentityCompartmentsDataSource-28140727]
module.lcm_compartments.module.network.data.oci_identity_compartments.this[0]: Refreshing state... [id=IdentityCompartmentsDataSource-28140727]
data.oci_identity_availability_domains.ad: Refreshing state... [id=IdentityAvailabilityDomainsDataSource-28140727]
module.lcm_compartments.module.app.data.oci_identity_compartments.this[0]: Refreshing state... [id=IdentityCompartmentsDataSource-28140727]
data.template_file.ad_names[1]: Refreshing state... [id=6476491de7cba9451d18298f6e456cb256b8ab6e3]
data.template_file.ad_names[0]: Refreshing state... [id=177af0c1059a237e7ba74d52a9079faafbe20b6b90]
data.template_file.ad_names[2]: Refreshing state... [id=3eb62ebb18383be4a479a513a5b3b60b69b50125]
module.lcm_db.oci_database_db_system.db_management: Refreshing state... [id=z4gktg6njqil5zqzamvzpslvq4tihe3a]
module.lcm_db.data.oci_database_db_nodes.db_node_list: Refreshing state... [id=DatabaseDbNodesDataSource-3498512210]
module.lcm_db.data.oci_core_vnic.db_node_vnic: Refreshing state... [id=knmcxt76vrlm2a44egtz7iysjl4rtwarcyzbria]
module.lcm_db.null_resource.iptable-config-exec: Refreshing state... [id=31104546926175]
module.lcm_db.null_resource.remote-exec: Refreshing state... [id=5609264287810]

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.lcm_db.oci_database_db_system.db_management will be updated in-place
  ~ resource "oci_database_db_system" "db_management" {
        availability_domain     = "CxRm:UK-LONDON-1-AD-2"
      ~ compartment_id          = "zf5km3ewmrbupkhqbvszkv4c64mxls3zfe7eezji5a" -> "odpkg6d5h4vofla443tfmqr7udlo4t3zu5kqcbd3fa"
        cpu_core_count          = 4
        data_storage_percentage = 40
        data_storage_size_in_gb = 256
        database_edition        = "ENTERPRISE_EDITION_EXTREME_PERFORMANCE"
        defined_tags            = {}
        disk_redundancy         = "HIGH"
        display_name            = "HAlcm_mgmt"
        fault_domains           = [
            "FAULT-DOMAIN-3",
            "FAULT-DOMAIN-2",
        ]
        freeform_tags           = {}
        hostname                = "halcmmgmt"
        iorm_config_cache       = []
        license_model           = "LICENSE_INCLUDED"
        listener_port           = 1521
        maintenance_window      = []
        node_count              = 2
        reco_storage_size_in_gb = 256
        shape                   = "VM.Standard2.2"
        source                  = "NONE"
        state                   = "AVAILABLE"
        time_created            = "2021-02-17 18:31:03.117 +0000 UTC"
        time_zone               = "UTC"
        version                 = "19.9.0.0.0"

        db_home {
            create_async  = false
            db_version    = "19.9.0.0.0"
            defined_tags  = {}
            display_name  = "dbhome20210217183103"
            freeform_tags = {}
            state         = "AVAILABLE"
            time_created  = "2021-02-17 18:31:03.129 +0000 UTC"

            database {
                admin_password     = (sensitive value)
                character_set      = "AL32UTF8"
                db_name            = "lcmmgmt"
                db_unique_name     = "lcmmgmt_lhr2bq"
                db_workload        = "OLTP"
                defined_tags       = {}
                freeform_tags      = {}
                ncharacter_set     = "AL16UTF16"
                pdb_name           = "pdbName"
                state              = "AVAILABLE"
                time_created       = "2021-02-17 18:31:03.131 +0000 UTC"

                db_backup_config {
                    auto_backup_enabled     = true
                    auto_backup_window      = "SLOT_ONE"
                    recovery_window_in_days = 7
                }
            }
        }

        db_system_options {
            storage_management = "ASM"
        }
    }

Plan: 0 to add, 1 to change, 0 to destroy.

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

Above plan throws below errors, could someone please help on this :

{
  "errors": [
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"  # module.lcm_db.oci_database_db_system.db_management will be updated in-place\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_CHANGE_LINE",
      "message": "Unable to parse \"  ~ resource \"oci_database_db_system\" \"db_management\" {\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        availability_domain     = \"CxRm:UK-LONDON-1-AD-2\"\" (ignoring)"
    },
    {
      "code": "ORPHAN_ATTRIBUTE_LINE",
      "message": "Attribute line \"      ~ compartment_id          = \"zf5km3ewmrbupkhqbvszkv4c64mxls3zfe7eezji5a\" -> \"odpkg6d5h4vofla443tfmqr7udlo4t3zu5kqcbd3fa\"\" is not associated with a data source or resource (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        cpu_core_count          = 4\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        data_storage_percentage = 40\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        data_storage_size_in_gb = 256\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        database_edition        = \"ENTERPRISE_EDITION_EXTREME_PERFORMANCE\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        defined_tags            = {}\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        disk_redundancy         = \"HIGH\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        display_name            = \"HAlcm_mgmt\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        fault_domains           = [\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"            \"FAULT-DOMAIN-3\",\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"            \"FAULT-DOMAIN-2\",\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        ]\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        freeform_tags           = {}\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        hostname                = \"halcmmgmt\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        iorm_config_cache       = []\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        license_model           = \"LICENSE_INCLUDED\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        listener_port           = 1521\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        maintenance_window      = []\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        node_count              = 2\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        reco_storage_size_in_gb = 256\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        shape                   = \"VM.Standard2.2\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        source                  = \"NONE\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        state                   = \"AVAILABLE\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        time_created            = \"2021-02-17 18:31:03.117 +0000 UTC\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        time_zone               = \"UTC\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        version                 = \"19.9.0.0.0\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        db_home {\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"            create_async  = false\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"            db_version    = \"19.9.0.0.0\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"            defined_tags  = {}\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"            display_name  = \"dbhome20210217183103\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"            freeform_tags = {}\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"            state         = \"AVAILABLE\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"            time_created  = \"2021-02-17 18:31:03.129 +0000 UTC\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"            database {\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                admin_password     = (sensitive value)\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                character_set      = \"AL32UTF8\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                db_name            = \"lcmmgmt\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                db_unique_name     = \"lcmmgmt_lhr2bq\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                db_workload        = \"OLTP\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                defined_tags       = {}\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                freeform_tags      = {}\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                ncharacter_set     = \"AL16UTF16\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                pdb_name           = \"pdbName\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                state              = \"AVAILABLE\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                time_created       = \"2021-02-17 18:31:03.131 +0000 UTC\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                db_backup_config {\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                    auto_backup_enabled     = true\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                    auto_backup_window      = \"SLOT_ONE\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                    recovery_window_in_days = 7\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"                }\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"            }\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        }\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        db_system_options {\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"            storage_management = \"ASM\"\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"        }\" (ignoring)"
    },
    {
      "code": "UNABLE_TO_PARSE_LINE",
      "message": "Unable to parse \"    }\" (ignoring)"
    }
  ],
  "changedResources": [],
  "changedDataSources": []
}