-
Notifications
You must be signed in to change notification settings - Fork 96
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
feat!: Restricting autokey module to autokey configuration use case #163
base: master
Are you sure you want to change the base?
Conversation
/gcbrun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own understanding, why is it better to keep google_kms_key_handle
resource outside the terraform-google-kms
module scope?
KMS has two personas
key admin should only focus on key management policies and setups AND shouldnt have access to kms keys created. The keyhandle creation and access to keys is for second persona (key users) thats why we are separating it out |
If the only motivation to cut Suggestion: we could turn To be more clear, the module's usage would be something like that: # Key admins usage example
module "autokey" {
source = "terraform-google-modules/kms/google//modules/autokey"
version = "3.1.0"
project_id = "project-bar"
autokey_configuration_folder = "123456789"
}
}
# Key users usage example
module "autokey" {
source = "terraform-google-modules/kms/google//modules/autokey"
version = "3.1.0"
autokey_handles = {
storage_bucket = {
name = "bucket-key-handle",
project = "project-foo",
resource_type_selector = "storage.googleapis.com/Bucket",
location = "us-central1"
},
compute_disk = {
name = "disk-key-handle",
project = "project-foo2",
resource_type_selector = "compute.googleapis.com/Disk",
location = "us-central1"
}
# It would be possible to create multiple Key Handles here, if desired.
}
} Some benefits of using the KMS module approach:
Let me know what you think about that! Thanks! |
/gcbrun |
/gcbrun |
See this makes a lot more sense if Security admin and Key admin are the same person. Your suggestion makes sense but the expectation from the perspective of the personas are quite differnt. |
/gcbrun |
/gcbrun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, I'll defer to:
- @romanini-ciandt to do one last pass and approve
- the CFT team re: breaking change, I believe Leo will be summarizing the changes and looping them in, so they're aware and can give final approval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The terraform code looks good, I just can't evaluate the decisions made in order to generate this breaking change.
As @tdbhacks mentioned, I'll summarize the changes and involve CFT team so they can give the final approval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tdbhacks @romanini-ciandt!
Thanks @nb-goog - For the breaking change, I recommend including a public docs/upgrading_to_v4.0.md
transition guide. Here is an example from another repo: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/master/docs/upgrading_to_v33.0.md. In particular it looks like current users of the autokey module will need to switch project_id
to autokey_kms_project_id
?
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a design/usability question to ponder
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
test/integration/bucket_setup_using_autokey/bucket_setup_using_autokey_test.go
Outdated
Show resolved
Hide resolved
/gcbrun |
In this PR,
2.1 for enabling autokey config on a project
2.2 for creating a bucket using autokey