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 kms key table. Closes #124 #215

Merged
merged 12 commits into from
May 27, 2021
Merged

Add kms key table. Closes #124 #215

merged 12 commits into from
May 27, 2021

Conversation

bigdatasourav
Copy link
Contributor

Integration test logs

Logs
SETUP: tests/gcp_kms_key []

PRETEST: tests/gcp_kms_key

TEST: tests/gcp_kms_key
Running terraform
google_kms_key_ring.named_test_resource: Creating...
google_kms_key_ring.named_test_resource: Creation complete after 4s [id=projects/pikachu-aaa/locations/global/keyRings/turbottest28373]
google_kms_crypto_key.named_test_resource: Creating...
google_kms_crypto_key.named_test_resource: Creation complete after 3s [id=projects/pikachu-aaa/locations/global/keyRings/turbottest28373/cryptoKeys/turbottest28373]

Warning: Deprecated 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


Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Outputs:

resource_aka = "gcp://cloudkms.googleapis.com/projects/pikachu-aaa/locations/global/keyRings/turbottest28373/cryptoKeys/turbottest28373"
resource_name = "turbottest28373"

Running SQL query: test-get-query.sql
[
  {
    "name": "turbottest28373",
    "rotation_period": "100000s"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "name": "turbottest28373",
    "rotation_period": "100000s"
  }
]
✔ PASSED

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

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "gcp://cloudkms.googleapis.com/projects/pikachu-aaa/locations/global/keyRings/turbottest28373/cryptoKeys/turbottest28373"
    ],
    "title": "turbottest28373"
  }
]
✔ PASSED

POSTTEST: tests/gcp_kms_key

TEARDOWN: tests/gcp_kms_key

SUMMARY:

1/1 passed.

Example query results

Results
> select
  name,
  create_time,
  rotation_period
from
  gcp_kms_key;
+-------------------------+---------------------+-----------------+
| name                    | create_time         | rotation_period |
+-------------------------+---------------------+-----------------+
| turbottest33297         | 2021-03-22 09:36:09 |                 |
| test-key1               | 2021-02-05 10:35:32 |                 |
| test-key1               | 2021-02-05 10:33:08 | 7776000s        |
| turbottest2652          | 2021-01-22 09:00:59 |                 |
| turbottest29055         | 2021-05-25 11:13:03 |                 |
| turbottest19399         | 2021-05-25 11:06:03 |                 |
| turbottest25145         | 2021-05-25 11:37:28 |                 |
| test1                   | 2020-08-27 14:30:08 | 7776000s        |
| turbottest81132         | 2021-05-25 11:46:38 |                 |
| turbottest28373         | 2021-05-25 11:53:57 |                 |
| turbottest15188         | 2021-03-22 09:17:26 | 100000s         |
| turbottest56581         | 2021-03-22 07:47:15 | 100000s         |
| test-dataset-encryption | 2021-05-07 06:58:18 | 7776000s        |
| multiregion-dataset-key | 2021-05-07 07:01:20 |                 |
+-------------------------+---------------------+-----------------+
> select
  name,
  create_time,
  rotation_period
from
  gcp_kms_key
where
  create_time <= (current_date - interval '30' day)
order by
  create_time;
+-----------------+---------------------+-----------------+
| name            | create_time         | rotation_period |
+-----------------+---------------------+-----------------+
| test1           | 2020-08-27 14:30:08 | 7776000s        |
| turbottest2652  | 2021-01-22 09:00:59 |                 |
| test-key1       | 2021-02-05 10:33:08 | 7776000s        |
| test-key1       | 2021-02-05 10:35:32 |                 |
| turbottest56581 | 2021-03-22 07:47:15 | 100000s         |
| turbottest15188 | 2021-03-22 09:17:26 | 100000s         |
| turbottest33297 | 2021-03-22 09:36:09 |                 |
+-----------------+---------------------+-----------------+
> select
  name,
  create_time,
  rotation_period
from
  gcp_kms_key
where
  rotation_period = '100000s'
+-----------------+---------------------+-----------------+
| name            | create_time         | rotation_period |
+-----------------+---------------------+-----------------+
| turbottest56581 | 2021-03-22 07:47:15 | 100000s         |
| turbottest15188 | 2021-03-22 09:17:26 | 100000s         |
+-----------------+---------------------+-----------------+

LalitTurbot and others added 2 commits May 25, 2021 16:09
@bigdatasourav bigdatasourav self-assigned this May 25, 2021
@bigdatasourav bigdatasourav linked an issue May 25, 2021 that may be closed by this pull request
@bigdatasourav bigdatasourav requested review from Subhajit97 and removed request for LalitLab May 25, 2021 11:59
Copy link
Contributor

@Subhajit97 Subhajit97 left a comment

Choose a reason for hiding this comment

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

@bigdatasourav Please see comments, thanks!

Copy link
Contributor

@Subhajit97 Subhajit97 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@rajlearner17 rajlearner17 left a comment

Choose a reason for hiding this comment

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

LGTM

@Subhajit97 Subhajit97 requested a review from cbruno10 May 27, 2021 12:00
@cbruno10 cbruno10 merged commit 1376ed0 into main May 27, 2021
@cbruno10 cbruno10 deleted the gcp_kms_key branch May 27, 2021 16:17
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 kms key table
4 participants