Skip to content

Commit 55a06fa

Browse files
Refactor: remove data access logs enabled variable (#1332)
1 parent 105a0db commit 55a06fa

File tree

4 files changed

+0
-58
lines changed

4 files changed

+0
-58
lines changed

1-org/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ See [troubleshooting](../docs/TROUBLESHOOTING.md) if you run into issues during
6868

6969
## Usage
7070

71-
**Disclaimer:** This step enables [Data Access logs](https://cloud.google.com/logging/docs/audit#data-access) for all services in your organization.
72-
Enabling Data Access logs might result in your project being charged for the additional logs usage.
73-
For details on costs you might incur, go to [Pricing](https://cloud.google.com/stackdriver/pricing).
74-
You can choose not to enable the Data Access logs by setting the variable `data_access_logs_enabled` to false.
75-
7671
Consider the following:
7772

7873
- This module creates a sink to export all logs to a Cloud Logging bucket. It also creates sinks to export a subset of security-related logs

1-org/envs/shared/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
| billing\_export\_dataset\_location | The location of the dataset for billing data export. | `string` | `null` | no |
77
| create\_access\_context\_manager\_access\_policy | Whether to create access context manager access policy. | `bool` | `true` | no |
88
| create\_unique\_tag\_key | Creates unique organization-wide tag keys by adding a random suffix to each key. | `bool` | `false` | no |
9-
| data\_access\_logs\_enabled | Enable Data Access logs of types DATA\_READ, DATA\_WRITE for all GCP services. Enabling Data Access logs might result in your organization being charged for the additional logs usage. See https://cloud.google.com/logging/docs/audit#data-access The ADMIN\_READ logs are enabled by default. | `bool` | `false` | no |
109
| domains\_to\_allow | The list of domains to allow users from in IAM. Used by Domain Restricted Sharing Organization Policy. Must include the domain of the organization you are deploying the foundation. To add other domains you must also grant access to these domains to the Terraform Service Account used in the deploy. | `list(string)` | n/a | yes |
1110
| enable\_hub\_and\_spoke | Enable Hub-and-Spoke architecture. | `bool` | `false` | no |
1211
| enable\_scc\_resources\_in\_terraform | Create Security Command Center resources in Terraform. If your organization has newly enabled any preview features for SCC and get an error related to the v2 API, you must set this variable to false because the v2 API does not yet support Terraform resources. See [issue 1189](https://github.com/terraform-google-modules/terraform-example-foundation/issues/1189) for context. | `bool` | `false` | no |

1-org/envs/shared/iam.tf

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -18,52 +18,6 @@
1818
Audit Logs - IAM
1919
*****************************************/
2020

21-
locals {
22-
enabling_data_logs = var.data_access_logs_enabled ? ["DATA_WRITE", "DATA_READ"] : []
23-
}
24-
25-
resource "google_organization_iam_audit_config" "org_config" {
26-
count = local.parent_folder == "" ? 1 : 0
27-
org_id = local.org_id
28-
service = "allServices"
29-
30-
###################################################################################################
31-
### Audit logs can generate costs, to know more about it,
32-
### check the official documentation: https://cloud.google.com/stackdriver/pricing#logging-costs
33-
### To know more about audit logs, you can find more infos
34-
### here https://cloud.google.com/logging/docs/audit/configure-data-access
35-
### To enable DATA_READ and DATA_WRITE audit logs, set `data_access_logs_enabled` to true
36-
### ADMIN_READ logs are enabled by default.
37-
####################################################################################################
38-
dynamic "audit_log_config" {
39-
for_each = setunion(local.enabling_data_logs, ["ADMIN_READ"])
40-
content {
41-
log_type = audit_log_config.key
42-
}
43-
}
44-
}
45-
46-
resource "google_folder_iam_audit_config" "folder_config" {
47-
count = local.parent_folder != "" ? 1 : 0
48-
folder = "folders/${local.parent_folder}"
49-
service = "allServices"
50-
51-
###################################################################################################
52-
### Audit logs can generate costs, to know more about it,
53-
### check the official documentation: https://cloud.google.com/stackdriver/pricing#logging-costs
54-
### To know more about audit logs, you can find more infos
55-
### here https://cloud.google.com/logging/docs/audit/configure-data-access
56-
### To enable DATA_READ and DATA_WRITE audit logs, set `data_access_logs_enabled` to true
57-
### ADMIN_READ logs are enabled by default.
58-
####################################################################################################
59-
dynamic "audit_log_config" {
60-
for_each = setunion(local.enabling_data_logs, ["ADMIN_READ"])
61-
content {
62-
log_type = audit_log_config.key
63-
}
64-
}
65-
}
66-
6721
resource "google_project_iam_member" "audit_log_logging_viewer" {
6822
project = module.org_audit_logs.project_id
6923
role = "roles/logging.viewer"

1-org/envs/shared/variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ variable "enforce_allowed_worker_pools" {
5454
default = false
5555
}
5656

57-
variable "data_access_logs_enabled" {
58-
description = "Enable Data Access logs of types DATA_READ, DATA_WRITE for all GCP services. Enabling Data Access logs might result in your organization being charged for the additional logs usage. See https://cloud.google.com/logging/docs/audit#data-access The ADMIN_READ logs are enabled by default."
59-
type = bool
60-
default = false
61-
}
62-
6357
variable "log_export_storage_location" {
6458
description = "The location of the storage bucket used to export logs."
6559
type = string

0 commit comments

Comments
 (0)