minamijoyo / tfschema

A schema inspector for Terraform / OpenTofu providers
MIT License
295 stars 15 forks source link

Support Terraform v0.14 #29

Closed minamijoyo closed 3 years ago

minamijoyo commented 3 years ago

Fixes #28

Terraform v0.14 changed the default location for storing provider's binary to support locking provider dependencies. We should check the new location.

In addition, a hidden selection file was changed to a new lock file format in HCL. We also need to parse it to build search paths.

minamijoyo commented 3 years ago

Looks good.

[v0.14-test@tf-0.14|✚2]$ terraform -v
Terraform v0.14.0
+ provider registry.terraform.io/hashicorp/aws v3.17.0
[v0.14-test@tf-0.14|✚2]$ ../../bin/tfschema resource show aws_security_group
+------------------------+--------------------------------+----------+----------+----------+-----------+
| ATTRIBUTE              | TYPE                           | REQUIRED | OPTIONAL | COMPUTED | SENSITIVE |
+------------------------+--------------------------------+----------+----------+----------+-----------+
| arn                    | string                         | false    | false    | true     | false     |
| description            | string                         | false    | true     | false    | false     |
| egress                 | set(object({                   | false    | true     | true     | false     |
|                        | cidr_blocks=list(string),      |          |          |          |           |
|                        | description=string,            |          |          |          |           |
|                        | from_port=number,              |          |          |          |           |
|                        | ipv6_cidr_blocks=list(string), |          |          |          |           |
|                        | prefix_list_ids=list(string),  |          |          |          |           |
|                        | protocol=string,               |          |          |          |           |
|                        | security_groups=set(string),   |          |          |          |           |
|                        | self=bool, to_port=number }))  |          |          |          |           |
| id                     | string                         | false    | true     | true     | false     |
| ingress                | set(object({                   | false    | true     | true     | false     |
|                        | cidr_blocks=list(string),      |          |          |          |           |
|                        | description=string,            |          |          |          |           |
|                        | from_port=number,              |          |          |          |           |
|                        | ipv6_cidr_blocks=list(string), |          |          |          |           |
|                        | prefix_list_ids=list(string),  |          |          |          |           |
|                        | protocol=string,               |          |          |          |           |
|                        | security_groups=set(string),   |          |          |          |           |
|                        | self=bool, to_port=number }))  |          |          |          |           |
| name                   | string                         | false    | true     | true     | false     |
| name_prefix            | string                         | false    | true     | false    | false     |
| owner_id               | string                         | false    | false    | true     | false     |
| revoke_rules_on_delete | bool                           | false    | true     | false    | false     |
| tags                   | map(string)                    | false    | true     | false    | false     |
| vpc_id                 | string                         | false    | true     | true     | false     |
+------------------------+--------------------------------+----------+----------+----------+-----------+

block_type: timeouts, nesting: NestingSingle, min_items: 0, max_items: 0
+-----------+--------+----------+----------+----------+-----------+
| ATTRIBUTE | TYPE   | REQUIRED | OPTIONAL | COMPUTED | SENSITIVE |
+-----------+--------+----------+----------+----------+-----------+
| create    | string | false    | true     | false    | false     |
| delete    | string | false    | true     | false    | false     |
+-----------+--------+----------+----------+----------+-----------+
minamijoyo commented 3 years ago

Released as v0.6.0 🚀