Skip to content

Add additional encryption options #27

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ilakhtenkov
Copy link
Contributor

@ilakhtenkov ilakhtenkov commented Jan 2, 2023

Added options to set up kms keys for Pub/Sub and GCS

Copy link
Contributor

@rarsan rarsan left a comment

Choose a reason for hiding this comment

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

Thanks for adding this. Let's pls rebase. A couple of comments below.

@@ -74,7 +76,8 @@ locals {
}

resource "google_pubsub_topic" "dataflow_input_pubsub_topic" {
name = local.dataflow_input_topic_name
name = local.dataflow_input_topic_name
kms_key_name = var.pubsub_kms_key_name
Copy link
Contributor

Choose a reason for hiding this comment

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

Will kms_key_name be ignored if user doesn't provide this input?

@@ -34,6 +35,12 @@ resource "google_storage_bucket" "dataflow_job_temp_bucket" {
name = local.dataflow_temporary_gcs_bucket_name
location = var.region
storage_class = "REGIONAL"
dynamic "encryption" {
Copy link
Contributor

Choose a reason for hiding this comment

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

I can see the intent behind this dynamic block. However it's not easy to read at all. Is there another better way to apply a conditional here? Maybe two bucket resources with conditional/count, one encrypted, the other is not enccypted.

Also, what is driving this requirement given this is a temporary bucket?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There could be organization policy applied that you are not able to create any buckets despite of their content without CMEK for example.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thx for clarifying what's driving this PR. Org policies requiring use of CMEK for other services (GCS, PubSub or Dataflow) makes sense.


variable "gcs_kms_key_name" {
type = string
description = "(Optional) The `id` of a Cloud KMS key that will be used to encrypt objects inserted into temporary bucket. User is responsible for permissions to this key for Cloud Storage Service Account."
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be helpful to document the permissions required in the README, even if they are not managed by the module. Same for KMS key for PubSub topic.

@ilakhtenkov ilakhtenkov force-pushed the feature/add-additional-encryption-options branch from 553f9ed to 688e5de Compare February 7, 2023 23:04
@ilakhtenkov ilakhtenkov force-pushed the feature/add-additional-encryption-options branch from 688e5de to 4916f78 Compare February 7, 2023 23:06
@ilakhtenkov
Copy link
Contributor Author

I will move it to draft as need to fix some points.
Also cmek is missing for dataflow service - improvements required.
I've opened issue for hardening discussions #35

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.

2 participants