Skip to content

Commit

Permalink
feat(google_project): Data access logging (#86)
Browse files Browse the repository at this point in the history
* added a resource for enabling data access logs on all projects with a risk level label of high

* fixed missing double quote

* terraform fmt

* switched risk_level from a variable to a local

* switched risk_level back to variable

* fixed variable for risk level
  • Loading branch information
mlarsonweber authored Feb 17, 2023
1 parent c6bcdd4 commit d998ac9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions google_project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,20 @@ resource "google_project_service" "project" {
project = local.project_id
service = each.key
disable_on_destroy = false
}

resource "google_project_iam_audit_config" "data_access_high" {
count = var.risk_level == "high" ? 1 : 0

project = local.project_id
service = "allServices"
audit_log_config {
log_type = "ADMIN_READ"
}
audit_log_config {
log_type = "DATA_READ"
}
audit_log_config {
log_type = "DATA_WRITE"
}
}

0 comments on commit d998ac9

Please sign in to comment.