From 794d80a16a58bd8673e1c0d9ded7ac569dba1243 Mon Sep 17 00:00:00 2001 From: The Magician Date: Wed, 7 Aug 2024 08:44:14 -0700 Subject: [PATCH] Add deletion_protection field to Folders resource (#11293) (#7903) [upstream:a31848e911392a82ae25e89c4bac87c6275541fc] Signed-off-by: Modular Magician --- .changelog/11293.txt | 3 ++ ...ss_approval_folder_service_account_test.go | 1 + ...ce_access_approval_folder_settings_test.go | 3 ++ ...sured_workloads_workload_generated_test.go | 3 ++ ..._cloud_asset_folder_feed_generated_test.go | 1 + ...ompute_firewall_policy_association_test.go | 2 ++ ...ute_firewall_policy_rule_generated_test.go | 2 ++ ...ource_compute_firewall_policy_rule_test.go | 8 +++++ .../resource_compute_firewall_policy_test.go | 2 ++ ...urity_policy_association_generated_test.go | 1 + ..._organization_security_policy_rule_test.go | 2 ++ .../iam2/resource_iam_deny_policy_test.go | 2 ++ ...ource_kms_autokey_config_generated_test.go | 1 + .../resource_kms_key_handle_generated_test.go | 1 + ...rce_google_logging_folder_settings_test.go | 1 + .../resource_logging_bucket_config_test.go | 1 + .../resource_logging_folder_exclusion_test.go | 3 ++ ..._logging_folder_settings_generated_test.go | 1 + .../resource_logging_folder_settings_test.go | 2 ++ .../resource_logging_folder_sink_test.go | 13 ++++++-- .../resource_org_policy_policy_test.go | 2 ++ .../data_source_google_active_folder_test.go | 2 ++ .../data_source_google_folder.go | 8 +++++ ..._google_folder_organization_policy_test.go | 1 + .../data_source_google_folder_test.go | 3 ++ .../data_source_google_folders_test.go | 1 + .../resourcemanager/resource_google_folder.go | 31 ++++++++++++++++++- ...rce_google_folder_iam_audit_config_test.go | 6 ++++ ...resource_google_folder_iam_binding_test.go | 5 +++ .../resource_google_folder_iam_member_test.go | 2 ++ .../resource_google_folder_iam_policy_test.go | 3 ++ ..._google_folder_organization_policy_test.go | 5 +++ .../resource_google_folder_test.go | 10 ++++-- .../resource_google_project_test.go | 3 ++ .../resource_scc_folder_custom_module_test.go | 3 ++ ...ity_health_analytics_custom_module_test.go | 3 ++ .../guides/version_6_upgrade.html.markdown | 13 ++++++++ .../r/cloud_asset_folder_feed.html.markdown | 1 + ...compute_firewall_policy_rule.html.markdown | 1 + ..._security_policy_association.html.markdown | 1 + ...der_access_approval_settings.html.markdown | 2 ++ .../docs/r/kms_autokey_config.html.markdown | 1 + website/docs/r/kms_key_handle.html.markdown | 1 + .../r/logging_folder_settings.html.markdown | 1 + .../docs/r/org_policy_policy.html.markdown | 1 + .../r/scc_folder_custom_module.html.markdown | 2 ++ ...alth_analytics_custom_module.html.markdown | 2 ++ 47 files changed, 161 insertions(+), 6 deletions(-) create mode 100644 .changelog/11293.txt diff --git a/.changelog/11293.txt b/.changelog/11293.txt new file mode 100644 index 0000000000..abaa16417f --- /dev/null +++ b/.changelog/11293.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +google_folders: added `deletion_protection` field to `folders` to make deleting them require an explicit intent. `folder` resources now cannot be destroyed unless `deletion_protection = false` is set for the resource. +``` \ No newline at end of file diff --git a/google-beta/services/accessapproval/data_source_access_approval_folder_service_account_test.go b/google-beta/services/accessapproval/data_source_access_approval_folder_service_account_test.go index c58f55b025..69eccd07f4 100644 --- a/google-beta/services/accessapproval/data_source_access_approval_folder_service_account_test.go +++ b/google-beta/services/accessapproval/data_source_access_approval_folder_service_account_test.go @@ -42,6 +42,7 @@ func testAccDataSourceAccessApprovalFolderServiceAccount_basic(context map[strin resource "google_folder" "my_folder" { display_name = "tf-test-my-folder%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } # Wait after folder creation to limit eventual consistency errors. diff --git a/google-beta/services/accessapproval/resource_access_approval_folder_settings_test.go b/google-beta/services/accessapproval/resource_access_approval_folder_settings_test.go index 6156576a86..8f384e98f1 100644 --- a/google-beta/services/accessapproval/resource_access_approval_folder_settings_test.go +++ b/google-beta/services/accessapproval/resource_access_approval_folder_settings_test.go @@ -69,6 +69,7 @@ func testAccAccessApprovalFolderSettings_full(context map[string]interface{}) st resource "google_folder" "my_folder" { display_name = "tf-test-my-folder%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } # Wait after folder creation to limit eventual consistency errors. @@ -96,6 +97,7 @@ func testAccAccessApprovalFolderSettings_update(context map[string]interface{}) resource "google_folder" "my_folder" { display_name = "tf-test-my-folder%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } # Wait after folder creation to limit eventual consistency errors. @@ -123,6 +125,7 @@ func testAccAccessApprovalFolderSettings_activeKeyVersion(context map[string]int resource "google_folder" "my_folder" { display_name = "tf-test-my-folder%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } # Wait after folder creation to limit eventual consistency errors. diff --git a/google-beta/services/assuredworkloads/resource_assured_workloads_workload_generated_test.go b/google-beta/services/assuredworkloads/resource_assured_workloads_workload_generated_test.go index 4a0b225170..cbe3ddcb9f 100644 --- a/google-beta/services/assuredworkloads/resource_assured_workloads_workload_generated_test.go +++ b/google-beta/services/assuredworkloads/resource_assured_workloads_workload_generated_test.go @@ -210,6 +210,7 @@ resource "google_assured_workloads_workload" "primary" { resource "google_folder" "folder1" { display_name = "tf-test-name%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } `, context) } @@ -236,6 +237,7 @@ resource "google_assured_workloads_workload" "primary" { resource "google_folder" "folder1" { display_name = "tf-test-name%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } `, context) } @@ -258,6 +260,7 @@ resource "google_assured_workloads_workload" "primary" { resource "google_folder" "folder1" { display_name = "tf-test-name%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } `, context) diff --git a/google-beta/services/cloudasset/resource_cloud_asset_folder_feed_generated_test.go b/google-beta/services/cloudasset/resource_cloud_asset_folder_feed_generated_test.go index 842419c010..7693af6608 100644 --- a/google-beta/services/cloudasset/resource_cloud_asset_folder_feed_generated_test.go +++ b/google-beta/services/cloudasset/resource_cloud_asset_folder_feed_generated_test.go @@ -99,6 +99,7 @@ resource "google_pubsub_topic" "feed_output" { resource "google_folder" "my_folder" { display_name = "Networking%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } # Find the project number of the project whose identity will be used for sending diff --git a/google-beta/services/compute/resource_compute_firewall_policy_association_test.go b/google-beta/services/compute/resource_compute_firewall_policy_association_test.go index 9bd487b9ac..1a47f0c58c 100644 --- a/google-beta/services/compute/resource_compute_firewall_policy_association_test.go +++ b/google-beta/services/compute/resource_compute_firewall_policy_association_test.go @@ -42,11 +42,13 @@ func testAccComputeFirewallPolicyAssociation_basic(context map[string]interface{ resource "google_folder" "folder" { display_name = "tf-test-folder-%{random_suffix}" parent = "%{org_name}" + deletion_protection = false } resource "google_folder" "target_folder" { display_name = "tf-test-target-%{random_suffix}" parent = "%{org_name}" + deletion_protection = false } resource "google_compute_firewall_policy" "default" { diff --git a/google-beta/services/compute/resource_compute_firewall_policy_rule_generated_test.go b/google-beta/services/compute/resource_compute_firewall_policy_rule_generated_test.go index bd053416e7..eb44c8efc9 100644 --- a/google-beta/services/compute/resource_compute_firewall_policy_rule_generated_test.go +++ b/google-beta/services/compute/resource_compute_firewall_policy_rule_generated_test.go @@ -83,6 +83,7 @@ resource "google_network_security_address_group" "basic_global_networksecurity_a resource "google_folder" "folder" { display_name = "tf-test-policy%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } resource "google_compute_firewall_policy" "default" { @@ -136,6 +137,7 @@ resource "google_network_security_address_group" "basic_global_networksecurity_a resource "google_folder" "folder" { display_name = "tf-test-policy%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } resource "google_compute_firewall_policy" "default" { diff --git a/google-beta/services/compute/resource_compute_firewall_policy_rule_test.go b/google-beta/services/compute/resource_compute_firewall_policy_rule_test.go index db352bc3c7..36decf5b61 100644 --- a/google-beta/services/compute/resource_compute_firewall_policy_rule_test.go +++ b/google-beta/services/compute/resource_compute_firewall_policy_rule_test.go @@ -154,6 +154,7 @@ func testAccComputeFirewallPolicyRule_securityProfileGroup_basic(context map[str resource "google_folder" "folder" { display_name = "tf-test-folder-%{random_suffix}" parent = "%{org_name}" + deletion_protection = false } resource "google_network_security_security_profile" "security_profile" { @@ -203,6 +204,7 @@ func testAccComputeFirewallPolicyRule_securityProfileGroup_update(context map[st resource "google_folder" "folder" { display_name = "tf-test-folder-%{random_suffix}" parent = "%{org_name}" + deletion_protection = false } resource "google_network_security_security_profile" "security_profile" { @@ -278,6 +280,7 @@ resource "google_compute_network" "network2" { resource "google_folder" "folder" { display_name = "tf-test-folder-%{random_suffix}" parent = "%{org_name}" + deletion_protection = false } resource "google_compute_firewall_policy" "fw_policy" { @@ -343,6 +346,7 @@ resource "google_compute_network" "network2" { resource "google_folder" "folder" { display_name = "tf-test-folder-%{random_suffix}" parent = "%{org_name}" + deletion_protection = false } resource "google_compute_firewall_policy" "fw_policy" { @@ -418,6 +422,7 @@ resource "google_compute_network" "network2" { resource "google_folder" "folder" { display_name = "tf-test-folder-%{random_suffix}" parent = "%{org_name}" + deletion_protection = false } resource "google_compute_firewall_policy" "fw_policy" { @@ -469,6 +474,7 @@ func testAccComputeFirewallPolicyRule_multiple(context map[string]interface{}) s resource "google_folder" "folder" { display_name = "tf-test-folder-%{random_suffix}" parent = "%{org_name}" + deletion_protection = false } resource "google_compute_firewall_policy" "fw_policy" { @@ -541,6 +547,7 @@ func testAccComputeFirewallPolicyRule_multipleAdd(context map[string]interface{} resource "google_folder" "folder" { display_name = "tf-test-folder-%{random_suffix}" parent = "%{org_name}" + deletion_protection = false } resource "google_compute_firewall_policy" "fw_policy" { @@ -634,6 +641,7 @@ func testAccComputeFirewallPolicyRule_multipleRemove(context map[string]interfac resource "google_folder" "folder" { display_name = "tf-test-folder-%{random_suffix}" parent = "%{org_name}" + deletion_protection = false } resource "google_compute_firewall_policy" "fw_policy" { diff --git a/google-beta/services/compute/resource_compute_firewall_policy_test.go b/google-beta/services/compute/resource_compute_firewall_policy_test.go index dcd8663ab3..8db6177a18 100644 --- a/google-beta/services/compute/resource_compute_firewall_policy_test.go +++ b/google-beta/services/compute/resource_compute_firewall_policy_test.go @@ -56,6 +56,7 @@ func testAccComputeFirewallPolicy_basic(org, policyName, folderName string) stri resource "google_folder" "folder" { display_name = "%s" parent = "%s" + deletion_protection = false } resource "google_compute_firewall_policy" "default" { @@ -71,6 +72,7 @@ func testAccComputeFirewallPolicy_update(org, policyName, folderName string) str resource "google_folder" "folder" { display_name = "%s" parent = "%s" + deletion_protection = false } resource "google_compute_firewall_policy" "default" { diff --git a/google-beta/services/compute/resource_compute_organization_security_policy_association_generated_test.go b/google-beta/services/compute/resource_compute_organization_security_policy_association_generated_test.go index 0791a9870e..4c915a05d4 100644 --- a/google-beta/services/compute/resource_compute_organization_security_policy_association_generated_test.go +++ b/google-beta/services/compute/resource_compute_organization_security_policy_association_generated_test.go @@ -61,6 +61,7 @@ resource "google_folder" "security_policy_target" { provider = google-beta display_name = "tf-test-secpol-%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } resource "google_compute_organization_security_policy" "policy" { diff --git a/google-beta/services/compute/resource_compute_organization_security_policy_rule_test.go b/google-beta/services/compute/resource_compute_organization_security_policy_rule_test.go index 74272005bf..dfa39cee6e 100644 --- a/google-beta/services/compute/resource_compute_organization_security_policy_rule_test.go +++ b/google-beta/services/compute/resource_compute_organization_security_policy_rule_test.go @@ -48,6 +48,7 @@ func testAccComputeOrganizationSecurityPolicyRule_organizationSecurityPolicyRule resource "google_folder" "security_policy_target" { display_name = "tf-test-secpol-%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } resource "google_compute_organization_security_policy" "policy" { @@ -82,6 +83,7 @@ func testAccComputeOrganizationSecurityPolicyRule_organizationSecurityPolicyRule resource "google_folder" "security_policy_target" { display_name = "tf-test-secpol-%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } resource "google_compute_organization_security_policy" "policy" { diff --git a/google-beta/services/iam2/resource_iam_deny_policy_test.go b/google-beta/services/iam2/resource_iam_deny_policy_test.go index be57312aca..b7564b81aa 100644 --- a/google-beta/services/iam2/resource_iam_deny_policy_test.go +++ b/google-beta/services/iam2/resource_iam_deny_policy_test.go @@ -195,6 +195,7 @@ resource "google_iam_deny_policy" "example" { resource "google_folder" "folder" { display_name = "tf-test-%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } `, context) } @@ -217,6 +218,7 @@ resource "google_iam_deny_policy" "example" { resource "google_folder" "folder" { display_name = "tf-test-%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } `, context) } diff --git a/google-beta/services/kms/resource_kms_autokey_config_generated_test.go b/google-beta/services/kms/resource_kms_autokey_config_generated_test.go index b44d22a76d..4d93a60988 100644 --- a/google-beta/services/kms/resource_kms_autokey_config_generated_test.go +++ b/google-beta/services/kms/resource_kms_autokey_config_generated_test.go @@ -69,6 +69,7 @@ resource "google_folder" "autokms_folder" { provider = google-beta display_name = "tf-test-my-folder%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } # Create the key project diff --git a/google-beta/services/kms/resource_kms_key_handle_generated_test.go b/google-beta/services/kms/resource_kms_key_handle_generated_test.go index 01d07fade0..e78dc3f021 100644 --- a/google-beta/services/kms/resource_kms_key_handle_generated_test.go +++ b/google-beta/services/kms/resource_kms_key_handle_generated_test.go @@ -63,6 +63,7 @@ resource "google_folder" "autokms_folder" { provider = google-beta display_name = "folder-example" parent = "organizations/%{org_id}" + deletion_protection = false } # Create the key project diff --git a/google-beta/services/logging/data_source_google_logging_folder_settings_test.go b/google-beta/services/logging/data_source_google_logging_folder_settings_test.go index e58bda30c2..19ace397b0 100644 --- a/google-beta/services/logging/data_source_google_logging_folder_settings_test.go +++ b/google-beta/services/logging/data_source_google_logging_folder_settings_test.go @@ -39,6 +39,7 @@ func testAccLoggingFolderSettings_datasource(context map[string]interface{}) str resource "google_folder" "default" { display_name = "%{folder_name}" parent = "organizations/%{org_id}" + deletion_protection = false } data "google_logging_folder_settings" "settings" { diff --git a/google-beta/services/logging/resource_logging_bucket_config_test.go b/google-beta/services/logging/resource_logging_bucket_config_test.go index b7bb3535ba..d1e1b77ef9 100644 --- a/google-beta/services/logging/resource_logging_bucket_config_test.go +++ b/google-beta/services/logging/resource_logging_bucket_config_test.go @@ -258,6 +258,7 @@ func testAccLoggingBucketConfigFolder_basic(context map[string]interface{}, rete resource "google_folder" "default" { display_name = "%{folder_name}" parent = "organizations/%{org_id}" + deletion_protection = false } resource "google_logging_folder_bucket_config" "basic" { diff --git a/google-beta/services/logging/resource_logging_folder_exclusion_test.go b/google-beta/services/logging/resource_logging_folder_exclusion_test.go index 9f544a6ca7..57b453d88f 100644 --- a/google-beta/services/logging/resource_logging_folder_exclusion_test.go +++ b/google-beta/services/logging/resource_logging_folder_exclusion_test.go @@ -239,6 +239,7 @@ resource "google_logging_folder_exclusion" "basic" { resource "google_folder" "my-folder" { display_name = "%s" parent = "%s" + deletion_protection = false } `, exclusionName, description, envvar.GetTestProjectFromEnv(), folderName, folderParent) } @@ -255,6 +256,7 @@ resource "google_logging_folder_exclusion" "full-folder" { resource "google_folder" "my-folder" { display_name = "%s" parent = "%s" + deletion_protection = false } `, exclusionName, description, envvar.GetTestProjectFromEnv(), folderName, folderParent) } @@ -264,6 +266,7 @@ func testAccLoggingFolderExclusion_multipleCfg(folderName, folderParent, exclusi resource "google_folder" "my-folder" { display_name = "%s" parent = "%s" + deletion_protection = false } `, folderName, folderParent) diff --git a/google-beta/services/logging/resource_logging_folder_settings_generated_test.go b/google-beta/services/logging/resource_logging_folder_settings_generated_test.go index 9f3a77354f..e391e3e403 100644 --- a/google-beta/services/logging/resource_logging_folder_settings_generated_test.go +++ b/google-beta/services/logging/resource_logging_folder_settings_generated_test.go @@ -65,6 +65,7 @@ resource "google_logging_folder_settings" "example" { resource "google_folder" "my_folder" { display_name = "tf-test-folder-name%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } data "google_logging_folder_settings" "settings" { diff --git a/google-beta/services/logging/resource_logging_folder_settings_test.go b/google-beta/services/logging/resource_logging_folder_settings_test.go index e997f062e5..e6c4e70241 100644 --- a/google-beta/services/logging/resource_logging_folder_settings_test.go +++ b/google-beta/services/logging/resource_logging_folder_settings_test.go @@ -60,6 +60,7 @@ resource "google_logging_folder_settings" "example" { resource "google_folder" "my_folder" { display_name = "tf-test-folder-%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } data "google_logging_folder_settings" "settings" { @@ -83,6 +84,7 @@ resource "google_logging_folder_settings" "example" { resource "google_folder" "my_folder" { display_name = "tf-test-folder-%{random_suffix}" parent = "organizations/%{org_id}" + deletion_protection = false } `, context) } diff --git a/google-beta/services/logging/resource_logging_folder_sink_test.go b/google-beta/services/logging/resource_logging_folder_sink_test.go index 9cd5b9b12e..16695d24c2 100644 --- a/google-beta/services/logging/resource_logging_folder_sink_test.go +++ b/google-beta/services/logging/resource_logging_folder_sink_test.go @@ -402,6 +402,7 @@ resource "google_storage_bucket" "log-bucket" { resource "google_folder" "my-folder" { display_name = "%s" parent = "%s" + deletion_protection = false } `, sinkName, envvar.GetTestProjectFromEnv(), bucketName, folderName, folderParent) } @@ -425,6 +426,7 @@ resource "google_storage_bucket" "log-bucket" { resource "google_folder" "my-folder" { display_name = "%s" parent = "%s" + deletion_protection = false } `, sinkName, envvar.GetTestProjectFromEnv(), bucketName, folderName, folderParent) } @@ -448,6 +450,7 @@ resource "google_storage_bucket" "log-bucket" { resource "google_folder" "my-folder" { display_name = "%s" parent = "%s" + deletion_protection = false } `, sinkName, envvar.GetTestProjectFromEnv(), bucketName, folderName, folderParent) } @@ -468,8 +471,9 @@ resource "google_storage_bucket" "log-bucket" { } resource "google_folder" "my-folder" { - display_name = "%s" - parent = "%s" + display_name = "%s" + parent = "%s" + deletion_protection = false }`, sinkName, bucketName, folderName, folderParent) } @@ -491,6 +495,7 @@ resource "google_storage_bucket" "log-bucket" { resource "google_folder" "my-folder" { display_name = "%s" parent = "%s" + deletion_protection = false } `, sinkName, envvar.GetTestProjectFromEnv(), bucketName, folderName, folderParent) } @@ -521,6 +526,7 @@ resource "google_storage_bucket" "log-bucket" { resource "google_folder" "my-folder" { display_name = "%s" parent = "%s" + deletion_protection = false } `, sinkName, envvar.GetTestProjectFromEnv(), bucketName, folderName, folderParent) } @@ -547,6 +553,7 @@ resource "google_bigquery_dataset" "logging_sink" { resource "google_folder" "my-folder" { display_name = "%s" parent = "%s" + deletion_protection = false }`, sinkName, envvar.GetTestProjectFromEnv(), envvar.GetTestProjectFromEnv(), bqDatasetID, folderName, folderParent) } @@ -568,6 +575,7 @@ resource "google_bigquery_dataset" "logging_sink" { resource "google_folder" "my-folder" { display_name = "%s" parent = "%s" + deletion_protection = false }`, sinkName, envvar.GetTestProjectFromEnv(), envvar.GetTestProjectFromEnv(), bqDatasetID, folderName, folderParent) } @@ -585,6 +593,7 @@ resource "google_logging_folder_sink" "intercept_update" { resource "google_folder" "intercept_folder" { display_name = "%s" parent = "%s" + deletion_protection = false } `, sinkName, envvar.GetTestProjectFromEnv(), envvar.GetTestProjectFromEnv(), intercept_children, folderName, folderParent) } diff --git a/google-beta/services/orgpolicy/resource_org_policy_policy_test.go b/google-beta/services/orgpolicy/resource_org_policy_policy_test.go index a2deb56590..64a66da0b5 100644 --- a/google-beta/services/orgpolicy/resource_org_policy_policy_test.go +++ b/google-beta/services/orgpolicy/resource_org_policy_policy_test.go @@ -210,6 +210,7 @@ resource "google_org_policy_policy" "primary" { resource "google_folder" "basic" { parent = "organizations/%{org_id}" display_name = "tf-test-folder%{random_suffix}" + deletion_protection = false } @@ -247,6 +248,7 @@ resource "google_org_policy_policy" "primary" { resource "google_folder" "basic" { parent = "organizations/%{org_id}" display_name = "tf-test-folder%{random_suffix}" + deletion_protection = false } diff --git a/google-beta/services/resourcemanager/data_source_google_active_folder_test.go b/google-beta/services/resourcemanager/data_source_google_active_folder_test.go index 1aea905530..67266e88aa 100644 --- a/google-beta/services/resourcemanager/data_source_google_active_folder_test.go +++ b/google-beta/services/resourcemanager/data_source_google_active_folder_test.go @@ -130,6 +130,7 @@ func testAccDataSourceGoogleActiveFolderConfig(parent string, displayName string resource "google_folder" "foobar" { parent = "%s" display_name = "%s" + deletion_protection = false } data "google_active_folder" "my_folder" { @@ -144,6 +145,7 @@ func testAccDataSourceGoogleActiveFolderConfig_Search(parent string, displayName resource "google_folder" "foobar" { parent = "%s" display_name = "%s" + deletion_protection = false } # Wait after folder creation to limit eventual consistency errors. diff --git a/google-beta/services/resourcemanager/data_source_google_folder.go b/google-beta/services/resourcemanager/data_source_google_folder.go index 018a9a9ac1..5316cc062f 100644 --- a/google-beta/services/resourcemanager/data_source_google_folder.go +++ b/google-beta/services/resourcemanager/data_source_google_folder.go @@ -52,6 +52,10 @@ func DataSourceGoogleFolder() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "deletion_protection": { + Type: schema.TypeBool, + Computed: true, + }, }, } } @@ -73,6 +77,10 @@ func dataSourceFolderRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("%s not found", id) } + if err := d.Set("deletion_protection", nil); err != nil { + return fmt.Errorf("Error setting deletion_protection: %s", err) + } + if v, ok := d.GetOk("lookup_organization"); ok && v.(bool) { organization, err := lookupOrganizationName(d.Id(), userAgent, d, config) if err != nil { diff --git a/google-beta/services/resourcemanager/data_source_google_folder_organization_policy_test.go b/google-beta/services/resourcemanager/data_source_google_folder_organization_policy_test.go index 12397ca8ce..88a58c73e6 100644 --- a/google-beta/services/resourcemanager/data_source_google_folder_organization_policy_test.go +++ b/google-beta/services/resourcemanager/data_source_google_folder_organization_policy_test.go @@ -35,6 +35,7 @@ func testAccDataSourceGoogleFolderOrganizationPolicy_basic(org, folder string) s resource "google_folder" "orgpolicy" { display_name = "%s" parent = "%s" + deletion_protection = false } resource "google_folder_organization_policy" "resource" { diff --git a/google-beta/services/resourcemanager/data_source_google_folder_test.go b/google-beta/services/resourcemanager/data_source_google_folder_test.go index 192c745f1d..e5bbfe8b8e 100644 --- a/google-beta/services/resourcemanager/data_source_google_folder_test.go +++ b/google-beta/services/resourcemanager/data_source_google_folder_test.go @@ -125,6 +125,7 @@ func testAccCheckGoogleFolder_byFullNameConfig(parent string, displayName string resource "google_folder" "foobar" { parent = "%s" display_name = "%s" + deletion_protection = false } data "google_folder" "folder" { @@ -138,6 +139,7 @@ func testAccCheckGoogleFolder_byShortNameConfig(parent string, displayName strin resource "google_folder" "foobar" { parent = "%s" display_name = "%s" + deletion_protection = false } data "google_folder" "folder" { @@ -151,6 +153,7 @@ func testAccCheckGoogleFolder_lookupOrganizationConfig(parent string, displayNam resource "google_folder" "foobar" { parent = "%s" display_name = "%s" + deletion_protection = false } data "google_folder" "folder" { diff --git a/google-beta/services/resourcemanager/data_source_google_folders_test.go b/google-beta/services/resourcemanager/data_source_google_folders_test.go index 3b8cf44db4..32743bfe74 100644 --- a/google-beta/services/resourcemanager/data_source_google_folders_test.go +++ b/google-beta/services/resourcemanager/data_source_google_folders_test.go @@ -42,6 +42,7 @@ func testAccCheckGoogleFoldersConfig(parent string, displayName string) string { resource "google_folder" "foobar" { parent = "%s" display_name = "%s" + deletion_protection = false } data "google_folders" "root-test" { diff --git a/google-beta/services/resourcemanager/resource_google_folder.go b/google-beta/services/resourcemanager/resource_google_folder.go index 54e41c532d..3a5d11785e 100644 --- a/google-beta/services/resourcemanager/resource_google_folder.go +++ b/google-beta/services/resourcemanager/resource_google_folder.go @@ -67,6 +67,12 @@ func ResourceGoogleFolder() *schema.Resource { Computed: true, Description: `Timestamp when the Folder was created. Assigned by the server. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".`, }, + "deletion_protection": { + Type: schema.TypeBool, + Optional: true, + Default: true, + Description: `When the field is set to true or unset in Terraform state, a terraform apply or terraform destroy that would delete the instance will fail. When the field is set to false, deleting the instance is allowed.`, + }, }, UseJSONNumber: true, } @@ -138,7 +144,12 @@ func resourceGoogleFolderRead(d *schema.ResourceData, meta interface{}) error { if err != nil { return transport_tpg.HandleNotFoundError(err, d, fmt.Sprintf("Folder Not Found : %s", d.Id())) } - + // Explicitly set client-side fields to default values if unset + if _, ok := d.GetOkExists("deletion_protection"); !ok { + if err := d.Set("deletion_protection", true); err != nil { + return fmt.Errorf("Error setting deletion_protection: %s", err) + } + } if err := d.Set("name", folder.Name); err != nil { return fmt.Errorf("Error setting name: %s", err) } @@ -168,6 +179,19 @@ func resourceGoogleFolderUpdate(d *schema.ResourceData, meta interface{}) error if err != nil { return err } + + clientSideFields := map[string]bool{"deletion_protection": true} + clientSideOnly := true + for field := range ResourceGoogleFolder().Schema { + if d.HasChange(field) && !clientSideFields[field] { + clientSideOnly = false + break + } + } + if clientSideOnly { + return nil + } + displayName := d.Get("display_name").(string) d.Partial(true) @@ -224,6 +248,11 @@ func resourceGoogleFolderDelete(d *schema.ResourceData, meta interface{}) error if err != nil { return err } + + if d.Get("deletion_protection").(bool) { + return fmt.Errorf("cannot destroy folder without setting deletion_protection=false and running `terraform apply`") + } + displayName := d.Get("display_name").(string) var op *resourceManagerV3.Operation diff --git a/google-beta/services/resourcemanager/resource_google_folder_iam_audit_config_test.go b/google-beta/services/resourcemanager/resource_google_folder_iam_audit_config_test.go index d42a0fbb59..33ddf82010 100644 --- a/google-beta/services/resourcemanager/resource_google_folder_iam_audit_config_test.go +++ b/google-beta/services/resourcemanager/resource_google_folder_iam_audit_config_test.go @@ -279,6 +279,7 @@ func testAccFolderAssociateAuditConfigBasic(org, fname, service string) string { resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } resource "google_folder_iam_audit_config" "acceptance" { @@ -300,6 +301,7 @@ func testAccFolderAssociateAuditConfigMultiple(org, fname, service, service2 str resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } resource "google_folder_iam_audit_config" "acceptance" { @@ -329,6 +331,7 @@ func testAccFolderAssociateAuditConfigUpdated(org, fname, service string) string resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } resource "google_folder_iam_audit_config" "acceptance" { @@ -350,6 +353,7 @@ func testAccFolderAssociateAuditConfigDropMemberFromBasic(org, fname, service st resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } resource "google_folder_iam_audit_config" "acceptance" { @@ -377,6 +381,7 @@ func testAccFolderAssociateAuditConfigMembers(org, fname, service string, member resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } resource "google_folder_iam_audit_config" "acceptance" { @@ -394,6 +399,7 @@ func testAccFolderAssociateAuditConfigLogType(org, fname, service, logType strin resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } resource "google_folder_iam_audit_config" "acceptance" { diff --git a/google-beta/services/resourcemanager/resource_google_folder_iam_binding_test.go b/google-beta/services/resourcemanager/resource_google_folder_iam_binding_test.go index a373efdf54..e031f7ab3e 100644 --- a/google-beta/services/resourcemanager/resource_google_folder_iam_binding_test.go +++ b/google-beta/services/resourcemanager/resource_google_folder_iam_binding_test.go @@ -295,6 +295,7 @@ func testAccFolderIamBasic(org, fname string) string { resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } `, org, fname) } @@ -304,6 +305,7 @@ func testAccFolderAssociateBindingBasic(org, fname string) string { resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } resource "google_folder_iam_binding" "acceptance" { @@ -319,6 +321,7 @@ func testAccFolderAssociateBindingMultiple(org, fname string) string { resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } resource "google_folder_iam_binding" "acceptance" { @@ -340,6 +343,7 @@ func testAccFolderAssociateBindingUpdated(org, fname string) string { resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } resource "google_folder_iam_binding" "acceptance" { @@ -355,6 +359,7 @@ func testAccFolderAssociateBindingDropMemberFromBasic(org, fname string) string resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } resource "google_folder_iam_binding" "acceptance" { diff --git a/google-beta/services/resourcemanager/resource_google_folder_iam_member_test.go b/google-beta/services/resourcemanager/resource_google_folder_iam_member_test.go index c676691a11..e413c9b133 100644 --- a/google-beta/services/resourcemanager/resource_google_folder_iam_member_test.go +++ b/google-beta/services/resourcemanager/resource_google_folder_iam_member_test.go @@ -129,6 +129,7 @@ func testAccFolderAssociateMemberBasic(org, fname string) string { resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } resource "google_folder_iam_member" "acceptance" { @@ -144,6 +145,7 @@ func testAccFolderAssociateMemberMultiple(org, fname string) string { resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } resource "google_folder_iam_member" "acceptance" { diff --git a/google-beta/services/resourcemanager/resource_google_folder_iam_policy_test.go b/google-beta/services/resourcemanager/resource_google_folder_iam_policy_test.go index 986fc1192c..619bfd1280 100644 --- a/google-beta/services/resourcemanager/resource_google_folder_iam_policy_test.go +++ b/google-beta/services/resourcemanager/resource_google_folder_iam_policy_test.go @@ -111,6 +111,7 @@ func testAccFolderIamPolicy_basic(folder, parent, role, member string) string { resource "google_folder" "permissiontest" { display_name = "%s" parent = "%s" + deletion_protection = false } data "google_iam_policy" "test" { @@ -136,6 +137,7 @@ func testAccFolderIamPolicy_basic2(folder, parent, role, member, role2, member2 resource "google_folder" "permissiontest" { display_name = "%s" parent = "%s" + deletion_protection = false } data "google_iam_policy" "test" { @@ -162,6 +164,7 @@ func testAccFolderIamPolicy_auditConfigs(folder, parent, role, member string) st resource "google_folder" "permissiontest" { display_name = "%s" parent = "%s" + deletion_protection = false } data "google_iam_policy" "test" { diff --git a/google-beta/services/resourcemanager/resource_google_folder_organization_policy_test.go b/google-beta/services/resourcemanager/resource_google_folder_organization_policy_test.go index 965abb0e0e..c2f9ae08be 100644 --- a/google-beta/services/resourcemanager/resource_google_folder_organization_policy_test.go +++ b/google-beta/services/resourcemanager/resource_google_folder_organization_policy_test.go @@ -312,6 +312,7 @@ func testAccFolderOrganizationPolicy_boolean(org, folder string, enforced bool) resource "google_folder" "orgpolicy" { display_name = "%s" parent = "%s" + deletion_protection = false } resource "google_folder_organization_policy" "bool" { @@ -331,6 +332,7 @@ func testAccFolderOrganizationPolicy_list_allowAll(org, folder string) string { resource "google_folder" "orgpolicy" { display_name = "%s" parent = "%s" + deletion_protection = false } resource "google_folder_organization_policy" "list" { @@ -351,6 +353,7 @@ func testAccFolderOrganizationPolicy_list_allowSome(org, folder, project string) resource "google_folder" "orgpolicy" { display_name = "%s" parent = "%s" + deletion_protection = false } resource "google_folder_organization_policy" "list" { @@ -371,6 +374,7 @@ func testAccFolderOrganizationPolicy_list_denySome(org, folder string) string { resource "google_folder" "orgpolicy" { display_name = "%s" parent = "%s" + deletion_protection = false } resource "google_folder_organization_policy" "list" { @@ -394,6 +398,7 @@ func testAccFolderOrganizationPolicy_restore_defaultTrue(org, folder string) str resource "google_folder" "orgpolicy" { display_name = "%s" parent = "%s" + deletion_protection = false } resource "google_folder_organization_policy" "restore" { diff --git a/google-beta/services/resourcemanager/resource_google_folder_test.go b/google-beta/services/resourcemanager/resource_google_folder_test.go index e7e7f15d77..b4c9eb3dac 100644 --- a/google-beta/services/resourcemanager/resource_google_folder_test.go +++ b/google-beta/services/resourcemanager/resource_google_folder_test.go @@ -44,9 +44,10 @@ func TestAccFolder_rename(t *testing.T) { testAccCheckGoogleFolderDisplayName(&folder, newFolderDisplayName), )}, { - ResourceName: "google_folder.folder1", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_folder.folder1", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"deletion_protection"}, }, }, }) @@ -155,6 +156,7 @@ func testAccFolder_basic(folder, parent string) string { resource "google_folder" "folder1" { display_name = "%s" parent = "%s" + deletion_protection = false } `, folder, parent) } @@ -164,11 +166,13 @@ func testAccFolder_move(folder1, folder2, parent string) string { resource "google_folder" "folder1" { display_name = "%s" parent = google_folder.folder2.name + deletion_protection = false } resource "google_folder" "folder2" { display_name = "%s" parent = "%s" + deletion_protection = false } `, folder1, folder2, parent) } diff --git a/google-beta/services/resourcemanager/resource_google_project_test.go b/google-beta/services/resourcemanager/resource_google_project_test.go index eba627efef..575a0c48f6 100644 --- a/google-beta/services/resourcemanager/resource_google_project_test.go +++ b/google-beta/services/resourcemanager/resource_google_project_test.go @@ -413,6 +413,7 @@ resource "google_project" "acceptance" { resource "google_folder" "folder1" { display_name = "%s" parent = "organizations/%s" + deletion_protection = false } `, pid, pid, folderName, org) } @@ -429,6 +430,7 @@ resource "google_project" "acceptance" { resource "google_folder" "folder1" { display_name = "%s" parent = "organizations/%s" + deletion_protection = false } `, pid, pid, folderName, org) } @@ -445,6 +447,7 @@ resource "google_project" "acceptance" { resource "google_folder" "folder1" { display_name = "%s" parent = "organizations/%s" + deletion_protection = false } `, pid, pid, org, folderName, org) } diff --git a/google-beta/services/securitycenter/resource_scc_folder_custom_module_test.go b/google-beta/services/securitycenter/resource_scc_folder_custom_module_test.go index dfdf15d5d9..ebf947fcc2 100644 --- a/google-beta/services/securitycenter/resource_scc_folder_custom_module_test.go +++ b/google-beta/services/securitycenter/resource_scc_folder_custom_module_test.go @@ -72,6 +72,7 @@ func testAccSecurityCenterFolderCustomModule_sccFolderCustomModuleBasicExample(c resource "google_folder" "folder" { parent = "organizations/%{org_id}" display_name = "tf-test-folder-name%{random_suffix}" + deletion_protection = false } resource "time_sleep" "wait_1_minute" { @@ -109,6 +110,7 @@ func testAccSecurityCenterFolderCustomModule_sccFolderCustomModuleFullExample(co resource "google_folder" "folder" { parent = "organizations/%{org_id}" display_name = "tf-test-folder-name%{random_suffix}" + deletion_protection = false } resource "google_scc_folder_custom_module" "example" { @@ -151,6 +153,7 @@ func testAccSecurityCenterFolderCustomModule_sccFolderCustomModuleUpdate(context resource "google_folder" "folder" { parent = "organizations/%{org_id}" display_name = "tf-test-folder-name%{random_suffix}" + deletion_protection = false } resource "google_scc_folder_custom_module" "example" { diff --git a/google-beta/services/securitycentermanagement/resource_scc_management_folder_security_health_analytics_custom_module_test.go b/google-beta/services/securitycentermanagement/resource_scc_management_folder_security_health_analytics_custom_module_test.go index 4d4d7eab4b..499f15dd8c 100644 --- a/google-beta/services/securitycentermanagement/resource_scc_management_folder_security_health_analytics_custom_module_test.go +++ b/google-beta/services/securitycentermanagement/resource_scc_management_folder_security_health_analytics_custom_module_test.go @@ -73,6 +73,7 @@ func testAccSecurityCenterManagementFolderSecurityHealthAnalyticsCustomModule_sc resource "google_folder" "folder" { parent = "organizations/%{org_id}" display_name = "tf-test-folder-name%{random_suffix}" + deletion_protection = false } resource "time_sleep" "wait_1_minute" { @@ -111,6 +112,7 @@ func testAccSecurityCenterManagementFolderSecurityHealthAnalyticsCustomModule_sc resource "google_folder" "folder" { parent = "organizations/%{org_id}" display_name = "tf-test-folder-name%{random_suffix}" + deletion_protection = false } resource "google_scc_management_folder_security_health_analytics_custom_module" "example" { @@ -154,6 +156,7 @@ func testAccSecurityCenterManagementFolderSecurityHealthAnalyticsCustomModule_sc resource "google_folder" "folder" { parent = "organizations/%{org_id}" display_name = "tf-test-folder-name%{random_suffix}" + deletion_protection = false } resource "google_scc_management_folder_security_health_analytics_custom_module" "example" { diff --git a/website/docs/guides/version_6_upgrade.html.markdown b/website/docs/guides/version_6_upgrade.html.markdown index ed8c9749cf..7366c7c27d 100644 --- a/website/docs/guides/version_6_upgrade.html.markdown +++ b/website/docs/guides/version_6_upgrade.html.markdown @@ -227,6 +227,19 @@ resource blocks that contain both fields in a conflicting pair, and remove one o The fields that are removed from the configuration will still have Computed values, that are derived from the API. +## Resource: `google_folder` + +### Folder deletion now prevented by default with `deletion_protection` + +The field `deletion_protection` has been added with a default value of `true`. This field prevents +Terraform from destroying or recreating the Folder. In 6.0.0, existing folders will have +`deletion_protection` set to `true` during the next refresh unless otherwise set in configuration. + +**`deletion_protection` does NOT prevent deletion outside of Terraform.** + +To disable deletion protection, explicitly set this field to `false` in configuration +and then run `terraform apply` to apply the change. + ## Resource: `google_storage_bucket` ### `lifecycle_rule.condition.no_age` is now removed diff --git a/website/docs/r/cloud_asset_folder_feed.html.markdown b/website/docs/r/cloud_asset_folder_feed.html.markdown index 7f27cb88ae..51be2f2862 100644 --- a/website/docs/r/cloud_asset_folder_feed.html.markdown +++ b/website/docs/r/cloud_asset_folder_feed.html.markdown @@ -71,6 +71,7 @@ resource "google_pubsub_topic" "feed_output" { resource "google_folder" "my_folder" { display_name = "Networking" parent = "organizations/123456789" + deletion_protection = false } # Find the project number of the project whose identity will be used for sending diff --git a/website/docs/r/compute_firewall_policy_rule.html.markdown b/website/docs/r/compute_firewall_policy_rule.html.markdown index 75b0aa0ed5..ba83b035d7 100644 --- a/website/docs/r/compute_firewall_policy_rule.html.markdown +++ b/website/docs/r/compute_firewall_policy_rule.html.markdown @@ -37,6 +37,7 @@ resource "google_network_security_address_group" "basic_global_networksecurity_a resource "google_folder" "folder" { display_name = "policy" parent = "organizations/123456789" + deletion_protection = false } resource "google_compute_firewall_policy" "default" { diff --git a/website/docs/r/compute_organization_security_policy_association.html.markdown b/website/docs/r/compute_organization_security_policy_association.html.markdown index b2c358e9c4..d4c50e4c09 100644 --- a/website/docs/r/compute_organization_security_policy_association.html.markdown +++ b/website/docs/r/compute_organization_security_policy_association.html.markdown @@ -38,6 +38,7 @@ resource "google_folder" "security_policy_target" { provider = google-beta display_name = "tf-test-secpol-%{random_suffix}" parent = "organizations/123456789" + deletion_protection = false } resource "google_compute_organization_security_policy" "policy" { diff --git a/website/docs/r/folder_access_approval_settings.html.markdown b/website/docs/r/folder_access_approval_settings.html.markdown index 53f0bbcb81..413512cf35 100644 --- a/website/docs/r/folder_access_approval_settings.html.markdown +++ b/website/docs/r/folder_access_approval_settings.html.markdown @@ -33,6 +33,7 @@ To get more information about FolderSettings, see: resource "google_folder" "my_folder" { display_name = "my-folder" parent = "organizations/123456789" + deletion_protection = false } resource "google_folder_access_approval_settings" "folder_access_approval" { @@ -51,6 +52,7 @@ resource "google_folder_access_approval_settings" "folder_access_approval" { resource "google_folder" "my_folder" { display_name = "my-folder" parent = "organizations/123456789" + deletion_protection = false } resource "google_project" "my_project" { diff --git a/website/docs/r/kms_autokey_config.html.markdown b/website/docs/r/kms_autokey_config.html.markdown index b23422f38d..758bb51b6f 100644 --- a/website/docs/r/kms_autokey_config.html.markdown +++ b/website/docs/r/kms_autokey_config.html.markdown @@ -46,6 +46,7 @@ resource "google_folder" "autokms_folder" { provider = google-beta display_name = "my-folder" parent = "organizations/123456789" + deletion_protection = false } # Create the key project diff --git a/website/docs/r/kms_key_handle.html.markdown b/website/docs/r/kms_key_handle.html.markdown index a5b9d2ce2e..b8e82a84c6 100644 --- a/website/docs/r/kms_key_handle.html.markdown +++ b/website/docs/r/kms_key_handle.html.markdown @@ -44,6 +44,7 @@ resource "google_folder" "autokms_folder" { provider = google-beta display_name = "folder-example" parent = "organizations/123456789" + deletion_protection = false } # Create the key project diff --git a/website/docs/r/logging_folder_settings.html.markdown b/website/docs/r/logging_folder_settings.html.markdown index 691a12aae7..10c276c108 100644 --- a/website/docs/r/logging_folder_settings.html.markdown +++ b/website/docs/r/logging_folder_settings.html.markdown @@ -43,6 +43,7 @@ resource "google_logging_folder_settings" "example" { resource "google_folder" "my_folder" { display_name = "folder-name" parent = "organizations/123456789" + deletion_protection = false } data "google_logging_folder_settings" "settings" { diff --git a/website/docs/r/org_policy_policy.html.markdown b/website/docs/r/org_policy_policy.html.markdown index fc2e134728..4e59fe498a 100644 --- a/website/docs/r/org_policy_policy.html.markdown +++ b/website/docs/r/org_policy_policy.html.markdown @@ -70,6 +70,7 @@ resource "google_org_policy_policy" "primary" { resource "google_folder" "basic" { parent = "organizations/123456789" display_name = "folder" + deletion_protection = false } ``` ## Example Usage - Org Policy Policy Organization diff --git a/website/docs/r/scc_folder_custom_module.html.markdown b/website/docs/r/scc_folder_custom_module.html.markdown index 0bed3d390f..f4d9ff81a9 100644 --- a/website/docs/r/scc_folder_custom_module.html.markdown +++ b/website/docs/r/scc_folder_custom_module.html.markdown @@ -40,6 +40,7 @@ To get more information about FolderCustomModule, see: resource "google_folder" "folder" { parent = "organizations/123456789" display_name = "folder-name" + deletion_protection = false } resource "google_scc_folder_custom_module" "example" { @@ -68,6 +69,7 @@ resource "google_scc_folder_custom_module" "example" { resource "google_folder" "folder" { parent = "organizations/123456789" display_name = "folder-name" + deletion_protection = false } resource "google_scc_folder_custom_module" "example" { diff --git a/website/docs/r/scc_management_folder_security_health_analytics_custom_module.html.markdown b/website/docs/r/scc_management_folder_security_health_analytics_custom_module.html.markdown index 1c82387748..eafc9d2123 100644 --- a/website/docs/r/scc_management_folder_security_health_analytics_custom_module.html.markdown +++ b/website/docs/r/scc_management_folder_security_health_analytics_custom_module.html.markdown @@ -40,6 +40,7 @@ To get more information about FolderSecurityHealthAnalyticsCustomModule, see: resource "google_folder" "folder" { parent = "organizations/123456789" display_name = "folder-name" + deletion_protection = false } resource "google_scc_management_folder_security_health_analytics_custom_module" "example" { @@ -69,6 +70,7 @@ resource "google_scc_management_folder_security_health_analytics_custom_module" resource "google_folder" "folder" { parent = "organizations/123456789" display_name = "folder-name" + deletion_protection = false } resource "google_scc_management_folder_security_health_analytics_custom_module" "example" {