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_kms_key_version closes #342 #345

Merged
merged 13 commits into from
Mar 23, 2022
Merged

Add table gcp_kms_key_version closes #342 #345

merged 13 commits into from
Mar 23, 2022

Conversation

karanpopat
Copy link
Contributor

Integration test logs

Logs
Running SQL query: test-get-query.sql
[
  {
    "crypto_key_version": 1,
    "name": "turbottest70248",
    "self_link": "https://cloudkms.googleapis.com/v1/projects/parker-aaa/locations/global/keyRings/turbottest70248/cryptoKeys/turbottest70248/cryptoKeyVersions/1"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "akas": [
      "gcp://cloudkms.googleapis.com/projects/parker-aaa/locations/global/keyRings/turbottest70248/cryptoKeys/turbottest70248/cryptoKeyVersions/1"
    ],
    "crypto_key_version": 1,
    "name": "turbottest70248",
    "self_link": "https://cloudkms.googleapis.com/v1/projects/parker-aaa/locations/global/keyRings/turbottest70248/cryptoKeys/turbottest70248/cryptoKeyVersions/1"
  }
]
✔ PASSED

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

Running SQL query: test-turbot-query.sql
[
  {
    "crypto_key_version": 1,
    "name": "turbottest70248",
    "self_link": "https://cloudkms.googleapis.com/v1/projects/parker-aaa/locations/global/keyRings/turbottest70248/cryptoKeys/turbottest70248/cryptoKeyVersions/1"
  }
]
✔ PASSED

POSTTEST: tests/gcp_kms_key_version

TEARDOWN: tests/gcp_kms_key_version

SUMMARY:

1/1 passed.

Example query results

Results
> select
  name,
  crypto_key_version,
  state
from
  gcp_kms_key_version limit 3;
+----------------+--------------------+-----------+
| name           | crypto_key_version | state     |
+----------------+--------------------+-----------+
| rupkey-test-01 | 10                 | DESTROYED |
| rupkey-test-01 | 3                  | DESTROYED |
| rupkey-test-01 | 12                 | ENABLED   |
+----------------+--------------------+-----------+


> select name, crypto_key_version, self_link from gcp_kms_key_version where name = 'turbottest82190' and location = 'global' and key_ring_name = 'turbottest82190' and crypto_key_version = 1
+-----------------+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| name            | crypto_key_version | self_link                                                                                                                                       |
+-----------------+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
| turbottest82190 | 1                  | https://cloudkms.googleapis.com/v1/projects/parker-aaa/locations/global/keyRings/turbottest82190/cryptoKeys/turbottest82190/cryptoKeyVersions/1 |
+-----------------+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+

@ParthaI ParthaI changed the title Issue 342 Add table gcp_kms_key_version closes #342 Mar 21, 2022
@ParthaI ParthaI linked an issue Mar 21, 2022 that may be closed by this pull request
Copy link
Contributor

@bigdatasourav bigdatasourav left a comment

Choose a reason for hiding this comment

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

LGTM

crypto_key_version,
state
from
gcp_kms_key_version;

Choose a reason for hiding this comment

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

Suggested change
gcp_kms_key_version;
gcp_kms_key_version
where state <> 'DESTROYED'

from
gcp_kms_key_version
where
create_time <= (current_date - interval '30' day)

Choose a reason for hiding this comment

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

Add where state <> 'DESTROYED' , this will filter unwanted results

@misraved misraved merged commit c4b7462 into main Mar 23, 2022
@misraved misraved deleted the issue-342 branch March 23, 2022 09:33
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_kms_key_version
4 participants