-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GCS fields to DiscoveryConfig.yaml.
Add tests for GCS terraform
- Loading branch information
1 parent
67624be
commit 1cada78
Showing
3 changed files
with
446 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
mmv1/templates/terraform/examples/dlp_discovery_config_cloud_storage.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
resource "google_data_loss_prevention_discovery_config" "<%= ctx[:primary_resource_id] %>" { | ||
parent = "projects/<%= ctx[:test_env_vars]['project'] %>/locations/us" | ||
location = "us" | ||
status = "RUNNING" | ||
|
||
targets { | ||
cloud_storage_target { | ||
filter { | ||
collection { | ||
include_regexes { | ||
patterns { | ||
cloud_storage_regex { | ||
project_id_regex = "foo-project" | ||
bucket_name_regex = "bucket" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
conditions { | ||
created_after = "2023-10-02T15:01:23Z" | ||
min_age = "10800s" | ||
cloud_storage_conditions { | ||
included_object_attributes = ["ALL_SUPPORTED_OBJECTS"] | ||
included_bucket_attributes = ["ALL_SUPPORTED_BUCKETS"] | ||
} | ||
} | ||
generation_cadence { | ||
inspect_template_modified_cadence { | ||
frequency = "UPDATE_FREQUENCY_DAILY" | ||
} | ||
refresh_frequency = "UPDATE_FREQUENCY_MONTHLY" | ||
} | ||
} | ||
} | ||
targets { | ||
cloud_storage_target { | ||
filter { | ||
collection { | ||
include_regexes { | ||
patterns { | ||
cloud_storage_regex { | ||
project_id_regex = "foo-project" | ||
bucket_name_regex = "do-not-scan" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
disabled {} | ||
} | ||
} | ||
targets { | ||
cloud_storage_target { | ||
filter { | ||
others {} | ||
} | ||
generation_cadence { | ||
schema_modified_cadence { | ||
types = ["NEW_COLUMNS"] | ||
frequency = "UPDATE_FREQUENCY_MONTHLY" | ||
} | ||
refresh_frequency = "UPDATE_FREQUENCY_MONTHLY" | ||
} | ||
} | ||
|
||
} | ||
inspect_templates = ["projects/%{project}/inspectTemplates/${google_data_loss_prevention_inspect_template.basic.name}"] | ||
} | ||
|
||
resource "google_data_loss_prevention_inspect_template" "basic" { | ||
parent = "projects/<%= ctx[:test_env_vars]['project'] %>" | ||
description = "My description" | ||
display_name = "display_name" | ||
|
||
inspect_config { | ||
info_types { | ||
name = "EMAIL_ADDRESS" | ||
} | ||
} | ||
} |
Oops, something went wrong.