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_vpc_access_connector Closes #643 #647

Closed ParthaI closed 2 weeks ago

ParthaI commented 2 weeks ago

Integration test logs

Logs ``` No env file present for the current environment: staging Falling back to .env config No env file present for the current environment: staging customEnv TURBOT_TEST_EXPECTED_TIMEOUT undefined SETUP: tests/gcp_vpc_access_connector [] PRETEST: tests/gcp_vpc_access_connector TEST: tests/gcp_vpc_access_connector Running terraform data.google_client_config.current: Reading... data.google_client_config.current: Read complete after 0s [id=projects/"parker-aaa"/regions/"us-east1"/zones/"us-east1-b"] data.null_data_source.resource: Reading... data.null_data_source.resource: Read complete after 0s [id=static] 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_compute_network.named_test_resource will be created + resource "google_compute_network" "named_test_resource" { + auto_create_subnetworks = false + delete_default_routes_on_create = false + gateway_ipv4 = (known after apply) + id = (known after apply) + internal_ipv6_range = (known after apply) + mtu = (known after apply) + name = "turbottest35624" + network_firewall_policy_enforcement_order = "AFTER_CLASSIC_FIREWALL" + numeric_id = (known after apply) + project = "parker-aaa" + routing_mode = (known after apply) + self_link = (known after apply) } # google_compute_subnetwork.named_test_resource will be created + resource "google_compute_subnetwork" "named_test_resource" { + creation_timestamp = (known after apply) + external_ipv6_prefix = (known after apply) + fingerprint = (known after apply) + gateway_address = (known after apply) + id = (known after apply) + internal_ipv6_prefix = (known after apply) + ip_cidr_range = "10.2.0.0/28" + ipv6_cidr_range = (known after apply) + name = "turbottest35624" + network = (known after apply) + private_ip_google_access = (known after apply) + private_ipv6_google_access = (known after apply) + project = "parker-aaa" + purpose = (known after apply) + region = "us-east1" + self_link = (known after apply) + stack_type = (known after apply) } # google_vpc_access_connector.named_test_resource will be created + resource "google_vpc_access_connector" "named_test_resource" { + connected_projects = (known after apply) + id = (known after apply) + machine_type = "e2-standard-4" + max_instances = 3 + max_throughput = (known after apply) + min_instances = 2 + min_throughput = (known after apply) + name = "turbottest35624" + network = (known after apply) + project = "parker-aaa" + region = (known after apply) + self_link = (known after apply) + state = (known after apply) + subnet { + name = "turbottest35624" + project_id = (known after apply) } } Plan: 3 to add, 0 to change, 0 to destroy. Changes to Outputs: + project_id = "parker-aaa" + region_id = "us-east1" + resource_aka = (known after apply) + resource_id = (known after apply) + resource_name = "turbottest35624" google_compute_network.named_test_resource: Creating... google_compute_network.named_test_resource: Still creating... [10s elapsed] google_compute_network.named_test_resource: Still creating... [20s elapsed] google_compute_network.named_test_resource: Creation complete after 23s [id=projects/parker-aaa/global/networks/turbottest35624] google_compute_subnetwork.named_test_resource: Creating... google_compute_subnetwork.named_test_resource: Still creating... [10s elapsed] google_compute_subnetwork.named_test_resource: Creation complete after 15s [id=projects/parker-aaa/regions/us-east1/subnetworks/turbottest35624] google_vpc_access_connector.named_test_resource: Creating... google_vpc_access_connector.named_test_resource: Still creating... [10s elapsed] google_vpc_access_connector.named_test_resource: Still creating... [20s elapsed] google_vpc_access_connector.named_test_resource: Still creating... [30s elapsed] google_vpc_access_connector.named_test_resource: Still creating... [40s elapsed] google_vpc_access_connector.named_test_resource: Still creating... [50s elapsed] google_vpc_access_connector.named_test_resource: Still creating... [1m0s elapsed] google_vpc_access_connector.named_test_resource: Still creating... [1m10s elapsed] google_vpc_access_connector.named_test_resource: Still creating... [1m20s elapsed] google_vpc_access_connector.named_test_resource: Still creating... [1m30s elapsed] google_vpc_access_connector.named_test_resource: Still creating... [1m40s elapsed] google_vpc_access_connector.named_test_resource: Creation complete after 1m43s [id=projects/parker-aaa/locations/us-east1/connectors/turbottest35624] Warning: Deprecated with data.null_data_source.resource, on variables.tf line 32, in data "null_data_source" "resource": 32: data "null_data_source" "resource" { The null_data_source was historically used to construct intermediate values to re-use elsewhere in configuration, the same can now be achieved using locals or the terraform_data resource type in Terraform 1.4 and later. (and one more similar warning elsewhere) Apply complete! Resources: 3 added, 0 changed, 0 destroyed. Outputs: project_id = "parker-aaa" region_id = "us-east1" resource_aka = "gcp://vpcaccess.googleapis.com/projects/parker-aaa/locations/us-east1/connectors/turbottest35624" resource_id = "projects/parker-aaa/locations/us-east1/connectors/turbottest35624" resource_name = "turbottest35624" Running SQL query: test-get-query.sql Time: 4.9s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 0. Scans: 1) gcp_vpc_access_connector.gcp: Time: 4.6s. Fetched: 1. Hydrates: 0. Quals: name=projects/parker-aaa/locations/us-east1/connectors/turbottest35624. [ { "location": "us-east1", "name": "projects/parker-aaa/locations/us-east1/connectors/turbottest35624", "network": "turbottest35624", "state": "READY" } ] ✔ PASSED Running SQL query: test-hydrate-query.sql Time: 5.6s. Rows returned: 1. Rows fetched: 3. Hydrate calls: 0. Scans: 1) gcp_vpc_access_connector.gcp: Time: 3.5s. Fetched: 3. Hydrates: 0. Quals: self_link=https://vpcaccess.googleapis.com/v1/projects/parker-aaa/locations/us-east1/connectors/turbottest35624. [ { "name": "projects/parker-aaa/locations/us-east1/connectors/turbottest35624", "self_link": "https://vpcaccess.googleapis.com/v1/projects/parker-aaa/locations/us-east1/connectors/turbottest35624" } ] ✔ PASSED Running SQL query: test-list-query.sql Time: 6.2s. Rows returned: 1. Rows fetched: 3. Hydrate calls: 0. Scans: 1) gcp_vpc_access_connector.gcp: Time: 3.6s. Fetched: 3. Hydrates: 0. [ { "name": "projects/parker-aaa/locations/us-east1/connectors/turbottest35624", "title": "turbottest35624" } ] ✔ PASSED Running SQL query: test-not-found-query.sql Time: 3.8s. Rows returned: 0. [] ✔ PASSED Running SQL query: test-turbot-query.sql Time: 3.8s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 0. Scans: 1) gcp_vpc_access_connector.gcp: Time: 3.5s. Fetched: 1. Hydrates: 0. Quals: name=projects/parker-aaa/locations/us-east1/connectors/turbottest35624. [ { "akas": [ "gcp://vpcaccess.googleapis.com/projects/parker-aaa/locations/us-east1/connectors/turbottest35624" ], "title": "turbottest35624" } ] ✔ PASSED POSTTEST: tests/gcp_vpc_access_connector TEARDOWN: tests/gcp_vpc_access_connector SUMMARY: 1/1 passed. ```

