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_ring. Closes #170 #171

Merged
merged 11 commits into from
Apr 22, 2021
Merged

Add table gcp_kms_key_ring. Closes #170 #171

merged 11 commits into from
Apr 22, 2021

Conversation

bigdatasourav
Copy link
Contributor

@bigdatasourav bigdatasourav commented Apr 9, 2021

Integration test logs

Logs

SETUP: tests/gcp_kms_key_ring []

PRETEST: tests/gcp_kms_key_ring

TEST: tests/gcp_kms_key_ring
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/turbottest60698]
google_kms_key_ring_iam_policy.named_test_resource: Creating...
google_kms_key_ring_iam_policy.named_test_resource: Creation complete after 4s [id=projects/pikachu-aaa/locations/global/keyRings/turbottest60698]

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:

etag = "BwXAFK6c1KM="
resource_aka = "gcp://cloudkms.googleapis.com/projects/pikachu-aaa/locations/global/keyRings/turbottest60698"
resource_name = "turbottest60698"

Running SQL query: test-get-query.sql
[
  {
    "name": "turbottest60698"
  }
]
✔ PASSED

Running SQL query: test-hydrate-query.sql
[
  {
    "iam_policy": {
      "bindings": [
        {
          "members": [
            "user:sourav@turbot.com"
          ],
          "role": "roles/editor"
        }
      ],
      "etag": "BwXAFK6c1KM=",
      "version": 1
    },
    "name": "turbottest60698"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "name": "turbottest60698"
  }
]
✔ 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/turbottest60698"
    ],
    "title": "turbottest60698"
  }
]
✔ PASSED

POSTTEST: tests/gcp_kms_key_ring

TEARDOWN: tests/gcp_kms_key_ring

SUMMARY:

1/1 passed.

Example query results

Results
select
  name,
  create_time
from
  gcp_kms_key_ring;
+-----------------+---------------------+
| name            | create_time         |
+-----------------+---------------------+
| test1           | 2020-04-02 09:31:32 |
| turbottest14716 | 2021-03-22 07:17:22 |
| turbottest78560 | 2021-04-16 10:38:03 |
| turbottest9262  | 2021-04-16 10:32:21 |
| turbottest28694 | 2021-03-22 07:23:32 |
| rajesh-test-key | 2021-02-05 10:35:19 |
| turbottest78782 | 2021-04-16 10:42:45 |
| test            | 2020-04-02 08:35:37 |
| turbottest30405 | 2021-03-22 09:37:53 |
| turbottest2652  | 2021-01-22 09:00:56 |
| turbottest31956 | 2021-03-22 07:21:30 |
| turbottest15188 | 2021-03-22 09:17:23 |
| testPolicy      | 2021-04-15 04:00:20 |
| turbottest33297 | 2021-03-22 09:36:07 |
| turbottest23386 | 2021-04-16 10:31:30 |
| turbottest25356 | 2021-04-16 10:35:02 |
| turbottest36375 | 2021-03-22 07:02:56 |
| turbottest90278 | 2021-03-22 07:34:10 |
| turbottest60698 | 2021-04-16 10:45:41 |
| turbottest55622 | 2021-03-22 07:25:02 |
| turbottest7093  | 2021-03-22 07:32:44 |
| turbottest56581 | 2021-03-22 07:47:12 |
| turbottest74754 | 2021-04-16 10:39:42 |
| turbottest77141 | 2021-03-22 07:27:52 |
+-----------------+---------------------+

select
  name,
  create_time
from
  gcp_kms_key_ring
where
  create_time <= (current_date - interval '30' day)
order by
  create_time;
+-----------------+---------------------+
| name            | create_time         |
+-----------------+---------------------+
| test            | 2020-04-02 08:35:37 |
| test1           | 2020-04-02 09:31:32 |
| turbottest2652  | 2021-01-22 09:00:56 |
| rajesh-test-key | 2021-02-05 10:35:19 |
+-----------------+---------------------+

@bigdatasourav bigdatasourav self-assigned this Apr 9, 2021
@bigdatasourav bigdatasourav linked an issue Apr 9, 2021 that may be closed by this pull request
gcp/plugin.go Outdated Show resolved Hide resolved
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 There are some changes required. Please see comments, thanks!

gcp/service.go Outdated Show resolved Hide resolved
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 There are few changes required. Otherwise it looks good.

Copy link
Contributor

@LalitLab LalitLab 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.

Can we ensure KMS cryptokeys are not anonymously or publicly accessible ? as an example ?

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

@bigdatasourav bigdatasourav requested review from cbruno10, Subhajit97 and rajlearner17 and removed request for Subhajit97 April 20, 2021 07:39
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

@cbruno10 cbruno10 removed the request for review from Subhajit97 April 22, 2021 17:49
@cbruno10 cbruno10 merged commit ad48f12 into main Apr 22, 2021
@cbruno10 cbruno10 deleted the issue-170 branch April 22, 2021 17:50
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_ring
5 participants