Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table gcp_compute_ha_vpn_gateway Closes #406 #413

Merged
merged 13 commits into from
Dec 2, 2022

Conversation

karanpopat
Copy link
Contributor

Integration test logs

Logs
Outputs:

project_id = "parker-aaa"
resource_aka = "gcp://compute.googleapis.com/projects/parker-aaa/regions/us-east1/vpnGateways/turbottest92884"
resource_name = "turbottest92884"
self_link = "https://www.googleapis.com/compute/v1/projects/parker-aaa/regions/us-east1/vpnGateways/turbottest92884"

Running SQL query: test-get-query.sql
[
  {
    "description": "Test VPN Gateway to validate integration test.",
    "kind": "compute#vpnGateway",
    "location": "us-east1",
    "name": "turbottest92884",
    "self_link": "https://www.googleapis.com/compute/v1/projects/parker-aaa/regions/us-east1/vpnGateways/turbottest92884"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "description": "Test VPN Gateway to validate integration test.",
    "kind": "compute#vpnGateway",
    "location": "us-east1",
    "name": "turbottest92884",
    "self_link": "https://www.googleapis.com/compute/v1/projects/parker-aaa/regions/us-east1/vpnGateways/turbottest92884"
  }
]
✔ PASSED

Running SQL query: test-not-found-query.sql
null
✔ PASSED

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "gcp://compute.googleapis.com/projects/parker-aaa/regions/us-east1/vpnGateways/turbottest92884"
    ],
    "title": "turbottest92884"
  }
]
✔ PASSED

POSTTEST: tests/gcp_compute_ha_vpn_gateway

TEARDOWN: tests/gcp_compute_ha_vpn_gateway

SUMMARY:

1/1 passed.

Example query results

Results
> select
  name,
  id,
  description,
  location,
  self_link,
  kind
from
  gcp_compute_ha_vpn_gateway;
+-------+---------------------+-------------+-------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+
| name  | id                  | description | location                | self_link                                                                                                   | kind               |
+-------+---------------------+-------------+-------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+
| test1 | 6193525178265654635 |             | northamerica-northeast1 | https://www.googleapis.com/compute/v1/projects/parker-aaa/regions/northamerica-northeast1/vpnGateways/test1 | compute#vpnGateway |
+-------+---------------------+-------------+-------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+
> 
> select
  name as vpn_gateway_name,
  i ->> 'id' as vpn_interface_id,
  i ->> 'ipAddress' as vpn_interface_ip_address
from
  gcp_compute_ha_vpn_gateway g,
  jsonb_array_elements(vpn_interfaces) i;
+------------------+------------------+--------------------------+
| vpn_gateway_name | vpn_interface_id | vpn_interface_ip_address |
+------------------+------------------+--------------------------+
| test1            | <null>           | 34.124.13.35             |
| test1            | 1                | 34.104.77.210            |
+------------------+------------------+--------------------------+

@karanpopat karanpopat self-assigned this Nov 17, 2022
@karanpopat karanpopat linked an issue Nov 17, 2022 that may be closed by this pull request
gcp/plugin.go Outdated Show resolved Hide resolved
Copy link
Contributor

@misraved misraved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make changes wherever applicable 👍. Thanks!!

project := projectId.(string)

var vpnGateway compute.VpnGateway
name := d.KeyColumnQuals["name"].GetStringValue()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an empty check for it.

karanpopat and others added 5 commits December 2, 2022 14:01
Co-authored-by: ParthaI <47887552+ParthaI@users.noreply.github.com>
Co-authored-by: ParthaI <47887552+ParthaI@users.noreply.github.com>
Copy link
Contributor

@ParthaI ParthaI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@misraved misraved merged commit 46ab3dd into main Dec 2, 2022
@misraved misraved deleted the 406-add-table-gcp_compute_vpn_gateway branch December 2, 2022 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add table gcp_compute_ha_vpn_gateway
3 participants