Example query results

Results ``` > select * from gcp_vpc_access_connector where name = 'projects/parker-aaa/locations/us-central1/connectors/test53' +-------------------------------------------------------------+-------+---------+---------------+--------------+-------------------------------------------------------------------------------------------------+---------------+----------------+---------------+----------------+--------------------+--------+--------> | name | state | network | ip_cidr_range | machine_type | self_link | max_instances | max_throughput | min_instances | min_throughput | connected_projects | subnet | title > +-------------------------------------------------------------+-------+---------+---------------+--------------+-------------------------------------------------------------------------------------------------+---------------+----------------+---------------+----------------+--------------------+--------+--------> | projects/parker-aaa/locations/us-central1/connectors/test53 | READY | default | 10.0.0.0/28 | e2-micro | https://vpcaccess.googleapis.com/v1/projects/parker-aaa/locations/us-central1/connectors/test53 | 10 | 1000 | 2 | 200 | | | test53 > +-------------------------------------------------------------+-------+---------+---------------+--------------+-------------------------------------------------------------------------------------------------+---------------+----------------+---------------+----------------+--------------------+--------+--------> Time: 1.4s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 0. Scans: 1) gcp_vpc_access_connector.gcp: Time: 1.4s. Fetched: 1. Hydrates: 0. Quals: name=projects/parker-aaa/locations/us-central1/connectors/test53. > select * from gcp_vpc_access_connector +-------------------------------------------------------------+-------+--------------+---------------+--------------+-------------------------------------------------------------------------------------------------+---------------+----------------+---------------+----------------+--------------------+--------+---> | name | state | network | ip_cidr_range | machine_type | self_link | max_instances | max_throughput | min_instances | min_throughput | connected_projects | subnet | ti> +-------------------------------------------------------------+-------+--------------+---------------+--------------+-------------------------------------------------------------------------------------------------+---------------+----------------+---------------+----------------+--------------------+--------+---> | projects/parker-aaa/locations/us-central1/connectors/tsts | READY | testnetwork2 | 10.8.0.0/28 | e2-micro | https://vpcaccess.googleapis.com/v1/projects/parker-aaa/locations/us-central1/connectors/tsts | 10 | 1000 | 2 | 200 | ["parker-aaa"] | | ts> | projects/parker-aaa/locations/us-central1/connectors/test53 | READY | default | 10.0.0.0/28 | e2-micro | https://vpcaccess.googleapis.com/v1/projects/parker-aaa/locations/us-central1/connectors/test53 | 10 | 1000 | 2 | 200 | | | te> +-------------------------------------------------------------+-------+--------------+---------------+--------------+-------------------------------------------------------------------------------------------------+---------------+----------------+---------------+----------------+--------------------+--------+---> Time: 3.7s. Rows returned: 2. Rows fetched: 2. Hydrate calls: 0. Scans: ```