-
Notifications
You must be signed in to change notification settings - Fork 912
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 intercepting sinks to the organization module #2799
base: master
Are you sure you want to change the base?
Add intercepting sinks to the organization module #2799
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
…-Intercept-Child-Logging
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.
@rshokati2 Thanks for sending this PR! It's been on my to-do list for a while.
These changes also make sense for the folder
module. Could you replicate them there as well?
I've left a few more comments below.
@@ -56,11 +56,19 @@ variable "logging_sinks" { | |||
exclusions = optional(map(string), {}) | |||
filter = optional(string) | |||
iam = optional(bool, true) | |||
include_children = optional(bool, true) | |||
include_children = bool | |||
intercept_children = bool |
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 is a breaking change. Anyone currently using the module without specifying include_children
will have an error after updating.
Can we keep include_children=optional(bool, true)
and intercept_children=optional(bool, false)
?
for k, v in var.logging_sinks : | ||
v.intercept_children == false || (v.intercept_children == true && v.include_children == true && v.type == "project") | ||
]) | ||
error_message = "if 'intercept_children' = true' then 'include_children' also needs to be true when the logging_sink 'type' is 'project'." |
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 validation is already done server-side. I'm not sure we want to replicate it here. @ludoo what do you think?
The condition can be simplified to
condition = alltrue([
for k, v in var.logging_sinks :
!v.intercept_children || (v.include_children && v.type == "project")
])
Allow fabric organization module to intercept audit logging including all child resources. The validation block ensures both intercept_children and include_children as set to true, and the destination 'type' is a 'project'.
Checklist
I applicable, I acknowledge that I have:
terraform fmt
on all modified filestools/tfdoc.py