forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cloud_sql_target field in google_data_loss_prevention_discovery_c…
…onfig (GoogleCloudPlatform#10625)
- Loading branch information
1 parent
42bd93f
commit 5899856
Showing
3 changed files
with
347 additions
and
1 deletion.
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
78 changes: 78 additions & 0 deletions
78
mmv1/templates/terraform/examples/dlp_discovery_config_cloud_sql.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,78 @@ | ||
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_sql_target { | ||
filter { | ||
collection { | ||
include_regexes { | ||
patterns { | ||
project_id_regex = ".*" | ||
instance_regex = ".*" | ||
database_regex = ".*" | ||
database_resource_name_regex = "mytable.*" | ||
} | ||
} | ||
} | ||
} | ||
conditions { | ||
database_engines = ["ALL_SUPPORTED_DATABASE_ENGINES"] | ||
types = ["DATABASE_RESOURCE_TYPE_ALL_SUPPORTED_TYPES"] | ||
} | ||
generation_cadence { | ||
schema_modified_cadence { | ||
types = ["NEW_COLUMNS", "REMOVED_COLUMNS"] | ||
frequency = "UPDATE_FREQUENCY_DAILY" | ||
} | ||
refresh_frequency = "UPDATE_FREQUENCY_MONTHLY" | ||
} | ||
} | ||
} | ||
targets { | ||
cloud_sql_target { | ||
filter { | ||
collection { | ||
include_regexes { | ||
patterns { | ||
project_id_regex = ".*" | ||
instance_regex = ".*" | ||
database_regex = "do-not-scan.*" | ||
database_resource_name_regex = ".*" | ||
} | ||
} | ||
} | ||
} | ||
disabled {} | ||
} | ||
} | ||
targets { | ||
cloud_sql_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" | ||
} | ||
} | ||
} |
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