turbot / steampipe-plugin-terraform

Use SQL to instantly query resources, data sources and more from Terraform code. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/terraform
Apache License 2.0
28 stars 3 forks source link

Fixed table terraform_resource column arguments not showing field named type Closes #98 #99

Closed ParthaI closed 5 months ago

ParthaI commented 6 months ago

Integration test logs

Logs ``` N/A ```

Example query results

Results ``` > select name, type, jsonb_pretty(arguments) as arguments from terraform_resource +-----------------------------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | name | type | arguments | +-----------------------------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | aws_iam_regional_access_analyzer_source | turbot_policy_setting | { | | | | "note": "AWS CIS v3.0.0 - Controls: 1.20", | | | | "type": "tmod:@turbot/aws#/policy/types/regionStackSource", | | | | "value": "resource \"aws_accessanalyzer_analyzer\" \"cis_access_analyzer\" {\n analyzer_name = \"access_analyzer\"\n type = \"ACCOUNT\"\n}\n", | | | | "resource": "${turbot_smart_folder.aws_cis_v300_s1_iam.id}" | | | | } | +-----------------------------------------+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ ```
karanpopat commented 6 months ago

Thanks for the fix @ParthaI Looks good

> select name,jsonb_pretty(arguments),type as arguments from terraform_resource where name = 'aws_iam_regional_access_analyzer_source'
+-----------------------------------------+--------------------------------------------------------------------------------------------------------->
| name                                    | jsonb_pretty                                                                                            >
+-----------------------------------------+--------------------------------------------------------------------------------------------------------->
| aws_iam_regional_access_analyzer_source | {                                                                                                       >
|                                         |     "note": "AWS CIS v3.0.0 - Controls: 1.20",                                                          >
|                                         |     "type": "tmod:@turbot/aws#/policy/types/regionStackSource",                                         >
|                                         |     "value": "resource \"aws_accessanalyzer_analyzer\" \"cis_access_analyzer\" {\n  analyzer_name = \"ac>
|                                         |     "resource": "${turbot_smart_folder.aws_cis_v300_s1_iam.id}"                                         >
|                                         | }                                                                                                       >
+-----------------------------------------+--------------------------------------------------------------------------------------------------------->