turbot / steampipe-plugin-gcp

Use SQL to instantly query GCP resources across regions, projects and organizations. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/gcp
Apache License 2.0
39 stars 24 forks source link

Add table `gcp_tag_binding`. Closes #540 #560

Closed Priyanka-Chatterjee-2000 closed 3 months ago

Priyanka-Chatterjee-2000 commented 3 months ago

Integration test logs

Logs ``` TEST: tests/gcp_tag_binding Running terraform Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + create Terraform will perform the following actions: # google_tags_tag_binding.binding will be created + resource "google_tags_tag_binding" "binding" { + id = (known after apply) + name = (known after apply) + parent = "//cloudresourcemanager.googleapis.com/projects/1111111111111" + tag_value = (known after apply) } # google_tags_tag_key.key will be created + resource "google_tags_tag_key" "key" { + create_time = (known after apply) + description = "Tag Key for env resources." + id = (known after apply) + name = (known after apply) + namespaced_name = (known after apply) + parent = "projects/1111111111111" + short_name = "env" + update_time = (known after apply) } # google_tags_tag_value.value will be created + resource "google_tags_tag_value" "value" { + create_time = (known after apply) + description = "Tag Value for dev resources." + id = (known after apply) + name = (known after apply) + namespaced_name = (known after apply) + parent = (known after apply) + short_name = "dev" + update_time = (known after apply) } Plan: 3 to add, 0 to change, 0 to destroy. Changes to Outputs: + name = (known after apply) + parent = "//cloudresourcemanager.googleapis.com/projects/1111111111111" + tag_value = (known after apply) google_tags_tag_key.key: Creating... google_tags_tag_key.key: Creation complete after 4s [id=tagKeys/2222222222222] google_tags_tag_value.value: Creating... google_tags_tag_value.value: Creation complete after 4s [id=tagValues/2222222222222] google_tags_tag_binding.binding: Creating... google_tags_tag_binding.binding: Creation complete after 3s [id=tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F1111111111111/tagValues/2222222222222] Apply complete! Resources: 3 added, 0 changed, 0 destroyed. Outputs: name = "tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F1111111111111/tagValues/2222222222222" parent = "//cloudresourcemanager.googleapis.com/projects/1111111111111" tag_value = "tagValues/2222222222222" Running SQL query: test-list-query.sql [ { "name": "tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F1111111111111tagValues/2222222222222", "parent": "//cloudresourcemanager.googleapis.com/projects/1111111111111", "tag_value": "tagValues/2222222222222", "title": "tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F1111111111111/tagValues/2222222222222" } ] ✔ PASSED Running SQL query: test-notfound-query.sql [] ✔ PASSED Running SQL query: test-turbot-query.sql [ { "name": "tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F1111111111111/tagValues/2222222222222", "title": "tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F1111111111111/tagValues/2222222222222" } ] ✔ PASSED POSTTEST: tests/gcp_tag_binding TEARDOWN: tests/gcp_tag_binding SUMMARY: 1/1 passed. ```

Example query results

Results ``` select * from gcp_tag_binding where parent='//cloudresourcemanager.googleapis.com/projects/555555555555' +-----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+---------------------------+----------------------------------------------------------------------> | name | parent | tag_value | title > +-----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+---------------------------+----------------------------------------------------------------------> | tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F555555555555/tagValues/281481607494532 | //cloudresourcemanager.googleapis.com/projects/555555555555 | tagValues/281481607494532 | tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F97> +-----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+---------------------------+----------------------------------------------------------------------> ```