diff --git a/.ci/gcb-generate-diffs-new.yml b/.ci/gcb-generate-diffs-new.yml index b97ae0daf867..feaff16211ae 100644 --- a/.ci/gcb-generate-diffs-new.yml +++ b/.ci/gcb-generate-diffs-new.yml @@ -293,7 +293,7 @@ steps: - COMMIT_SHA=$COMMIT_SHA # Long timeout to enable waiting on VCR test -timeout: 20000s +timeout: 64800s options: machineType: 'N1_HIGHCPU_32' diff --git a/docs/content/develop/breaking-changes/breaking-changes.md b/docs/content/develop/breaking-changes/breaking-changes.md index 04287872b83e..a84e644f72dc 100644 --- a/docs/content/develop/breaking-changes/breaking-changes.md +++ b/docs/content/develop/breaking-changes/breaking-changes.md @@ -84,9 +84,6 @@ For more information, see * Removing diff suppression from a field. * For MMv1 resources, removing `diff_suppress_func` from a field. * For handwritten resources, removing `DiffSuppressFunc` from a field. -* Adding a subfield to - a SchemaConfigModeAttr field. - * Subfields of SchemaConfigModeAttr fields are treated as required even if the schema says they are optional. * Removing update support from a field. ### Making validation more strict diff --git a/mmv1/api/resource.rb b/mmv1/api/resource.rb index 98d2b0fe775a..9cbc3215db20 100644 --- a/mmv1/api/resource.rb +++ b/mmv1/api/resource.rb @@ -250,6 +250,9 @@ module Properties # Add a deprecation message for a resource that's been deprecated in the API. attr_reader :deprecation_message + + # Do not apply the default attribution label + attr_reader :skip_attribution_label end include Properties @@ -342,6 +345,7 @@ def validate check :taint_resource_on_failed_create, type: :boolean, default: false check :skip_sweeper, type: :boolean, default: false check :deprecation_message, type: ::String + check :skip_attribution_label, type: :boolean, default: false validate_identity unless @identity.nil? end @@ -475,7 +479,11 @@ def add_labels_related_fields(props, parent) def add_labels_fields(props, parent, labels) @custom_diff ||= [] if parent.nil? || parent.flatten_object - @custom_diff.append('tpgresource.SetLabelsDiff') + if @skip_attribution_label + @custom_diff.append('tpgresource.SetLabelsDiffWithoutAttributionLabel') + else + @custom_diff.append('tpgresource.SetLabelsDiff') + end elsif parent.name == 'metadata' @custom_diff.append('tpgresource.SetMetadataLabelsDiff') end diff --git a/mmv1/api/type.rb b/mmv1/api/type.rb index 9e78817fcabc..b437df53df81 100644 --- a/mmv1/api/type.rb +++ b/mmv1/api/type.rb @@ -762,12 +762,6 @@ def validate # The "labels" field has type Array, so skip this resource !(product_name == 'DeploymentManager' && resource_name == 'Deployment') && - # https://github.com/hashicorp/terraform-provider-google/issues/16219 - !(product_name == 'Edgenetwork' && resource_name == 'Network') && - - # https://github.com/hashicorp/terraform-provider-google/issues/16219 - !(product_name == 'Edgenetwork' && resource_name == 'Subnet') && - # "userLabels" is the resource labels field !(product_name == 'Monitoring' && resource_name == 'NotificationChannel') && diff --git a/mmv1/products/activedirectory/Domain.yaml b/mmv1/products/activedirectory/Domain.yaml index b9aaf2e7f287..7f8122c9db2c 100644 --- a/mmv1/products/activedirectory/Domain.yaml +++ b/mmv1/products/activedirectory/Domain.yaml @@ -51,8 +51,20 @@ async: !ruby/object:Api::OpAsync id_format: '{{name}}' import_format: ['{{name}}'] autogen_async: true +virtual_fields: + - !ruby/object:Api::Type::Boolean + name: 'deletion_protection' + default_value: true + description: | + Whether Terraform will be prevented from destroying the domain. Defaults to true. + When a`terraform destroy` or `terraform apply` would delete the domain, + the command will fail if this field is not set to false in Terraform state. + When the field is set to true or unset in Terraform state, a `terraform apply` + or `terraform destroy` that would delete the domain will fail. + When the field is set to false, deleting the domain is allowed. custom_code: !ruby/object:Provider::Terraform::CustomCode custom_import: templates/terraform/custom_import/self_link_as_name.erb + pre_delete: 'templates/terraform/pre_delete/active_directory_domain.go.erb' error_abort_predicates: ['transport_tpg.Is429QuotaError'] examples: - !ruby/object:Provider::Terraform::Examples @@ -67,6 +79,8 @@ examples: tfgen # skip the test until Active Directory setup issue got resolved skip_test: true + ignore_read_extra: + - 'deletion_protection' parameters: - !ruby/object:Api::Type::String name: domainName diff --git a/mmv1/products/activedirectory/go_Domain.yaml b/mmv1/products/activedirectory/go_Domain.yaml index 6b385c90e0ad..07a88e9437f3 100644 --- a/mmv1/products/activedirectory/go_Domain.yaml +++ b/mmv1/products/activedirectory/go_Domain.yaml @@ -51,8 +51,20 @@ async: error: path: 'error' message: 'message' +virtual_fields: + - !ruby/object:Api::Type::Boolean + name: 'deletion_protection' + default_value: true + description: | + Whether Terraform will be prevented from destroying the domain. Defaults to true. + When a`terraform destroy` or `terraform apply` would delete the domain, + the command will fail if this field is not set to false in Terraform state. + When the field is set to true or unset in Terraform state, a `terraform apply` + or `terraform destroy` that would delete the domain will fail. + When the field is set to false, deleting the domain is allowed. custom_code: custom_import: 'templates/terraform/custom_import/go/self_link_as_name.tmpl' + pre_delete: 'templates/terraform/pre_delete/go/active_directory_domain.tmpl' error_abort_predicates: - 'transport_tpg.Is429QuotaError' @@ -63,6 +75,8 @@ examples: name: 'myorg' domain_name: 'tfgen' skip_test: true + ignore_read_extra: + - 'deletion_protection' parameters: - name: 'domainName' type: String diff --git a/mmv1/products/alloydb/Cluster.yaml b/mmv1/products/alloydb/Cluster.yaml index ea2fcce5a130..c99f748991f1 100644 --- a/mmv1/products/alloydb/Cluster.yaml +++ b/mmv1/products/alloydb/Cluster.yaml @@ -221,20 +221,6 @@ properties: description: | Output only. Cloud KMS key versions that are being used to protect the database or the backup. output: true - - !ruby/object:Api::Type::String - name: 'network' - exactly_one_of: - - network - - network_config.0.network - - psc_config.0.psc_enabled - default_from_api: true - deprecation_message: >- - `network` is deprecated and will be removed in a future major release. Instead, use `network_config` to define the network configuration. - description: | - The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: - - "projects/{projectNumber}/global/networks/{network_id}". - diff_suppress_func: 'tpgresource.ProjectNumberDiffSuppress' - !ruby/object:Api::Type::NestedObject name: 'networkConfig' description: | @@ -244,7 +230,6 @@ properties: - !ruby/object:Api::Type::String name: network exactly_one_of: - - network - network_config.0.network - psc_config.0.psc_enabled description: | diff --git a/mmv1/products/bigquery/Table.yaml b/mmv1/products/bigquery/Table.yaml index 1c49dd3ae2e3..7d12731522eb 100644 --- a/mmv1/products/bigquery/Table.yaml +++ b/mmv1/products/bigquery/Table.yaml @@ -42,16 +42,6 @@ examples: vars: dataset_id: 'dataset_id' table_id: 'table_id' -virtual_fields: - - !ruby/object:Api::Type::Boolean - name: 'allow_resource_tags_on_deletion' - description: | - If set to true, it allows table deletion when there are still resource tags attached. - deprecation_message: | - `allow_resource_tags_on_deletion` is deprecated and will be removed in a future major - release. The default behavior will be allowing the presence of resource tags on - deletion after the next major release. - default_value: false parameters: # TODO(alexstephen): Remove once we have support for placing # nested object fields in URL diff --git a/mmv1/products/bigqueryreservation/Reservation.yaml b/mmv1/products/bigqueryreservation/Reservation.yaml index 5bf8986eee48..f2630b41cca6 100644 --- a/mmv1/products/bigqueryreservation/Reservation.yaml +++ b/mmv1/products/bigqueryreservation/Reservation.yaml @@ -65,12 +65,6 @@ properties: default_value: 0 description: | Maximum number of queries that are allowed to run concurrently in this reservation. This is a soft limit due to asynchronous nature of the system and various optimizations for small queries. Default value is 0 which means that concurrency will be automatically set based on the reservation size. - - !ruby/object:Api::Type::Boolean - name: 'multiRegionAuxiliary' - description: | - Applicable only for reservations located within one of the BigQuery multi-regions (US or EU). - If set to true, this reservation is placed in the organization's secondary region which is designated for disaster recovery purposes. If false, this reservation is placed in the organization's default region. - deprecation_message: "`multi_region_auxiliary` is deprecated and will be removed in a future major release. This field is no longer supported by the BigQuery Reservation API." - !ruby/object:Api::Type::String name: 'edition' immutable: true diff --git a/mmv1/products/billing/ProjectInfo.yaml b/mmv1/products/billing/ProjectInfo.yaml index e941f6aaaee7..29ab22ea60cb 100644 --- a/mmv1/products/billing/ProjectInfo.yaml +++ b/mmv1/products/billing/ProjectInfo.yaml @@ -22,7 +22,7 @@ references: !ruby/object:Api::Resource::ReferenceLinks guides: 'Enable, disable, or change billing for a project': 'https://cloud.google.com/billing/docs/how-to/modify-project' api: 'https://cloud.google.com/billing/docs/reference/rest/v1/projects' -id_format: 'projects/{{project}}/billingInfo' +id_format: 'projects/{{project}}' custom_code: !ruby/object:Provider::Terraform::CustomCode decoder: templates/terraform/decoders/billing_project_info.go.erb encoder: templates/terraform/encoders/billing_project_info.go.erb diff --git a/mmv1/products/cloudrunv2/Job.yaml b/mmv1/products/cloudrunv2/Job.yaml index 1a2c750107ca..6a18f36ab0f3 100644 --- a/mmv1/products/cloudrunv2/Job.yaml +++ b/mmv1/products/cloudrunv2/Job.yaml @@ -50,6 +50,19 @@ iam_policy: !ruby/object:Api::Resource::IamPolicy id_format: 'projects/{{project}}/locations/{{location}}/jobs/{{name}}' import_format: ['projects/{{project}}/locations/{{location}}/jobs/{{name}}'] autogen_async: true +virtual_fields: + - !ruby/object:Api::Type::Boolean + name: 'deletion_protection' + default_value: true + description: | + Whether Terraform will be prevented from destroying the job. Defaults to true. + When a`terraform destroy` or `terraform apply` would delete the job, + the command will fail if this field is not set to false in Terraform state. + When the field is set to true or unset in Terraform state, a `terraform apply` + or `terraform destroy` that would delete the job will fail. + When the field is set to false, deleting the job is allowed. +custom_code: !ruby/object:Provider::Terraform::CustomCode + pre_delete: 'templates/terraform/pre_delete/cloudrunv2_job_deletion_policy.go.erb' examples: - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_job_basic' @@ -59,11 +72,15 @@ examples: ])" vars: cloud_run_job_name: 'cloudrun-job' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_job_limits' primary_resource_id: 'default' vars: cloud_run_job_name: 'cloudrun-job' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_job_sql' primary_resource_id: 'default' @@ -79,6 +96,8 @@ examples: deletion_protection: 'false' oics_vars_overrides: deletion_protection: 'false' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_job_vpcaccess' primary_resource_id: 'default' @@ -90,6 +109,8 @@ examples: vpc_access_connector_name: 'run-vpc' vpc_compute_subnetwork_name: 'run-subnetwork' compute_network_name: 'run-network' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_job_directvpc' primary_resource_id: 'default' @@ -97,6 +118,8 @@ examples: ])" vars: cloud_run_job_name: 'cloudrun-job' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_job_secret' primary_resource_id: 'default' @@ -106,6 +129,8 @@ examples: vars: cloud_run_job_name: 'cloudrun-job' secret_id: 'secret' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_job_emptydir' min_version: 'beta' @@ -114,6 +139,8 @@ examples: ])" vars: cloud_run_job_name: 'cloudrun-job' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_job_run_job' min_version: beta @@ -122,6 +149,8 @@ examples: ])" vars: cloud_run_job_name: 'cloudrun-job' + ignore_read_extra: + - 'deletion_protection' parameters: - !ruby/object:Api::Type::String name: 'location' @@ -328,6 +357,7 @@ properties: name: 'env' description: |- List of environment variables to set in the container. + is_set: true item_type: !ruby/object:Api::Type::NestedObject properties: - !ruby/object:Api::Type::String diff --git a/mmv1/products/cloudrunv2/Service.yaml b/mmv1/products/cloudrunv2/Service.yaml index c26f2b7d2f98..03234194916a 100644 --- a/mmv1/products/cloudrunv2/Service.yaml +++ b/mmv1/products/cloudrunv2/Service.yaml @@ -49,6 +49,19 @@ async: !ruby/object:Api::OpAsync id_format: 'projects/{{project}}/locations/{{location}}/services/{{name}}' import_format: ['projects/{{project}}/locations/{{location}}/services/{{name}}'] autogen_async: true +virtual_fields: + - !ruby/object:Api::Type::Boolean + name: 'deletion_protection' + default_value: true + description: | + Whether Terraform will be prevented from destroying the service. Defaults to true. + When a`terraform destroy` or `terraform apply` would delete the service, + the command will fail if this field is not set to false in Terraform state. + When the field is set to true or unset in Terraform state, a `terraform apply` + or `terraform destroy` that would delete the service will fail. + When the field is set to false, deleting the service is allowed. +custom_code: !ruby/object:Provider::Terraform::CustomCode + pre_delete: 'templates/terraform/pre_delete/cloudrunv2_service_deletion_policy.go.erb' examples: - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_service_basic' @@ -56,11 +69,15 @@ examples: primary_resource_name: "fmt.Sprintf(\"tf-test-cloudrun-service%s\", context[\"random_suffix\"])" vars: cloud_run_service_name: 'cloudrun-service' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_service_limits' primary_resource_id: 'default' vars: cloud_run_service_name: 'cloudrun-service' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_service_sql' primary_resource_id: 'default' @@ -74,6 +91,8 @@ examples: deletion_protection: 'false' oics_vars_overrides: deletion_protection: 'false' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_service_vpcaccess' primary_resource_id: 'default' @@ -83,18 +102,24 @@ examples: vpc_access_connector_name: 'run-vpc' vpc_compute_subnetwork_name: 'run-subnetwork' compute_network_name: 'run-network' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_service_directvpc' primary_resource_id: 'default' primary_resource_name: "fmt.Sprintf(\"tf-test-cloudrun-srv%s\", context[\"random_suffix\"])" vars: cloud_run_service_name: 'cloudrun-service' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_service_probes' primary_resource_id: 'default' primary_resource_name: "fmt.Sprintf(\"tf-test-cloudrun-srv%s\", context[\"random_suffix\"])" vars: cloud_run_service_name: 'cloudrun-service' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_service_secret' primary_resource_id: 'default' @@ -102,6 +127,8 @@ examples: vars: cloud_run_service_name: 'cloudrun-service' secret_id: 'secret-1' + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_service_multicontainer' min_version: 'beta' @@ -110,20 +137,28 @@ examples: random_suffix\"])" vars: cloud_run_service_name: 'cloudrun-service' - + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_service_mount_gcs' + # Currently failing + skip_vcr: true primary_resource_id: 'default' primary_resource_name: "fmt.Sprintf(\"tf-test-cloudrun-service-%s\", context[\"random_suffix\"])" vars: cloud_run_service_name: 'cloudrun-service' - + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'cloudrunv2_service_mount_nfs' + # Currently failing + skip_vcr: true primary_resource_id: 'default' primary_resource_name: "fmt.Sprintf(\"tf-test-cloudrun-service-%s\", context[\"random_suffix\"])" vars: cloud_run_service_name: 'cloudrun-service' + ignore_read_extra: + - 'deletion_protection' parameters: - !ruby/object:Api::Type::String @@ -405,6 +440,7 @@ properties: name: 'env' description: |- List of environment variables to set in the container. + is_set: true item_type: !ruby/object:Api::Type::NestedObject properties: - !ruby/object:Api::Type::String @@ -504,7 +540,6 @@ properties: name: 'livenessProbe' description: |- Periodic probe of container liveness. Container will be restarted if the probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - default_from_api: true properties: - !ruby/object:Api::Type::Integer name: 'initialDelaySeconds' diff --git a/mmv1/products/compute/BackendService.yaml b/mmv1/products/compute/BackendService.yaml index 3ebd8ad56f7f..c1084ed96ddb 100644 --- a/mmv1/products/compute/BackendService.yaml +++ b/mmv1/products/compute/BackendService.yaml @@ -165,8 +165,6 @@ properties: See the [Backend Services Overview](https://cloud.google.com/load-balancing/docs/backend-service#balancing-mode) for an explanation of load balancing modes. - - From version 6.0.0 default value will be UTILIZATION to match default GCP value. - !ruby/object:Api::Type::Double name: 'capacityScaler' send_empty_value: true @@ -747,14 +745,16 @@ properties: description: Settings for enabling Cloud Identity Aware Proxy send_empty_value: true properties: + - !ruby/object:Api::Type::Boolean + name: 'enabled' + required: true + description: Whether the serving infrastructure will authenticate and authorize all incoming requests. - !ruby/object:Api::Type::String name: 'oauth2ClientId' - required: true description: | OAuth2 Client ID for IAP - !ruby/object:Api::Type::String name: 'oauth2ClientSecret' - required: true description: | OAuth2 Client Secret for IAP send_empty_value: true @@ -964,9 +964,6 @@ properties: Settings controlling eviction of unhealthy hosts from the load balancing pool. Applicable backend service types can be a global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - - From version 6.0.0 outlierDetection default terraform values will be removed to match default GCP value. - Default values are enforce by GCP without providing them. properties: - !ruby/object:Api::Type::NestedObject name: 'baseEjectionTime' @@ -1013,7 +1010,6 @@ properties: - outlier_detection.0.success_rate_minimum_hosts - outlier_detection.0.success_rate_request_volume - outlier_detection.0.success_rate_stdev_factor - default_value: 5 description: | Number of errors before a host is ejected from the connection pool. When the backend host is accessed over HTTP, a 5xx return code qualifies as an error. @@ -1032,7 +1028,6 @@ properties: - outlier_detection.0.success_rate_minimum_hosts - outlier_detection.0.success_rate_request_volume - outlier_detection.0.success_rate_stdev_factor - default_value: 5 description: | The number of consecutive gateway failures (502, 503, 504 status or connection errors that are mapped to one of those status codes) before a consecutive @@ -1051,7 +1046,6 @@ properties: - outlier_detection.0.success_rate_minimum_hosts - outlier_detection.0.success_rate_request_volume - outlier_detection.0.success_rate_stdev_factor - default_value: 100 description: | The percentage chance that a host will be actually ejected when an outlier status is detected through consecutive 5xx. This setting can be used to disable @@ -1070,7 +1064,6 @@ properties: - outlier_detection.0.success_rate_minimum_hosts - outlier_detection.0.success_rate_request_volume - outlier_detection.0.success_rate_stdev_factor - default_value: 0 description: | The percentage chance that a host will be actually ejected when an outlier status is detected through consecutive gateway failures. This setting can be @@ -1089,7 +1082,6 @@ properties: - outlier_detection.0.success_rate_minimum_hosts - outlier_detection.0.success_rate_request_volume - outlier_detection.0.success_rate_stdev_factor - default_value: 100 description: | The percentage chance that a host will be actually ejected when an outlier status is detected through success rate statistics. This setting can be used to @@ -1138,7 +1130,6 @@ properties: - outlier_detection.0.success_rate_minimum_hosts - outlier_detection.0.success_rate_request_volume - outlier_detection.0.success_rate_stdev_factor - default_value: 10 description: | Maximum percentage of hosts in the load balancing pool for the backend service that can be ejected. Defaults to 10%. @@ -1156,7 +1147,6 @@ properties: - outlier_detection.0.success_rate_minimum_hosts - outlier_detection.0.success_rate_request_volume - outlier_detection.0.success_rate_stdev_factor - default_value: 5 description: | The number of hosts in a cluster that must have enough request volume to detect success rate outliers. If the number of hosts is less than this setting, outlier @@ -1176,7 +1166,6 @@ properties: - outlier_detection.0.success_rate_minimum_hosts - outlier_detection.0.success_rate_request_volume - outlier_detection.0.success_rate_stdev_factor - default_value: 100 description: | The minimum number of total requests that must be collected in one interval (as defined by the interval duration above) to include this host in success rate @@ -1197,7 +1186,6 @@ properties: - outlier_detection.0.success_rate_minimum_hosts - outlier_detection.0.success_rate_request_volume - outlier_detection.0.success_rate_stdev_factor - default_value: 1900 description: | This factor is used to determine the ejection threshold for success rate outlier ejection. The ejection threshold is the difference between the mean success diff --git a/mmv1/products/compute/ForwardingRule.yaml b/mmv1/products/compute/ForwardingRule.yaml index 17bc68d54281..798d15d68a6f 100644 --- a/mmv1/products/compute/ForwardingRule.yaml +++ b/mmv1/products/compute/ForwardingRule.yaml @@ -17,6 +17,8 @@ kind: 'compute#forwardingRule' base_url: projects/{{project}}/regions/{{region}}/forwardingRules collection_url_key: 'items' has_self_link: true +# Has a separate endpoint for labels +skip_attribution_label: true description: | A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given diff --git a/mmv1/products/compute/GlobalForwardingRule.yaml b/mmv1/products/compute/GlobalForwardingRule.yaml index 439777281782..d39c85bf8da5 100644 --- a/mmv1/products/compute/GlobalForwardingRule.yaml +++ b/mmv1/products/compute/GlobalForwardingRule.yaml @@ -17,6 +17,8 @@ kind: 'compute#forwardingRule' base_url: projects/{{project}}/global/forwardingRules immutable: true has_self_link: true +# Has a separate endpoint for labels +skip_attribution_label: true legacy_long_form_project: true collection_url_key: 'items' description: | diff --git a/mmv1/products/compute/ManagedSslCertificate.yaml b/mmv1/products/compute/ManagedSslCertificate.yaml index 153d227b85b0..517e59977122 100644 --- a/mmv1/products/compute/ManagedSslCertificate.yaml +++ b/mmv1/products/compute/ManagedSslCertificate.yaml @@ -107,7 +107,6 @@ properties: api_name: 'id' description: 'The unique identifier for the resource.' output: true - default_from_api: true - !ruby/object:Api::Type::String name: 'name' description: | diff --git a/mmv1/products/compute/NetworkEndpoints.yaml b/mmv1/products/compute/NetworkEndpoints.yaml index d76e29a4343d..0c3f4a2bbc6d 100644 --- a/mmv1/products/compute/NetworkEndpoints.yaml +++ b/mmv1/products/compute/NetworkEndpoints.yaml @@ -60,7 +60,7 @@ async: !ruby/object:Api::OpAsync error: !ruby/object:Api::OpAsync::Error path: 'error/errors' message: 'message' -id_format: '{{project}}/{{zone}}/{{network_endpoint_group}}/endpoints' +id_format: '{{project}}/{{zone}}/{{network_endpoint_group}}' import_format: - 'projects/{{project}}/zones/{{zone}}/networkEndpointGroups/{{network_endpoint_group}}' mutex: networkEndpoint/{{project}}/{{zone}}/{{network_endpoint_group}} diff --git a/mmv1/products/compute/NetworkPeeringRoutesConfig.yaml b/mmv1/products/compute/NetworkPeeringRoutesConfig.yaml index af7abcb88ef1..8d63e5adbe86 100644 --- a/mmv1/products/compute/NetworkPeeringRoutesConfig.yaml +++ b/mmv1/products/compute/NetworkPeeringRoutesConfig.yaml @@ -69,6 +69,8 @@ examples: network_secondary_name: 'secondary-network' - !ruby/object:Provider::Terraform::Examples name: 'network_peering_routes_config_gke' + # currently failing + skip_vcr: true primary_resource_id: 'peering_gke_routes' vars: network_name: 'container-network' diff --git a/mmv1/products/compute/RegionBackendService.yaml b/mmv1/products/compute/RegionBackendService.yaml index 70190456cb15..c6aba190b38c 100644 --- a/mmv1/products/compute/RegionBackendService.yaml +++ b/mmv1/products/compute/RegionBackendService.yaml @@ -154,7 +154,7 @@ properties: properties: - !ruby/object:Api::Type::Enum name: 'balancingMode' - default_value: :CONNECTION + default_value: :UTILIZATION values: - :UTILIZATION - :RATE @@ -164,8 +164,6 @@ properties: See the [Backend Services Overview](https://cloud.google.com/load-balancing/docs/backend-service#balancing-mode) for an explanation of load balancing modes. - - From version 6.0.0 default value will be UTILIZATION to match default GCP value. - !ruby/object:Api::Type::Double name: 'capacityScaler' description: | @@ -655,13 +653,11 @@ properties: - !ruby/object:Api::Type::Integer name: 'connection_draining_timeout_sec' api_name: drainingTimeoutSec - default_value: 0 + default_value: 300 send_empty_value: true description: | Time for which instance will be drained (not accept new connections, but still work to finish started). - - From version 6.0.0 ConnectionDrainingTimeoutSec default value will be 300 to match default GCP value. - !ruby/object:Api::Type::Time name: 'creationTimestamp' description: | @@ -758,14 +754,16 @@ properties: description: Settings for enabling Cloud Identity Aware Proxy send_empty_value: true properties: + - !ruby/object:Api::Type::Boolean + name: 'enabled' + required: true + description: Whether the serving infrastructure will authenticate and authorize all incoming requests. - !ruby/object:Api::Type::String name: 'oauth2ClientId' - required: true description: | OAuth2 Client ID for IAP - !ruby/object:Api::Type::String name: 'oauth2ClientSecret' - required: true description: | OAuth2 Client Secret for IAP send_empty_value: true @@ -875,9 +873,6 @@ properties: Settings controlling eviction of unhealthy hosts from the load balancing pool. This field is applicable only when the `load_balancing_scheme` is set to INTERNAL_MANAGED and the `protocol` is set to HTTP, HTTPS, or HTTP2. - - From version 6.0.0 outlierDetection default terraform values will be removed to match default GCP value. - Default values are enforce by GCP without providing them. properties: - !ruby/object:Api::Type::NestedObject name: 'baseEjectionTime' @@ -912,7 +907,6 @@ properties: `nanos` field. Must be from 0 to 999,999,999 inclusive. - !ruby/object:Api::Type::Integer name: 'consecutiveErrors' - default_value: 5 at_least_one_of: - outlier_detection.0.base_ejection_time - outlier_detection.0.consecutive_errors @@ -931,7 +925,6 @@ properties: Defaults to 5. - !ruby/object:Api::Type::Integer name: 'consecutiveGatewayFailure' - default_value: 5 at_least_one_of: - outlier_detection.0.base_ejection_time - outlier_detection.0.consecutive_errors @@ -950,7 +943,6 @@ properties: gateway failure ejection occurs. Defaults to 5. - !ruby/object:Api::Type::Integer name: 'enforcingConsecutiveErrors' - default_value: 100 at_least_one_of: - outlier_detection.0.base_ejection_time - outlier_detection.0.consecutive_errors @@ -969,7 +961,6 @@ properties: ejection or to ramp it up slowly. Defaults to 100. - !ruby/object:Api::Type::Integer name: 'enforcingConsecutiveGatewayFailure' - default_value: 0 at_least_one_of: - outlier_detection.0.base_ejection_time - outlier_detection.0.consecutive_errors @@ -988,7 +979,6 @@ properties: used to disable ejection or to ramp it up slowly. Defaults to 0. - !ruby/object:Api::Type::Integer name: 'enforcingSuccessRate' - default_value: 100 at_least_one_of: - outlier_detection.0.base_ejection_time - outlier_detection.0.consecutive_errors @@ -1037,7 +1027,6 @@ properties: `nanos` field. Must be from 0 to 999,999,999 inclusive. - !ruby/object:Api::Type::Integer name: 'maxEjectionPercent' - default_value: 10 at_least_one_of: - outlier_detection.0.base_ejection_time - outlier_detection.0.consecutive_errors @@ -1055,7 +1044,6 @@ properties: that can be ejected. Defaults to 10%. - !ruby/object:Api::Type::Integer name: 'successRateMinimumHosts' - default_value: 5 at_least_one_of: - outlier_detection.0.base_ejection_time - outlier_detection.0.consecutive_errors @@ -1075,7 +1063,6 @@ properties: cluster. Defaults to 5. - !ruby/object:Api::Type::Integer name: 'successRateRequestVolume' - default_value: 100 at_least_one_of: - outlier_detection.0.base_ejection_time - outlier_detection.0.consecutive_errors @@ -1096,7 +1083,6 @@ properties: to 100. - !ruby/object:Api::Type::Integer name: 'successRateStdevFactor' - default_value: 1900 at_least_one_of: - outlier_detection.0.base_ejection_time - outlier_detection.0.consecutive_errors diff --git a/mmv1/products/compute/RegionSslCertificate.yaml b/mmv1/products/compute/RegionSslCertificate.yaml index b923a59c3ec6..b579e26097b6 100644 --- a/mmv1/products/compute/RegionSslCertificate.yaml +++ b/mmv1/products/compute/RegionSslCertificate.yaml @@ -47,7 +47,13 @@ async: !ruby/object:Api::OpAsync docs: !ruby/object:Provider::Terraform::Docs optional_properties: | * `name_prefix` - (Optional) Creates a unique name beginning with the - specified prefix. Conflicts with `name`. + specified prefix. Conflicts with `name`. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + Resulting name for a `name_prefix` <= 37 characters: + `name_prefix` + YYYYmmddHHSSssss + 8 digit incremental counter + Resulting name for a `name_prefix` 38 - 54 characters: + `name_prefix` + YYmmdd + 3 digit incremental counter examples: - !ruby/object:Provider::Terraform::Examples name: 'region_ssl_certificate_basic' diff --git a/mmv1/products/compute/SslCertificate.yaml b/mmv1/products/compute/SslCertificate.yaml index f86fb7bf6043..8ac659eea06e 100644 --- a/mmv1/products/compute/SslCertificate.yaml +++ b/mmv1/products/compute/SslCertificate.yaml @@ -47,7 +47,13 @@ async: !ruby/object:Api::OpAsync docs: !ruby/object:Provider::Terraform::Docs optional_properties: | * `name_prefix` - (Optional) Creates a unique name beginning with the - specified prefix. Conflicts with `name`. + specified prefix. Conflicts with `name`. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + Resulting name for a `name_prefix` <= 37 characters: + `name_prefix` + YYYYmmddHHSSssss + 8 digit incremental counter + Resulting name for a `name_prefix` 38 - 54 characters: + `name_prefix` + YYmmdd + 3 digit incremental counter examples: - !ruby/object:Provider::Terraform::Examples name: 'ssl_certificate_basic' diff --git a/mmv1/products/compute/Subnetwork.yaml b/mmv1/products/compute/Subnetwork.yaml index c22da255a896..672dca4bcd14 100644 --- a/mmv1/products/compute/Subnetwork.yaml +++ b/mmv1/products/compute/Subnetwork.yaml @@ -125,6 +125,20 @@ examples: vars: subnetwork_name: 'subnet-cidr-overlap' network_name: 'net-cidr-overlap' + - !ruby/object:Provider::Terraform::Examples + name: 'subnetwork_reserved_internal_range' + min_version: beta + primary_resource_id: 'subnetwork-reserved-internal-range' + vars: + subnetwork_name: 'subnetwork-reserved-internal-range' + network_name: 'network-reserved-internal-range' + - !ruby/object:Provider::Terraform::Examples + name: 'subnetwork_reserved_secondary_range' + min_version: beta + primary_resource_id: 'subnetwork-reserved-secondary-range' + vars: + subnetwork_name: 'subnetwork-reserved-secondary-range' + network_name: 'network-reserved-secondary-range' virtual_fields: - !ruby/object:Api::Type::Boolean name: 'send_secondary_ip_range_if_empty' @@ -154,16 +168,25 @@ properties: output: true - !ruby/object:Api::Type::String name: 'ipCidrRange' + default_from_api: true description: | The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. - required: true + Field is optional when `reserved_internal_range` is defined, otherwise required. + required: false update_verb: :POST update_url: 'projects/{{project}}/regions/{{region}}/subnetworks/{{name}}/expandIpCidrRange' validation: !ruby/object:Provider::Terraform::Validation function: 'verify.ValidateIpCidrRange' + - !ruby/object:Api::Type::ResourceRef + name: 'reservedInternalRange' + description: | + The ID of the reserved internal range. Must be prefixed with `networkconnectivity.googleapis.com` + E.g. `networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}` + resource: 'InternalRange' + imports: 'selfLink' - !ruby/object:Api::Type::String name: 'name' description: | @@ -219,7 +242,6 @@ properties: api_name: secondaryIpRanges unordered_list: true default_from_api: true - schema_config_mode_attr: true send_empty_value: true description: | An array of configurations for secondary IP ranges for VM instances @@ -248,7 +270,8 @@ properties: must be unique within the subnetwork. - !ruby/object:Api::Type::String name: 'ipCidrRange' - required: true + required: false + default_from_api: true validation: !ruby/object:Provider::Terraform::Validation function: 'verify.ValidateIpCidrRange' description: | @@ -256,6 +279,14 @@ properties: range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. + Field is optional when `reserved_internal_range` is defined, otherwise required. + - !ruby/object:Api::Type::ResourceRef + name: 'reservedInternalRange' + description: | + The ID of the reserved internal range. Must be prefixed with `networkconnectivity.googleapis.com` + E.g. `networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}` + resource: 'InternalRange' + imports: 'selfLink' - !ruby/object:Api::Type::Boolean name: 'privateIpGoogleAccess' description: | diff --git a/mmv1/products/dataplex/Datascan.yaml b/mmv1/products/dataplex/Datascan.yaml index c1c71bed0dc2..eb70d4b116e4 100644 --- a/mmv1/products/dataplex/Datascan.yaml +++ b/mmv1/products/dataplex/Datascan.yaml @@ -18,6 +18,8 @@ self_link: 'projects/{{project}}/locations/{{location}}/dataScans/{{data_scan_id create_url: 'projects/{{project}}/locations/{{location}}/dataScans?dataScanId={{data_scan_id}}' update_verb: :PATCH update_mask: true +# User-provided label cannot start with goog- +skip_attribution_label: true import_format: [ 'projects/{{project}}/locations/{{location}}/dataScans/{{data_scan_id}}', diff --git a/mmv1/products/dataplex/Task.yaml b/mmv1/products/dataplex/Task.yaml index 66ed12c16dbb..ecd20a1b7be5 100644 --- a/mmv1/products/dataplex/Task.yaml +++ b/mmv1/products/dataplex/Task.yaml @@ -19,6 +19,8 @@ update_url: 'projects/{{project}}/locations/{{location}}/lakes/{{lake}}/tasks/{{ delete_url: 'projects/{{project}}/locations/{{location}}/lakes/{{lake}}/tasks/{{task_id}}' update_verb: :PATCH update_mask: true +# User-provided label cannot start with goog- +skip_attribution_label: true description: | A Dataplex task represents the work that you want Dataplex to do on a schedule. It encapsulates code, parameters, and the schedule. async: !ruby/object:Api::OpAsync diff --git a/mmv1/products/datastore/Index.yaml b/mmv1/products/datastore/Index.yaml deleted file mode 100644 index 1b21fdac10da..000000000000 --- a/mmv1/products/datastore/Index.yaml +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright 2023 Google Inc. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - ---- !ruby/object:Api::Resource -name: 'Index' -base_url: 'projects/{{project}}/indexes' -self_link: 'projects/{{project}}/indexes/{{index_id}}' -immutable: true -collection_url_key: indexes -references: !ruby/object:Api::Resource::ReferenceLinks - guides: - 'Official Documentation': 'https://cloud.google.com/datastore/docs/concepts/indexes' - api: 'https://cloud.google.com/datastore/docs/reference/admin/rest/v1/projects.indexes' -identity: - - indexId -description: | - Describes a composite index for Firestore in Datastore Mode. -id_format: 'projects/{{project}}/indexes/{{index_id}}' -error_retry_predicates: ['transport_tpg.DatastoreIndex409Contention'] -autogen_async: true -timeouts: !ruby/object:Api::Timeouts - insert_minutes: 20 - delete_minutes: 20 -deprecation_message: >- - `datastore_index` is deprecated and will be removed in a future major release. - Use `firestore_index` instead; this resource is deprecated because it only supports the (default) database. - `firestore_index` supports both Firestore in Datastore Mode and Firestore Native indexes and supports both - named and the (default) database. -docs: !ruby/object:Provider::Terraform::Docs - warning: | - `datastore_index` is deprecated and will be removed in a future major release. - Use `firestore_index` instead; this resource is deprecated because it only supports the (default) database. - This resource creates a Datastore Index on a project that has already - enabled a Datastore-compatible database. If you haven't already created it, you may - create a `google_firestore_database` resource with `location_id` set - to your chosen location, and `type` set to `"DATASTORE_MODE"`. - If you wish to use App Engine, you may instead create a `google_app_engine_application` resource with - `database_type` set to `"CLOUD_DATASTORE_COMPATIBILITY"`. - Your Datastore location will be the same as the App Engine location specified. -examples: - - !ruby/object:Provider::Terraform::Examples - name: 'datastore_index' - primary_resource_id: 'default' - test_env_vars: - project_id: :PROJECT_NAME - vars: - property_name_1: 'property_a' - property_name_2: 'property_b' -properties: - - !ruby/object:Api::Type::String - name: 'indexId' - output: true - description: | - The index id. - - !ruby/object:Api::Type::String - name: 'kind' - required: true - description: | - The entity kind which the index applies to. - - !ruby/object:Api::Type::Enum - name: 'ancestor' - default_value: :NONE - values: - - :NONE - - :ALL_ANCESTORS - description: | - Policy for including ancestors in the index. - - !ruby/object:Api::Type::Array - name: 'properties' - description: | - An ordered list of properties to index on. - min_size: 1 - item_type: !ruby/object:Api::Type::NestedObject - properties: - - !ruby/object:Api::Type::String - name: 'name' - required: true - description: | - The property name to index. - - !ruby/object:Api::Type::Enum - name: 'direction' - required: true - values: - - :ASCENDING - - :DESCENDING - description: | - The direction the index should optimize for sorting. diff --git a/mmv1/products/datastore/go_Index.yaml b/mmv1/products/datastore/go_Index.yaml deleted file mode 100644 index c4b747f7cfe7..000000000000 --- a/mmv1/products/datastore/go_Index.yaml +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright 2024 Google Inc. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Warning: This is a temporary file, and should not be edited directly ---- -name: 'Index' -description: | - Describes a composite index for Firestore in Datastore Mode. -references: - guides: - 'Official Documentation': 'https://cloud.google.com/datastore/docs/concepts/indexes' - api: 'https://cloud.google.com/datastore/docs/reference/admin/rest/v1/projects.indexes' -docs: - warning: | - `datastore_index` is deprecated and will be removed in a future major release. - Use `firestore_index` instead; this resource is deprecated because it only supports the (default) database. - This resource creates a Datastore Index on a project that has already - enabled a Datastore-compatible database. If you haven't already created it, you may - create a `google_firestore_database` resource with `location_id` set - to your chosen location, and `type` set to `"DATASTORE_MODE"`. - If you wish to use App Engine, you may instead create a `google_app_engine_application` resource with - `database_type` set to `"CLOUD_DATASTORE_COMPATIBILITY"`. - Your Datastore location will be the same as the App Engine location specified. -id_format: 'projects/{{project}}/indexes/{{index_id}}' -base_url: 'projects/{{project}}/indexes' -self_link: 'projects/{{project}}/indexes/{{index_id}}' -immutable: true -timeouts: - insert_minutes: 20 - update_minutes: 20 - delete_minutes: 20 -autogen_async: true -async: - actions: ['create', 'delete', 'update'] - type: 'OpAsync' - operation: - base_url: '{{op_id}}' - path: 'name' - wait_ms: 1000 - result: - path: 'response' - resource_inside_response: true - error: - path: 'error' - message: 'message' -collection_url_key: 'indexes' -identity: - - indexId -custom_code: -error_retry_predicates: - - - 'transport_tpg.DatastoreIndex409Contention' -deprecation_message: '`datastore_index` is deprecated and will be removed in a future major release. Use `firestore_index` instead; this resource is deprecated because it only supports the (default) database. `firestore_index` supports both Firestore in Datastore Mode and Firestore Native indexes and supports both named and the (default) database.' -examples: - - name: 'datastore_index' - primary_resource_id: 'default' - vars: - property_name_1: 'property_a' - property_name_2: 'property_b' - test_env_vars: - project_id: 'PROJECT_NAME' -parameters: -properties: - - name: 'indexId' - type: String - description: | - The index id. - output: true - - name: 'kind' - type: String - description: | - The entity kind which the index applies to. - required: true - - name: 'ancestor' - type: Enum - description: | - Policy for including ancestors in the index. - default_value: "NONE" - enum_values: - - 'NONE' - - 'ALL_ANCESTORS' - - name: 'properties' - type: Array - description: | - An ordered list of properties to index on. - item_type: - type: NestedObject - properties: - - name: 'name' - type: String - description: | - The property name to index. - required: true - - name: 'direction' - type: Enum - description: | - The direction the index should optimize for sorting. - required: true - enum_values: - - 'ASCENDING' - - 'DESCENDING' - min_size: 1 diff --git a/mmv1/products/datastore/go_product.yaml b/mmv1/products/datastore/go_product.yaml deleted file mode 100644 index 548d34378a8a..000000000000 --- a/mmv1/products/datastore/go_product.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2024 Google Inc. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Warning: This is a temporary file, and should not be edited directly ---- -name: 'Datastore' -display_name: 'Datastore' -versions: - - name: 'ga' - base_url: 'https://datastore.googleapis.com/v1/' -scopes: - - 'https://www.googleapis.com/auth/datastore' -async: - type: "OpAsync" - operation: - base_url: '{{op_id}}' - path: 'name' - wait_ms: 1000 - result: - path: 'response' - resource_inside_response: true - error: - path: 'error' - message: 'message' diff --git a/mmv1/products/datastore/product.yaml b/mmv1/products/datastore/product.yaml deleted file mode 100644 index 9326be25fa83..000000000000 --- a/mmv1/products/datastore/product.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2020 Google Inc. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - ---- !ruby/object:Api::Product -name: Datastore -versions: - - !ruby/object:Api::Product::Version - name: ga - base_url: https://datastore.googleapis.com/v1/ -scopes: - - https://www.googleapis.com/auth/datastore -async: !ruby/object:Api::OpAsync - operation: !ruby/object:Api::OpAsync::Operation - path: 'name' - base_url: '{{op_id}}' - wait_ms: 1000 - result: !ruby/object:Api::OpAsync::Result - path: 'response' - resource_inside_response: true - status: !ruby/object:Api::OpAsync::Status - path: 'done' - complete: true - allowed: - - true - - false - error: !ruby/object:Api::OpAsync::Error - path: 'error' - message: 'message' diff --git a/mmv1/products/edgecontainer/Cluster.yaml b/mmv1/products/edgecontainer/Cluster.yaml index 6c83007c351e..52ef2519de28 100644 --- a/mmv1/products/edgecontainer/Cluster.yaml +++ b/mmv1/products/edgecontainer/Cluster.yaml @@ -66,11 +66,15 @@ import_format: ["projects/{{project}}/locations/{{location}}/clusters/{{name}}"] examples: - !ruby/object:Provider::Terraform::Examples name: "edgecontainer_cluster" + # Currently failing + skip_vcr: true primary_resource_id: "default" vars: edgecontainer_cluster_name: "basic-cluster" - !ruby/object:Provider::Terraform::Examples name: "edgecontainer_cluster_with_maintenance_window" + # Currently failing + skip_vcr: true primary_resource_id: "default" vars: edgecontainer_cluster_name: "cluster-with-maintenance" diff --git a/mmv1/products/edgenetwork/Network.yaml b/mmv1/products/edgenetwork/Network.yaml index 6044713555d0..274d6e889c70 100644 --- a/mmv1/products/edgenetwork/Network.yaml +++ b/mmv1/products/edgenetwork/Network.yaml @@ -66,7 +66,7 @@ properties: description: | The canonical name of this resource, with format `projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}` - - !ruby/object:Api::Type::KeyValuePairs + - !ruby/object:Api::Type::KeyValueLabels name: 'labels' required: false description: | diff --git a/mmv1/products/edgenetwork/Subnet.yaml b/mmv1/products/edgenetwork/Subnet.yaml index 8c0a6cfe9872..1c44d074aab5 100644 --- a/mmv1/products/edgenetwork/Subnet.yaml +++ b/mmv1/products/edgenetwork/Subnet.yaml @@ -77,7 +77,7 @@ properties: description: | The canonical name of this resource, with format `projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}` - - !ruby/object:Api::Type::KeyValuePairs + - !ruby/object:Api::Type::KeyValueLabels name: 'labels' required: false description: | diff --git a/mmv1/products/firebasehosting/CustomDomain.yaml b/mmv1/products/firebasehosting/CustomDomain.yaml index 92e3a4f45429..d7e7be3d10c3 100644 --- a/mmv1/products/firebasehosting/CustomDomain.yaml +++ b/mmv1/products/firebasehosting/CustomDomain.yaml @@ -94,11 +94,17 @@ examples: site_id: site-id custom_domain: run.custom.domain.com cloud_run_service_id: cloud-run-service-via-hosting + deletion_protection: 'true' + oics_vars_overrides: + deletion_protection: 'false' test_env_vars: project_id: :PROJECT_NAME test_vars_overrides: # Don't add random suffix custom_domain: '"run.custom.domain.com"' + deletion_protection: 'false' + ignore_read_extra: + - 'deletion_protection' virtual_fields: - !ruby/object:Api::Type::Boolean name: wait_dns_verification diff --git a/mmv1/products/firebasehosting/Version.yaml b/mmv1/products/firebasehosting/Version.yaml index 2d2a80c2f876..89f7d67f228c 100644 --- a/mmv1/products/firebasehosting/Version.yaml +++ b/mmv1/products/firebasehosting/Version.yaml @@ -52,8 +52,15 @@ examples: vars: site_id: site-id cloud_run_service_id: cloud-run-service-via-hosting + deletion_protection: 'true' + test_vars_overrides: + deletion_protection: 'false' + oics_vars_overrides: + deletion_protection: 'false' test_env_vars: project_id: :PROJECT_NAME + ignore_read_extra: + - 'deletion_protection' - !ruby/object:Provider::Terraform::Examples name: 'firebasehosting_version_cloud_functions' min_version: 'beta' diff --git a/mmv1/products/identityplatform/ProjectDefaultConfig.yaml b/mmv1/products/identityplatform/ProjectDefaultConfig.yaml deleted file mode 100644 index 03873dceb91d..000000000000 --- a/mmv1/products/identityplatform/ProjectDefaultConfig.yaml +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright 2023 Google Inc. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - ---- !ruby/object:Api::Resource -name: ProjectDefaultConfig -base_url: 'projects/{{project}}/config' -self_link: 'projects/{{project}}/config' -update_verb: :PATCH -update_mask: true -description: | - There is no persistent data associated with this resource. -create_verb: :PATCH -delete_verb: :PATCH -deprecation_message: >- - `google_identity_platform_config` is deprecated and will be removed in the next major release - of the provider. Use the `google_identity_platform_config` resource instead. It contains a more - comprehensive list of fields, and was created before `google_identity_platform_project_default_config` - was added. -custom_code: !ruby/object:Provider::Terraform::CustomCode - test_check_destroy: templates/terraform/custom_check_destroy/identity_platform_project_default_config.go.erb -docs: !ruby/object:Provider::Terraform::Docs - warning: | - If you are using User ADCs (Application Default Credentials) with this resource, - you must specify a `billing_project` and set `user_project_override` to true - in the provider configuration. Otherwise the ACM API will return a 403 error. - Your account must have the `serviceusage.services.use` permission on the - `billing_project` you defined. -id_format: '{{project}}' -examples: - - !ruby/object:Provider::Terraform::Examples - name: 'identity_platform_project_default_config' - primary_resource_id: - 'default' - # skip tests for this resource until we ensure other settings will not be cleared - # see https://github.com/hashicorp/terraform-provider-google/issues/13327 - skip_test: true - -properties: - - !ruby/object:Api::Type::String - name: 'name' - description: | - The name of the Config resource. Example: "projects/my-awesome-project/config" - output: true - - !ruby/object:Api::Type::NestedObject - name: 'signIn' - description: | - Configuration related to local sign in methods. - properties: - - !ruby/object:Api::Type::NestedObject - name: email - description: | - Configuration options related to authenticating a user by their email address. - properties: - - !ruby/object:Api::Type::Boolean - name: enabled - description: | - Whether email auth is enabled for the project or not. - - !ruby/object:Api::Type::Boolean - name: 'passwordRequired' - description: | - Whether a password is required for email auth or not. If true, both an email and - password must be provided to sign in. If false, a user may sign in via either - email/password or email link. - - !ruby/object:Api::Type::NestedObject - name: phoneNumber - description: | - Configuration options related to authenticated a user by their phone number. - properties: - - !ruby/object:Api::Type::Boolean - name: enabled - description: | - Whether phone number auth is enabled for the project or not. - - !ruby/object:Api::Type::KeyValuePairs - name: 'testPhoneNumbers' - description: | - A map of that can be used for phone auth testing. - - !ruby/object:Api::Type::NestedObject - name: anonymous - description: | - Configuration options related to authenticating an anonymous user. - properties: - - !ruby/object:Api::Type::Boolean - name: enabled - required: true - description: | - Whether anonymous user auth is enabled for the project or not. - - !ruby/object:Api::Type::Boolean - name: allowDuplicateEmails - description: | - Whether to allow more than one account to have the same email. - - !ruby/object:Api::Type::NestedObject - name: hashConfig - output: true - description: | - Output only. Hash config information. - properties: - - !ruby/object:Api::Type::String - name: algorithm - output: true - description: | - Different password hash algorithms used in Identity Toolkit. - - !ruby/object:Api::Type::String - name: 'signerKey' - output: true - description: | - Signer key in base64. - - !ruby/object:Api::Type::String - name: 'saltSeparator' - output: true - description: | - Non-printable character to be inserted between the salt and plain text password in base64. - - !ruby/object:Api::Type::Integer - name: rounds - output: true - description: | - How many rounds for hash calculation. Used by scrypt and other similar password derivation algorithms. - - !ruby/object:Api::Type::Integer - name: 'memoryCost' - output: true - description: | - Memory cost for hash calculation. Used by scrypt and other similar password derivation algorithms. See https://tools.ietf.org/html/rfc7914 for explanation of field. diff --git a/mmv1/products/identityplatform/go_ProjectDefaultConfig.yaml b/mmv1/products/identityplatform/go_ProjectDefaultConfig.yaml deleted file mode 100644 index ff1634543efc..000000000000 --- a/mmv1/products/identityplatform/go_ProjectDefaultConfig.yaml +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright 2024 Google Inc. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Warning: This is a temporary file, and should not be edited directly ---- -name: 'ProjectDefaultConfig' -description: | - There is no persistent data associated with this resource. -docs: - warning: | - If you are using User ADCs (Application Default Credentials) with this resource, - you must specify a `billing_project` and set `user_project_override` to true - in the provider configuration. Otherwise the ACM API will return a 403 error. - Your account must have the `serviceusage.services.use` permission on the - `billing_project` you defined. -id_format: '{{project}}' -base_url: 'projects/{{project}}/config' -self_link: 'projects/{{project}}/config' -create_verb: 'PATCH' -update_verb: 'PATCH' -update_mask: true -delete_verb: 'PATCH' -timeouts: - insert_minutes: 20 - update_minutes: 20 - delete_minutes: 20 -custom_code: - test_check_destroy: 'templates/terraform/custom_check_destroy/go/identity_platform_project_default_config.go.tmpl' -deprecation_message: '`google_identity_platform_config` is deprecated and will be removed in the next major release of the provider. Use the `google_identity_platform_config` resource instead. It contains a more comprehensive list of fields, and was created before `google_identity_platform_project_default_config` was added.' -examples: - - name: 'identity_platform_project_default_config' - primary_resource_id: 'default' - skip_test: true -parameters: -properties: - - name: 'name' - type: String - description: | - The name of the Config resource. Example: "projects/my-awesome-project/config" - output: true - - name: 'signIn' - type: NestedObject - description: | - Configuration related to local sign in methods. - properties: - - name: 'email' - type: NestedObject - description: | - Configuration options related to authenticating a user by their email address. - properties: - - name: 'enabled' - type: Boolean - description: | - Whether email auth is enabled for the project or not. - - name: 'passwordRequired' - type: Boolean - description: | - Whether a password is required for email auth or not. If true, both an email and - password must be provided to sign in. If false, a user may sign in via either - email/password or email link. - - name: 'phoneNumber' - type: NestedObject - description: | - Configuration options related to authenticated a user by their phone number. - properties: - - name: 'enabled' - type: Boolean - description: | - Whether phone number auth is enabled for the project or not. - - name: 'testPhoneNumbers' - type: KeyValuePairs - description: | - A map of that can be used for phone auth testing. - - name: 'anonymous' - type: NestedObject - description: | - Configuration options related to authenticating an anonymous user. - properties: - - name: 'enabled' - type: Boolean - description: | - Whether anonymous user auth is enabled for the project or not. - required: true - - name: 'allowDuplicateEmails' - type: Boolean - description: | - Whether to allow more than one account to have the same email. - - name: 'hashConfig' - type: NestedObject - description: | - Output only. Hash config information. - output: true - properties: - - name: 'algorithm' - type: String - description: | - Different password hash algorithms used in Identity Toolkit. - output: true - - name: 'signerKey' - type: String - description: | - Signer key in base64. - output: true - - name: 'saltSeparator' - type: String - description: | - Non-printable character to be inserted between the salt and plain text password in base64. - output: true - - name: 'rounds' - type: Integer - description: | - How many rounds for hash calculation. Used by scrypt and other similar password derivation algorithms. - output: true - - name: 'memoryCost' - type: Integer - description: | - Memory cost for hash calculation. Used by scrypt and other similar password derivation algorithms. See https://tools.ietf.org/html/rfc7914 for explanation of field. - output: true diff --git a/mmv1/products/integrations/Client.yaml b/mmv1/products/integrations/Client.yaml index 327f4decc99a..9fe2e3052956 100644 --- a/mmv1/products/integrations/Client.yaml +++ b/mmv1/products/integrations/Client.yaml @@ -84,34 +84,12 @@ properties: the kms key is stored at the same project as customer's project and ecrypted with CMEK, otherwise, the kms key is stored in the tenant project and encrypted with GMEK. - conflicts: - - provision_gmek - - !ruby/object:Api::Type::Boolean - name: 'createSampleWorkflows' - description: | - Indicates if sample workflow should be created along with provisioning. - immutable: true - ignore_read: true - deprecation_message: "`create_sample_workflows` is deprecated and will be removed in a future major release. Use `create_sample_integrations` instead." - conflicts: - - create_sample_integrations - !ruby/object:Api::Type::Boolean name: 'createSampleIntegrations' description: | Indicates if sample integrations should be created along with provisioning. immutable: true ignore_read: true - conflicts: - - create_sample_workflows - - !ruby/object:Api::Type::Boolean - name: 'provisionGmek' - description: | - Indicates provision with GMEK or CMEK. - deprecation_message: "`provision_gmek` is deprecated and will be removed in a future major release. Client would be provisioned as gmek if `cloud_kms_config` is not given." - immutable: true - ignore_read: true - conflicts: - - cloud_kms_config - !ruby/object:Api::Type::String name: 'runAsServiceAccount' description: | @@ -129,7 +107,3 @@ examples: vars: key_ring_name: my-keyring service_account_id: service-acc - - !ruby/object:Provider::Terraform::Examples - name: "integrations_client_deprecated_fields" - primary_resource_id: "example" - skip_docs: true diff --git a/mmv1/products/kms/AutokeyConfig.yaml b/mmv1/products/kms/AutokeyConfig.yaml index 845f3bf0521a..85e2e405cfa5 100644 --- a/mmv1/products/kms/AutokeyConfig.yaml +++ b/mmv1/products/kms/AutokeyConfig.yaml @@ -45,6 +45,8 @@ examples: - !ruby/object:Provider::Terraform::Examples name: 'kms_autokey_config_all' # Need the time_sleep resource + # Currently failing + skip_vcr: true external_providers: ["random", "time"] primary_resource_id: 'example-autokeyconfig' diff --git a/mmv1/products/kms/KeyHandle.yaml b/mmv1/products/kms/KeyHandle.yaml index 81e892c6c415..96cb6815b0c4 100644 --- a/mmv1/products/kms/KeyHandle.yaml +++ b/mmv1/products/kms/KeyHandle.yaml @@ -37,6 +37,8 @@ examples: - !ruby/object:Provider::Terraform::Examples name: 'kms_key_handle_basic' # Need the time_sleep resource + # Currently failing + skip_vcr: true external_providers: ["random", "time"] primary_resource_id: 'example-keyhandle' diff --git a/mmv1/products/networksecurity/ClientTlsPolicy.yaml b/mmv1/products/networksecurity/ClientTlsPolicy.yaml index 0f87404c7b78..a53881cc29a1 100644 --- a/mmv1/products/networksecurity/ClientTlsPolicy.yaml +++ b/mmv1/products/networksecurity/ClientTlsPolicy.yaml @@ -51,12 +51,16 @@ examples: - !ruby/object:Provider::Terraform::Examples min_version: beta name: 'network_security_client_tls_policy_basic' + # Currently failing + skip_vcr: true primary_resource_id: 'default' vars: resource_name: 'my-client-tls-policy' - !ruby/object:Provider::Terraform::Examples min_version: beta name: 'network_security_client_tls_policy_advanced' + # Currently failing + skip_vcr: true primary_resource_id: 'default' vars: resource_name: 'my-client-tls-policy' diff --git a/mmv1/products/pubsub/Topic.yaml b/mmv1/products/pubsub/Topic.yaml index 5fff52cff69f..a20186eba3be 100644 --- a/mmv1/products/pubsub/Topic.yaml +++ b/mmv1/products/pubsub/Topic.yaml @@ -124,7 +124,6 @@ properties: name: 'schemaSettings' description: | Settings for validating messages published against a schema. - default_from_api: true properties: - !ruby/object:Api::Type::String name: 'schema' diff --git a/mmv1/products/redis/Cluster.yaml b/mmv1/products/redis/Cluster.yaml index 82077ea2985a..c3a229daccd0 100644 --- a/mmv1/products/redis/Cluster.yaml +++ b/mmv1/products/redis/Cluster.yaml @@ -57,11 +57,11 @@ examples: policy_name: "mypolicy" subnet_name: "mysubnet" network_name: "mynetwork" - prevent_destroy: 'true' + deletion_protection_enabled: 'true' test_vars_overrides: - prevent_destroy: 'false' + deletion_protection_enabled: 'false' oics_vars_overrides: - prevent_destroy: 'false' + deletion_protection_enabled: 'false' - !ruby/object:Provider::Terraform::Examples name: "redis_cluster_ha_single_zone" primary_resource_id: "cluster-ha-single-zone" @@ -70,11 +70,11 @@ examples: policy_name: "mypolicy" subnet_name: "mysubnet" network_name: "mynetwork" - prevent_destroy: 'true' + deletion_protection_enabled: 'true' test_vars_overrides: - prevent_destroy: 'false' + deletion_protection_enabled: 'false' oics_vars_overrides: - prevent_destroy: 'false' + deletion_protection_enabled: 'false' properties: - !ruby/object:Api::Type::Time name: createTime @@ -262,6 +262,14 @@ properties: description: | Required. Number of shards for the Redis cluster. required: true + - !ruby/object:Api::Type::Boolean + name: deletionProtectionEnabled + description: | + Optional. Indicates if the cluster is deletion protected or not. + If the value if set to true, any delete cluster operation will fail. + Default value is true. + required: false + default_value: true - !ruby/object:Api::Type::KeyValuePairs name: 'redisConfigs' description: | diff --git a/mmv1/products/vertexai/FeatureOnlineStore.yaml b/mmv1/products/vertexai/FeatureOnlineStore.yaml index 663299718ce9..748bb1237482 100644 --- a/mmv1/products/vertexai/FeatureOnlineStore.yaml +++ b/mmv1/products/vertexai/FeatureOnlineStore.yaml @@ -58,6 +58,8 @@ examples: - force_destroy - !ruby/object:Provider::Terraform::Examples name: vertex_ai_featureonlinestore_with_beta_fields_bigtable + # currently failing + skip_vcr: true primary_resource_id: featureonlinestore vars: name: example_feature_online_store_beta_bigtable diff --git a/mmv1/products/vertexai/FeatureOnlineStoreFeatureview.yaml b/mmv1/products/vertexai/FeatureOnlineStoreFeatureview.yaml index cd9503c51069..92521412723c 100644 --- a/mmv1/products/vertexai/FeatureOnlineStoreFeatureview.yaml +++ b/mmv1/products/vertexai/FeatureOnlineStoreFeatureview.yaml @@ -73,6 +73,8 @@ examples: name: 'example_cross_project_featureview' - !ruby/object:Provider::Terraform::Examples name: 'vertex_ai_featureonlinestore_featureview_with_vector_search' + # currently failing + skip_vcr: true primary_resource_id: 'featureview_vector_search' vars: name: 'example_feature_view_vector_search' diff --git a/mmv1/products/vpcaccess/Connector.yaml b/mmv1/products/vpcaccess/Connector.yaml index b7a68917399c..b5e2fa4b797b 100644 --- a/mmv1/products/vpcaccess/Connector.yaml +++ b/mmv1/products/vpcaccess/Connector.yaml @@ -115,14 +115,18 @@ properties: Minimum throughput of the connector in Mbps. Default and min is 200. Refers to the expected throughput when using an e2-micro machine type. Value must be a multiple of 100 from 200 through 900. Must be lower than the value specified by max_throughput. If both min_throughput and min_instances are provided, min_instances takes precedence over min_throughput. The use of min_throughput is discouraged in favor of min_instances. - default_value: 200 validation: !ruby/object:Provider::Terraform::Validation function: 'validation.IntBetween(200, 1000)' + default_from_api: true + conflicts: + - min_instances - !ruby/object:Api::Type::Integer name: minInstances description: | Minimum value of instances in autoscaling group underlying the connector. Value must be between 2 and 9, inclusive. Must be lower than the value specified by max_instances. + conflicts: + - min_throughput default_from_api: true - !ruby/object:Api::Type::Integer name: maxInstances @@ -130,19 +134,20 @@ properties: Maximum value of instances in autoscaling group underlying the connector. Value must be between 3 and 10, inclusive. Must be higher than the value specified by min_instances. default_from_api: true + conflicts: + - max_throughput - !ruby/object:Api::Type::Integer name: maxThroughput - # The API documentation says this will default to 200, but when I tried that I got an error that the minimum - # throughput must be lower than the maximum. The console defaults to 1000, so I changed it to that. - # API returns 300 if it is not sent description: | Maximum throughput of the connector in Mbps, must be greater than `min_throughput`. Default is 300. Refers to the expected throughput when using an e2-micro machine type. Value must be a multiple of 100 from 300 through 1000. Must be higher than the value specified by min_throughput. If both max_throughput and max_instances are provided, max_instances takes precedence over max_throughput. The use of max_throughput is discouraged in favor of max_instances. - default_value: 300 validation: !ruby/object:Provider::Terraform::Validation function: 'validation.IntBetween(200, 1000)' + default_from_api: true + conflicts: + - max_instances - !ruby/object:Api::Type::String name: 'selfLink' description: | diff --git a/mmv1/products/workstations/WorkstationConfig.yaml b/mmv1/products/workstations/WorkstationConfig.yaml index da235ea6df81..f486ed2e1c3f 100644 --- a/mmv1/products/workstations/WorkstationConfig.yaml +++ b/mmv1/products/workstations/WorkstationConfig.yaml @@ -276,6 +276,8 @@ properties: Whether instances have no public IP address. - !ruby/object:Api::Type::Boolean name: 'disableSsh' + default_value: true + send_empty_value: true description: | Whether to disable SSH access to the VM. - !ruby/object:Api::Type::Boolean diff --git a/mmv1/templates/terraform/custom_check_destroy/go/identity_platform_project_default_config.go.tmpl b/mmv1/templates/terraform/custom_check_destroy/go/identity_platform_project_default_config.go.tmpl deleted file mode 100644 index 4c201190faba..000000000000 --- a/mmv1/templates/terraform/custom_check_destroy/go/identity_platform_project_default_config.go.tmpl +++ /dev/null @@ -1,45 +0,0 @@ -config := acctest.GoogleProviderConfig(t) - -url, err := tpgresource.ReplaceVarsForTest(config, rs, "{{"{{"}}IdentityPlatformBasePath{{"}}"}}projects/{{"{{"}}project{{"}}"}}/config") -if err != nil { - return err -} - -billingProject := "" - -if config.BillingProject != "" { - billingProject = config.BillingProject -} - -res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{ - Config: config, - Method: "GET", - Project: billingProject, - RawURL: url, - UserAgent: config.UserAgent, -}) -if err != nil { - return fmt.Errorf("something went wrong trying to get the IdentityPlatformProjectDefaultConfig at %s", url) -} - -signIn := res["signIn"] -if signIn == nil { - return nil -} - -original := signIn.(map[string]interface{}) -if len(original) == 0 { - return nil -} - -transformed := make(map[string]interface{}) -transformed["email"] = - flattenIdentityPlatformProjectDefaultConfigSignInEmail(original["email"], nil, nil) -transformed["phone_number"] = - flattenIdentityPlatformProjectDefaultConfigSignInPhoneNumber(original["phoneNumber"], nil, nil) -transformed["anonymous"] = - flattenIdentityPlatformProjectDefaultConfigSignInAnonymous(original["anonymous"], nil, nil) - -if transformed["email"] != nil || transformed["phone_number"] != nil || transformed["anonymous"] != nil { - return fmt.Errorf("IdentityPlatformProjectDefaultConfig still exists at %s", url) -} \ No newline at end of file diff --git a/mmv1/templates/terraform/custom_check_destroy/identity_platform_project_default_config.go.erb b/mmv1/templates/terraform/custom_check_destroy/identity_platform_project_default_config.go.erb deleted file mode 100644 index f2da2289d922..000000000000 --- a/mmv1/templates/terraform/custom_check_destroy/identity_platform_project_default_config.go.erb +++ /dev/null @@ -1,45 +0,0 @@ -config := acctest.GoogleProviderConfig(t) - -url, err := tpgresource.ReplaceVarsForTest(config, rs, "{{IdentityPlatformBasePath}}projects/{{project}}/config") -if err != nil { - return err -} - -billingProject := "" - -if config.BillingProject != "" { - billingProject = config.BillingProject -} - -res, err := transport_tpg.SendRequest(transport_tpg.SendRequestOptions{ - Config: config, - Method: "GET", - Project: billingProject, - RawURL: url, - UserAgent: config.UserAgent, -}) -if err != nil { - return fmt.Errorf("something went wrong trying to get the IdentityPlatformProjectDefaultConfig at %s", url) -} - -signIn := res["signIn"] -if signIn == nil { - return nil -} - -original := signIn.(map[string]interface{}) -if len(original) == 0 { - return nil -} - -transformed := make(map[string]interface{}) -transformed["email"] = - flattenIdentityPlatformProjectDefaultConfigSignInEmail(original["email"], nil, nil) -transformed["phone_number"] = - flattenIdentityPlatformProjectDefaultConfigSignInPhoneNumber(original["phoneNumber"], nil, nil) -transformed["anonymous"] = - flattenIdentityPlatformProjectDefaultConfigSignInAnonymous(original["anonymous"], nil, nil) - -if transformed["email"] != nil || transformed["phone_number"] != nil || transformed["anonymous"] != nil { - return fmt.Errorf("IdentityPlatformProjectDefaultConfig still exists at %s", url) -} \ No newline at end of file diff --git a/mmv1/templates/terraform/custom_expand/name_or_name_prefix.go.erb b/mmv1/templates/terraform/custom_expand/name_or_name_prefix.go.erb index b3297fd187c2..eef5ae03a552 100644 --- a/mmv1/templates/terraform/custom_expand/name_or_name_prefix.go.erb +++ b/mmv1/templates/terraform/custom_expand/name_or_name_prefix.go.erb @@ -17,7 +17,12 @@ func expand<%= prefix -%><%= titlelize_property(property) -%>(v interface{}, d t if v, ok := d.GetOk("name"); ok { certName = v.(string) } else if v, ok := d.GetOk("name_prefix"); ok { - certName = id.PrefixedUniqueId(v.(string)) + prefix := v.(string) + if len(prefix) > 37 { + certName = tpgresource.ReducedPrefixedUniqueId(prefix) + } else { + certName = id.PrefixedUniqueId(prefix) + } } else { certName = id.UniqueId() } diff --git a/mmv1/templates/terraform/decoders/backend_service.go.erb b/mmv1/templates/terraform/decoders/backend_service.go.erb index 3e0796f151a5..2916928ce9bd 100644 --- a/mmv1/templates/terraform/decoders/backend_service.go.erb +++ b/mmv1/templates/terraform/decoders/backend_service.go.erb @@ -12,18 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -%> -// We need to pretend IAP isn't there if it's disabled for Terraform to maintain -// BC behaviour with the handwritten resource. -v, ok := res["iap"] -if !ok || v == nil { - delete(res, "iap") - return res, nil -} -m := v.(map[string]interface{}) -if ok && m["enabled"] == false { - delete(res, "iap") -} - // Requests with consistentHash will error for specific values of // localityLbPolicy. However, the API will not remove it if the backend // service is updated to from supporting to non-supporting localityLbPolicy diff --git a/mmv1/templates/terraform/decoders/region_backend_service.go.erb b/mmv1/templates/terraform/decoders/region_backend_service.go.erb index 7e7d747fd2b6..517866dd216e 100644 --- a/mmv1/templates/terraform/decoders/region_backend_service.go.erb +++ b/mmv1/templates/terraform/decoders/region_backend_service.go.erb @@ -12,22 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -%> -// We need to pretend IAP isn't there if it's disabled for Terraform to maintain -// BC behaviour with the handwritten resource. -v, ok := res["iap"] -if !ok || v == nil { - delete(res, "iap") - return res, nil -} -m := v.(map[string]interface{}) -if ok && m["enabled"] == false { - delete(res, "iap") -} <% unless version == 'ga' -%> // Since we add in a NONE subsetting policy, we need to remove it in some // cases for backwards compatibility with the config -v, ok = res["subsetting"] +v, ok := res["subsetting"] if ok && v != nil { subsetting := v.(map[string]interface{}) policy, ok := subsetting["policy"] diff --git a/mmv1/templates/terraform/encoders/backend_service.go.erb b/mmv1/templates/terraform/encoders/backend_service.go.erb index 66626bf17fe3..b018972bd0b2 100644 --- a/mmv1/templates/terraform/encoders/backend_service.go.erb +++ b/mmv1/templates/terraform/encoders/backend_service.go.erb @@ -12,24 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -%> -// The BackendService API's Update / PUT API is badly formed and behaves like -// a PATCH field for at least IAP. When sent a `null` `iap` field, the API -// doesn't disable an existing field. To work around this, we need to emulate -// the old Terraform behaviour of always sending the block (at both update and -// create), and force sending each subfield as empty when the block isn't -// present in config. - -iapVal := obj["iap"] -if iapVal == nil { - data := map[string]interface{}{} - data["enabled"] = false - obj["iap"] = data -} else { - iap := iapVal.(map[string]interface{}) - iap["enabled"] = true - obj["iap"] = iap -} - backendsRaw, ok := obj["backends"] if !ok { return obj, nil diff --git a/mmv1/templates/terraform/encoders/region_backend_service.go.erb b/mmv1/templates/terraform/encoders/region_backend_service.go.erb index 76d396b5a0c5..7612dc051f0a 100644 --- a/mmv1/templates/terraform/encoders/region_backend_service.go.erb +++ b/mmv1/templates/terraform/encoders/region_backend_service.go.erb @@ -12,23 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -%> -// The RegionBackendService API's Update / PUT API is badly formed and behaves like -// a PATCH field for at least IAP. When sent a `null` `iap` field, the API -// doesn't disable an existing field. To work around this, we need to emulate -// the old Terraform behaviour of always sending the block (at both update and -// create), and force sending each subfield as empty when the block isn't -// present in config. - -iapVal := obj["iap"] -if iapVal == nil { - data := map[string]interface{}{} - data["enabled"] = false - obj["iap"] = data -} else { - iap := iapVal.(map[string]interface{}) - iap["enabled"] = true - obj["iap"] = iap -} if d.Get("load_balancing_scheme").(string) == "EXTERNAL_MANAGED" || d.Get("load_balancing_scheme").(string) == "INTERNAL_MANAGED" { return obj, nil diff --git a/mmv1/templates/terraform/encoders/workflow.go.erb b/mmv1/templates/terraform/encoders/workflow.go.erb index 4888f187bd15..511fde357259 100644 --- a/mmv1/templates/terraform/encoders/workflow.go.erb +++ b/mmv1/templates/terraform/encoders/workflow.go.erb @@ -2,7 +2,12 @@ var ResName string if v, ok := d.GetOk("name"); ok { ResName = v.(string) } else if v, ok := d.GetOk("name_prefix"); ok { - ResName = id.PrefixedUniqueId(v.(string)) + prefix := v.(string) + if len(prefix) > 37 { + ResName = tpgresource.ReducedPrefixedUniqueId(prefix) + } else { + ResName = id.PrefixedUniqueId(prefix) + } } else { ResName = id.UniqueId() } diff --git a/mmv1/templates/terraform/examples/access_context_manager_access_policy_scoped.tf.erb b/mmv1/templates/terraform/examples/access_context_manager_access_policy_scoped.tf.erb index a294add4d8c6..46a72ae67517 100644 --- a/mmv1/templates/terraform/examples/access_context_manager_access_policy_scoped.tf.erb +++ b/mmv1/templates/terraform/examples/access_context_manager_access_policy_scoped.tf.erb @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "<%= ctx[:test_env_vars]['project'] %>" name = "<%= ctx[:test_env_vars]['project'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "google_access_context_manager_access_policy" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/active_directory_domain_basic.tf.erb b/mmv1/templates/terraform/examples/active_directory_domain_basic.tf.erb index 3d972c5d4d23..e970996dd9be 100644 --- a/mmv1/templates/terraform/examples/active_directory_domain_basic.tf.erb +++ b/mmv1/templates/terraform/examples/active_directory_domain_basic.tf.erb @@ -2,4 +2,5 @@ resource "google_active_directory_domain" "ad-domain" { domain_name = "<%= ctx[:vars]['domain_name'] %>.org.com" locations = ["us-central1"] reserved_ip_range = "192.168.255.0/24" + deletion_protection = false } \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/active_directory_domain_trust_basic.tf.erb b/mmv1/templates/terraform/examples/active_directory_domain_trust_basic.tf.erb index c16b4eab99d5..c1f9cf61d676 100644 --- a/mmv1/templates/terraform/examples/active_directory_domain_trust_basic.tf.erb +++ b/mmv1/templates/terraform/examples/active_directory_domain_trust_basic.tf.erb @@ -5,4 +5,5 @@ resource "google_active_directory_domain_trust" "ad-domain-trust" { trust_direction = "OUTBOUND" trust_type = "FOREST" trust_handshake_secret = "Testing1!" + deletion_protection = false } \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/active_directory_peering_basic.tf.erb b/mmv1/templates/terraform/examples/active_directory_peering_basic.tf.erb index bc5926168f76..c68e7fb75b9b 100644 --- a/mmv1/templates/terraform/examples/active_directory_peering_basic.tf.erb +++ b/mmv1/templates/terraform/examples/active_directory_peering_basic.tf.erb @@ -3,6 +3,7 @@ resource "google_active_directory_peering" "ad-domain-peering" { domain_resource = google_active_directory_domain.ad-domain.name peering_id = "ad-domain-peering" authorized_network = google_compute_network.peered-network.id + deletion_protection = false labels = { foo = "bar" } @@ -14,6 +15,7 @@ resource "google_active_directory_domain" "ad-domain" { locations = ["us-central1"] reserved_ip_range = "192.168.255.0/24" authorized_networks = [google_compute_network.source-network.id] + deletion_protection = false } resource "google_compute_network" "peered-network" { @@ -39,4 +41,5 @@ resource "google_project" "peered-project" { project_id = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/alloydb_backup_basic_test.tf.erb b/mmv1/templates/terraform/examples/alloydb_backup_basic_test.tf.erb index 57d9e50b0d7e..e4b3d7b578c2 100644 --- a/mmv1/templates/terraform/examples/alloydb_backup_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/alloydb_backup_basic_test.tf.erb @@ -9,7 +9,9 @@ resource "google_alloydb_backup" "<%= ctx[:primary_resource_id] %>" { resource "google_alloydb_cluster" "<%= ctx[:primary_resource_id] %>" { cluster_id = "<%= ctx[:vars]['alloydb_cluster_name'] %>" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/alloydb_backup_full_test.tf.erb b/mmv1/templates/terraform/examples/alloydb_backup_full_test.tf.erb index 671e9c930175..d9e436c7fcba 100644 --- a/mmv1/templates/terraform/examples/alloydb_backup_full_test.tf.erb +++ b/mmv1/templates/terraform/examples/alloydb_backup_full_test.tf.erb @@ -14,7 +14,9 @@ resource "google_alloydb_backup" "<%= ctx[:primary_resource_id] %>" { resource "google_alloydb_cluster" "<%= ctx[:primary_resource_id] %>" { cluster_id = "<%= ctx[:vars]['alloydb_cluster_name'] %>" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/alloydb_cluster_restore.tf.erb b/mmv1/templates/terraform/examples/alloydb_cluster_restore.tf.erb index cc111b2bc649..4d6d0bff435c 100644 --- a/mmv1/templates/terraform/examples/alloydb_cluster_restore.tf.erb +++ b/mmv1/templates/terraform/examples/alloydb_cluster_restore.tf.erb @@ -42,8 +42,9 @@ resource "google_alloydb_cluster" "restored_from_backup" { resource "google_alloydb_cluster" "restored_via_pitr" { cluster_id = "<%= ctx[:vars]['alloydb_pitr_restored_cluster_name'] %>" location = "us-central1" - network = data.google_compute_network.default.id - + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.<%= ctx[:primary_resource_id] %>.name point_in_time = "2023-08-03T19:19:00.094Z" diff --git a/mmv1/templates/terraform/examples/alloydb_instance_basic_test.tf.erb b/mmv1/templates/terraform/examples/alloydb_instance_basic_test.tf.erb index 36e2678f46db..5f7e2e325289 100644 --- a/mmv1/templates/terraform/examples/alloydb_instance_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/alloydb_instance_basic_test.tf.erb @@ -11,8 +11,9 @@ resource "google_alloydb_instance" "<%= ctx[:primary_resource_id] %>" { resource "google_alloydb_cluster" "<%= ctx[:primary_resource_id] %>" { cluster_id = "<%= ctx[:vars]['alloydb_cluster_name'] %>" location = "us-central1" - network = data.google_compute_network.default.id - + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "<%= ctx[:vars]['alloydb_cluster_name'] %>" } diff --git a/mmv1/templates/terraform/examples/alloydb_secondary_cluster_basic.tf.erb b/mmv1/templates/terraform/examples/alloydb_secondary_cluster_basic.tf.erb index 353cd5a26e6c..7cfb78817983 100644 --- a/mmv1/templates/terraform/examples/alloydb_secondary_cluster_basic.tf.erb +++ b/mmv1/templates/terraform/examples/alloydb_secondary_cluster_basic.tf.erb @@ -1,7 +1,9 @@ resource "google_alloydb_cluster" "primary" { cluster_id = "<%= ctx[:vars]['alloydb_primary_cluster_name'] %>" location = "us-central1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -19,7 +21,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "<%= ctx[:primary_resource_id] %>" { cluster_id = "<%= ctx[:vars]['alloydb_secondary_cluster_name'] %>" location = "us-east1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/mmv1/templates/terraform/examples/alloydb_secondary_cluster_basic_test.tf.erb b/mmv1/templates/terraform/examples/alloydb_secondary_cluster_basic_test.tf.erb index baa944c10798..6796ce112847 100644 --- a/mmv1/templates/terraform/examples/alloydb_secondary_cluster_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/alloydb_secondary_cluster_basic_test.tf.erb @@ -1,7 +1,9 @@ resource "google_alloydb_cluster" "primary" { cluster_id = "<%= ctx[:vars]['alloydb_primary_cluster_name'] %>" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -17,7 +19,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "<%= ctx[:primary_resource_id] %>" { cluster_id = "<%= ctx[:vars]['alloydb_secondary_cluster_name'] %>" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/mmv1/templates/terraform/examples/alloydb_secondary_instance_basic.tf.erb b/mmv1/templates/terraform/examples/alloydb_secondary_instance_basic.tf.erb index bd4c628c017e..7472347360a3 100644 --- a/mmv1/templates/terraform/examples/alloydb_secondary_instance_basic.tf.erb +++ b/mmv1/templates/terraform/examples/alloydb_secondary_instance_basic.tf.erb @@ -1,7 +1,9 @@ resource "google_alloydb_cluster" "primary" { cluster_id = "<%= ctx[:vars]['alloydb_primary_cluster_name'] %>" location = "us-central1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -19,7 +21,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "<%= ctx[:vars]['alloydb_secondary_cluster_name'] %>" location = "us-east1" - network = google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/mmv1/templates/terraform/examples/alloydb_secondary_instance_basic_test.tf.erb b/mmv1/templates/terraform/examples/alloydb_secondary_instance_basic_test.tf.erb index c6cfdce0f8d4..dc7c5e0a5f4a 100644 --- a/mmv1/templates/terraform/examples/alloydb_secondary_instance_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/alloydb_secondary_instance_basic_test.tf.erb @@ -1,7 +1,9 @@ resource "google_alloydb_cluster" "primary" { cluster_id = "<%= ctx[:vars]['alloydb_primary_cluster_name'] %>" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -17,7 +19,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "<%= ctx[:vars]['alloydb_secondary_cluster_name'] %>" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/mmv1/templates/terraform/examples/alloydb_user_builtin.tf.erb b/mmv1/templates/terraform/examples/alloydb_user_builtin.tf.erb index ff49ab77a102..63e63c83fefa 100644 --- a/mmv1/templates/terraform/examples/alloydb_user_builtin.tf.erb +++ b/mmv1/templates/terraform/examples/alloydb_user_builtin.tf.erb @@ -9,8 +9,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "<%= ctx[:vars]['alloydb_cluster_name'] %>" location = "us-central1" - network = google_compute_network.default.id - + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "<%= ctx[:vars]['alloydb_cluster_pass'] %>" } diff --git a/mmv1/templates/terraform/examples/alloydb_user_builtin_test.tf.erb b/mmv1/templates/terraform/examples/alloydb_user_builtin_test.tf.erb index f2511be21719..101167eec80b 100644 --- a/mmv1/templates/terraform/examples/alloydb_user_builtin_test.tf.erb +++ b/mmv1/templates/terraform/examples/alloydb_user_builtin_test.tf.erb @@ -7,8 +7,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "<%= ctx[:vars]['alloydb_cluster_name'] %>" location = "us-central1" - network = data.google_compute_network.default.id - + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "<%= ctx[:vars]['alloydb_cluster_pass'] %>" } diff --git a/mmv1/templates/terraform/examples/alloydb_user_iam.tf.erb b/mmv1/templates/terraform/examples/alloydb_user_iam.tf.erb index fd2a84128dd7..1d57cef6d4d5 100644 --- a/mmv1/templates/terraform/examples/alloydb_user_iam.tf.erb +++ b/mmv1/templates/terraform/examples/alloydb_user_iam.tf.erb @@ -9,7 +9,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "<%= ctx[:vars]['alloydb_cluster_name'] %>" location = "us-central1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } initial_user { password = "<%= ctx[:vars]['alloydb_cluster_pass'] %>" diff --git a/mmv1/templates/terraform/examples/alloydb_user_iam_test.tf.erb b/mmv1/templates/terraform/examples/alloydb_user_iam_test.tf.erb index fc5aa428a881..59296f25840f 100644 --- a/mmv1/templates/terraform/examples/alloydb_user_iam_test.tf.erb +++ b/mmv1/templates/terraform/examples/alloydb_user_iam_test.tf.erb @@ -7,8 +7,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "<%= ctx[:vars]['alloydb_cluster_name'] %>" location = "us-central1" - network = data.google_compute_network.default.id - + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "<%= ctx[:vars]['alloydb_cluster_pass'] %>" } diff --git a/mmv1/templates/terraform/examples/apigee_addons_test.tf.erb b/mmv1/templates/terraform/examples/apigee_addons_test.tf.erb index fb4e489b63cb..813ec9a80487 100644 --- a/mmv1/templates/terraform/examples/apigee_addons_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_addons_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_endpoint_attachment_basic_test.tf.erb b/mmv1/templates/terraform/examples/apigee_endpoint_attachment_basic_test.tf.erb index ed85e2c4f2b5..6f0af483c2d5 100644 --- a/mmv1/templates/terraform/examples/apigee_endpoint_attachment_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_endpoint_attachment_basic_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_env_keystore_alias_self_signed_cert.tf.erb b/mmv1/templates/terraform/examples/apigee_env_keystore_alias_self_signed_cert.tf.erb index c7385a59a421..452bb5e6015f 100644 --- a/mmv1/templates/terraform/examples/apigee_env_keystore_alias_self_signed_cert.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_env_keystore_alias_self_signed_cert.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_environment_basic_deployment_apiproxy_type_test.tf.erb b/mmv1/templates/terraform/examples/apigee_environment_basic_deployment_apiproxy_type_test.tf.erb index dc79ceb0668f..213e707861d5 100644 --- a/mmv1/templates/terraform/examples/apigee_environment_basic_deployment_apiproxy_type_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_environment_basic_deployment_apiproxy_type_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_environment_basic_test.tf.erb b/mmv1/templates/terraform/examples/apigee_environment_basic_test.tf.erb index 6357ad9f0cea..162ad65e0b68 100644 --- a/mmv1/templates/terraform/examples/apigee_environment_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_environment_basic_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_environment_group_attachment_basic.tf.erb b/mmv1/templates/terraform/examples/apigee_environment_group_attachment_basic.tf.erb index c4a87c7fa3ae..653bf99a83a7 100644 --- a/mmv1/templates/terraform/examples/apigee_environment_group_attachment_basic.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_environment_group_attachment_basic.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_environment_group_attachment_basic_test.tf.erb b/mmv1/templates/terraform/examples/apigee_environment_group_attachment_basic_test.tf.erb index ec1b9d8182b8..f82569b5495e 100644 --- a/mmv1/templates/terraform/examples/apigee_environment_group_attachment_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_environment_group_attachment_basic_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_environment_group_basic_test.tf.erb b/mmv1/templates/terraform/examples/apigee_environment_group_basic_test.tf.erb index 818fdc40a2c7..65af6e2b206e 100644 --- a/mmv1/templates/terraform/examples/apigee_environment_group_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_environment_group_basic_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_environment_keystore_test.tf.erb b/mmv1/templates/terraform/examples/apigee_environment_keystore_test.tf.erb index 7a59fe8ef1d6..c0c6c8455bdc 100644 --- a/mmv1/templates/terraform/examples/apigee_environment_keystore_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_environment_keystore_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_beta_test.tf.erb b/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_beta_test.tf.erb index c492ac5c7ee4..7213832df9da 100644 --- a/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_beta_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_beta_test.tf.erb @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_entries_beta_test.tf.erb b/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_entries_beta_test.tf.erb index 64d2e5a7757c..72ca49b02b26 100644 --- a/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_entries_beta_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_entries_beta_test.tf.erb @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_entries_test.tf.erb b/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_entries_test.tf.erb index 28fe4dc2d515..f6bbb38cc7ae 100644 --- a/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_entries_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_entries_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_test.tf.erb b/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_test.tf.erb index dcf201842557..717e510bef4b 100644 --- a/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_environment_keyvaluemaps_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_environment_patch_update_test.tf.erb b/mmv1/templates/terraform/examples/apigee_environment_patch_update_test.tf.erb index b884c2c7f03f..0b1c825be8eb 100644 --- a/mmv1/templates/terraform/examples/apigee_environment_patch_update_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_environment_patch_update_test.tf.erb @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_environment_reference_test.tf.erb b/mmv1/templates/terraform/examples/apigee_environment_reference_test.tf.erb index 78119ec25d43..859a687b6c70 100644 --- a/mmv1/templates/terraform/examples/apigee_environment_reference_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_environment_reference_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_instance_attachment_basic.tf.erb b/mmv1/templates/terraform/examples/apigee_instance_attachment_basic.tf.erb index a3bd92489bc7..03566655e653 100644 --- a/mmv1/templates/terraform/examples/apigee_instance_attachment_basic.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_instance_attachment_basic.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_instance_attachment_basic_test.tf.erb b/mmv1/templates/terraform/examples/apigee_instance_attachment_basic_test.tf.erb index d9ebf23c96bc..3366148622b8 100644 --- a/mmv1/templates/terraform/examples/apigee_instance_attachment_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_instance_attachment_basic_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_instance_basic_test.tf.erb b/mmv1/templates/terraform/examples/apigee_instance_basic_test.tf.erb index 567df37a119e..c436664a2c42 100644 --- a/mmv1/templates/terraform/examples/apigee_instance_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_instance_basic_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_instance_cidr_range_test.tf.erb b/mmv1/templates/terraform/examples/apigee_instance_cidr_range_test.tf.erb index 305d76c7c8f2..e470b82dbd12 100644 --- a/mmv1/templates/terraform/examples/apigee_instance_cidr_range_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_instance_cidr_range_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_instance_full_test.tf.erb b/mmv1/templates/terraform/examples/apigee_instance_full_test.tf.erb index 7b549cc9f036..3dd881c9781a 100644 --- a/mmv1/templates/terraform/examples/apigee_instance_full_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_instance_full_test.tf.erb @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_instance_ip_range_test.tf.erb b/mmv1/templates/terraform/examples/apigee_instance_ip_range_test.tf.erb index 9e4d91d95bb6..15a898bab0fc 100644 --- a/mmv1/templates/terraform/examples/apigee_instance_ip_range_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_instance_ip_range_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_instance_service_attachment_basic_test.tf.erb b/mmv1/templates/terraform/examples/apigee_instance_service_attachment_basic_test.tf.erb index 712718089cea..c6b39df1c87b 100644 --- a/mmv1/templates/terraform/examples/apigee_instance_service_attachment_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_instance_service_attachment_basic_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_nat_address_basic_test.tf.erb b/mmv1/templates/terraform/examples/apigee_nat_address_basic_test.tf.erb index 7dfef106caa5..7169dabb6715 100644 --- a/mmv1/templates/terraform/examples/apigee_nat_address_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_nat_address_basic_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_organization_cloud_basic_disable_vpc_peering_test.tf.erb b/mmv1/templates/terraform/examples/apigee_organization_cloud_basic_disable_vpc_peering_test.tf.erb index a0b0e6762698..e9851e1d711a 100644 --- a/mmv1/templates/terraform/examples/apigee_organization_cloud_basic_disable_vpc_peering_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_organization_cloud_basic_disable_vpc_peering_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_organization_cloud_basic_test.tf.erb b/mmv1/templates/terraform/examples/apigee_organization_cloud_basic_test.tf.erb index 87fab9350fc3..632e6fad3f69 100644 --- a/mmv1/templates/terraform/examples/apigee_organization_cloud_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_organization_cloud_basic_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_organization_cloud_full_disable_vpc_peering_test.tf.erb b/mmv1/templates/terraform/examples/apigee_organization_cloud_full_disable_vpc_peering_test.tf.erb index a6f70393fc76..861e1df05af0 100644 --- a/mmv1/templates/terraform/examples/apigee_organization_cloud_full_disable_vpc_peering_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_organization_cloud_full_disable_vpc_peering_test.tf.erb @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_organization_cloud_full_test.tf.erb b/mmv1/templates/terraform/examples/apigee_organization_cloud_full_test.tf.erb index f5ae4774fcb7..e6269351d3b7 100644 --- a/mmv1/templates/terraform/examples/apigee_organization_cloud_full_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_organization_cloud_full_test.tf.erb @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_organization_drz_test.tf.erb b/mmv1/templates/terraform/examples/apigee_organization_drz_test.tf.erb index 4189c4be072e..80579ecccf43 100644 --- a/mmv1/templates/terraform/examples/apigee_organization_drz_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_organization_drz_test.tf.erb @@ -9,6 +9,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_organization_retention_test.tf.erb b/mmv1/templates/terraform/examples/apigee_organization_retention_test.tf.erb index e9e569222b51..b03974bb8eb1 100644 --- a/mmv1/templates/terraform/examples/apigee_organization_retention_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_organization_retention_test.tf.erb @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_sync_authorization_basic_test.tf.erb b/mmv1/templates/terraform/examples/apigee_sync_authorization_basic_test.tf.erb index 5f590fcd1e94..1f7f12db331d 100644 --- a/mmv1/templates/terraform/examples/apigee_sync_authorization_basic_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_sync_authorization_basic_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_target_server_test.tf.erb b/mmv1/templates/terraform/examples/apigee_target_server_test.tf.erb index 1afd90843ffe..130e609676d4 100644 --- a/mmv1/templates/terraform/examples/apigee_target_server_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_target_server_test.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/apigee_target_server_test_basic.tf.erb b/mmv1/templates/terraform/examples/apigee_target_server_test_basic.tf.erb index 6b1dd1d26765..d27abfb85d91 100644 --- a/mmv1/templates/terraform/examples/apigee_target_server_test_basic.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_target_server_test_basic.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/app_engine_firewall_rule_basic.tf.erb b/mmv1/templates/terraform/examples/app_engine_firewall_rule_basic.tf.erb index 057f23b2e268..07820c92a6c5 100644 --- a/mmv1/templates/terraform/examples/app_engine_firewall_rule_basic.tf.erb +++ b/mmv1/templates/terraform/examples/app_engine_firewall_rule_basic.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "my_project" { project_id = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_app_engine_application" "app" { diff --git a/mmv1/templates/terraform/examples/app_engine_flexible_app_version.tf.erb b/mmv1/templates/terraform/examples/app_engine_flexible_app_version.tf.erb index 641e65936952..032373d7cf44 100644 --- a/mmv1/templates/terraform/examples/app_engine_flexible_app_version.tf.erb +++ b/mmv1/templates/terraform/examples/app_engine_flexible_app_version.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "my_project" { project_id = "<%= ctx[:vars]['project'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_app_engine_application" "app" { diff --git a/mmv1/templates/terraform/examples/apphub_service_basic.tf.erb b/mmv1/templates/terraform/examples/apphub_service_basic.tf.erb index c105754d1af4..869f7001d19b 100644 --- a/mmv1/templates/terraform/examples/apphub_service_basic.tf.erb +++ b/mmv1/templates/terraform/examples/apphub_service_basic.tf.erb @@ -11,6 +11,7 @@ resource "google_project" "service_project" { name = "Service Project" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } # Enable Compute API diff --git a/mmv1/templates/terraform/examples/apphub_service_full.tf.erb b/mmv1/templates/terraform/examples/apphub_service_full.tf.erb index 7eb5d74a67c7..e76a286dc23c 100644 --- a/mmv1/templates/terraform/examples/apphub_service_full.tf.erb +++ b/mmv1/templates/terraform/examples/apphub_service_full.tf.erb @@ -11,6 +11,7 @@ resource "google_project" "service_project" { name = "Service Project" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } # Enable Compute API diff --git a/mmv1/templates/terraform/examples/apphub_service_project_attachment_basic.tf.erb b/mmv1/templates/terraform/examples/apphub_service_project_attachment_basic.tf.erb index 33d835bacc44..71eb1d7af699 100644 --- a/mmv1/templates/terraform/examples/apphub_service_project_attachment_basic.tf.erb +++ b/mmv1/templates/terraform/examples/apphub_service_project_attachment_basic.tf.erb @@ -7,6 +7,7 @@ resource "google_project" "service_project" { project_id ="<%= ctx[:vars]['service_project_attachment_id'] %>" name = "Service Project" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "time_sleep" "wait_120s" { diff --git a/mmv1/templates/terraform/examples/apphub_service_project_attachment_full.tf.erb b/mmv1/templates/terraform/examples/apphub_service_project_attachment_full.tf.erb index f88c9b9ab7fa..bffe2753f026 100644 --- a/mmv1/templates/terraform/examples/apphub_service_project_attachment_full.tf.erb +++ b/mmv1/templates/terraform/examples/apphub_service_project_attachment_full.tf.erb @@ -8,6 +8,7 @@ resource "google_project" "service_project_full" { project_id ="<%= ctx[:vars]['service_project_attachment_id'] %>" name = "Service Project Full" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "time_sleep" "wait_120s" { diff --git a/mmv1/templates/terraform/examples/apphub_workload_basic.tf.erb b/mmv1/templates/terraform/examples/apphub_workload_basic.tf.erb index 0a18d7b2798f..23ccc6a2e1a0 100644 --- a/mmv1/templates/terraform/examples/apphub_workload_basic.tf.erb +++ b/mmv1/templates/terraform/examples/apphub_workload_basic.tf.erb @@ -11,6 +11,7 @@ resource "google_project" "service_project" { name = "Service Project" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } # Enable Compute API diff --git a/mmv1/templates/terraform/examples/apphub_workload_full.tf.erb b/mmv1/templates/terraform/examples/apphub_workload_full.tf.erb index 1f33aa4b7f6a..bd92c81d0e7e 100644 --- a/mmv1/templates/terraform/examples/apphub_workload_full.tf.erb +++ b/mmv1/templates/terraform/examples/apphub_workload_full.tf.erb @@ -11,6 +11,7 @@ resource "google_project" "service_project" { name = "Service Project" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } # Enable Compute API diff --git a/mmv1/templates/terraform/examples/backend_service_external_iap.tf.erb b/mmv1/templates/terraform/examples/backend_service_external_iap.tf.erb index 1679fa7c39e3..cf264f8565ca 100644 --- a/mmv1/templates/terraform/examples/backend_service_external_iap.tf.erb +++ b/mmv1/templates/terraform/examples/backend_service_external_iap.tf.erb @@ -3,6 +3,7 @@ resource "google_compute_backend_service" "<%= ctx[:primary_resource_id] %>" { protocol = "HTTP" load_balancing_scheme = "EXTERNAL" iap { + enabled = true oauth2_client_id = "abc" oauth2_client_secret = "xyz" } diff --git a/mmv1/templates/terraform/examples/backend_service_traffic_director_ring_hash.tf.erb b/mmv1/templates/terraform/examples/backend_service_traffic_director_ring_hash.tf.erb index 46b584e3c4f8..d8409f7aed23 100644 --- a/mmv1/templates/terraform/examples/backend_service_traffic_director_ring_hash.tf.erb +++ b/mmv1/templates/terraform/examples/backend_service_traffic_director_ring_hash.tf.erb @@ -19,7 +19,15 @@ resource "google_compute_backend_service" "<%= ctx[:primary_resource_id] %>" { } } outlier_detection { - consecutive_errors = 2 + consecutive_errors = 2 + consecutive_gateway_failure = 5 + enforcing_consecutive_errors = 100 + enforcing_consecutive_gateway_failure = 0 + enforcing_success_rate = 100 + max_ejection_percent = 10 + success_rate_minimum_hosts = 5 + success_rate_request_volume = 100 + success_rate_stdev_factor = 1900 } } diff --git a/mmv1/templates/terraform/examples/billing_project_info_basic.tf.erb b/mmv1/templates/terraform/examples/billing_project_info_basic.tf.erb index 09eb8ed8334c..3ca9dea1066f 100644 --- a/mmv1/templates/terraform/examples/billing_project_info_basic.tf.erb +++ b/mmv1/templates/terraform/examples/billing_project_info_basic.tf.erb @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "tf-test%{random_suffix}" name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" lifecycle { ignore_changes = [billing_account] } diff --git a/mmv1/templates/terraform/examples/cloud_asset_folder_feed.tf.erb b/mmv1/templates/terraform/examples/cloud_asset_folder_feed.tf.erb index 77ef8f8c5ba7..84a8e50b132b 100644 --- a/mmv1/templates/terraform/examples/cloud_asset_folder_feed.tf.erb +++ b/mmv1/templates/terraform/examples/cloud_asset_folder_feed.tf.erb @@ -37,6 +37,7 @@ resource "google_pubsub_topic" "feed_output" { resource "google_folder" "my_folder" { display_name = "<%= ctx[:vars]["folder_name"] %>" parent = "organizations/<%= ctx[:test_env_vars]["org_id"] %>" + deletion_protection = false } # Find the project number of the project whose identity will be used for sending diff --git a/mmv1/templates/terraform/examples/cloudrunv2_job_basic.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_job_basic.tf.erb index 95f66200f790..5eb48cde2e78 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_job_basic.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_job_basic.tf.erb @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_job" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_job_name'] %>" location = "us-central1" + deletion_protection = false template { template { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_job_directvpc.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_job_directvpc.tf.erb index d8117c68cd1a..805f703159ed 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_job_directvpc.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_job_directvpc.tf.erb @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_job" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_job_name'] %>" location = "us-central1" + deletion_protection = false launch_stage = "GA" template { template{ diff --git a/mmv1/templates/terraform/examples/cloudrunv2_job_emptydir.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_job_emptydir.tf.erb index 7095215262ce..3da094327bf6 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_job_emptydir.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_job_emptydir.tf.erb @@ -2,6 +2,7 @@ resource "google_cloud_run_v2_job" "<%= ctx[:primary_resource_id] %>" { provider = google-beta name = "<%= ctx[:vars]['cloud_run_job_name'] %>" location = "us-central1" + deletion_protection = false launch_stage = "BETA" template { template { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_job_limits.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_job_limits.tf.erb index d68c75898eeb..ced507f858c6 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_job_limits.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_job_limits.tf.erb @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_job" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_job_name'] %>" location = "us-central1" + deletion_protection = false template { template { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_job_run_job.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_job_run_job.tf.erb index 16725f25fd99..51d19bb56b3a 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_job_run_job.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_job_run_job.tf.erb @@ -2,6 +2,7 @@ resource "google_cloud_run_v2_job" "<%= ctx[:primary_resource_id] %>" { provider = google-beta name = "<%= ctx[:vars]['cloud_run_job_name'] %>" location = "us-central1" + deletion_protection = false start_execution_token = "start-once-created" template { template { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_job_secret.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_job_secret.tf.erb index 102b4ee6dae0..325610803de3 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_job_secret.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_job_secret.tf.erb @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_job" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_job_name'] %>" location = "us-central1" + deletion_protection = false template { template { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_job_sql.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_job_sql.tf.erb index 235d596612df..db875e95ecb2 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_job_sql.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_job_sql.tf.erb @@ -1,7 +1,7 @@ resource "google_cloud_run_v2_job" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_job_name'] %>" location = "us-central1" - + deletion_protection = false template { template{ volumes { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_job_vpcaccess.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_job_vpcaccess.tf.erb index dad5db7c6c9f..6755d8559ccc 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_job_vpcaccess.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_job_vpcaccess.tf.erb @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_job" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_job_name'] %>" location = "us-central1" + deletion_protection = false template { template{ diff --git a/mmv1/templates/terraform/examples/cloudrunv2_service_basic.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_service_basic.tf.erb index ecddc0b4b972..e5ce45478ff6 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_service_basic.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_service_basic.tf.erb @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_service_name'] %>" location = "us-central1" + deletion_protection = false ingress = "INGRESS_TRAFFIC_ALL" template { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_service_custom_audiences.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_service_custom_audiences.tf.erb index 50445e63e7e5..d77d23beae67 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_service_custom_audiences.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_service_custom_audiences.tf.erb @@ -2,6 +2,7 @@ resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" { provider = google-beta name = "<%= ctx[:vars]['cloud_run_service_name'] %>" location = "us-central1" + deletion_protection = false launch_stage = "BETA" ingress = "INGRESS_TRAFFIC_ALL" diff --git a/mmv1/templates/terraform/examples/cloudrunv2_service_directvpc.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_service_directvpc.tf.erb index 530931f74504..8460569c6d0f 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_service_directvpc.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_service_directvpc.tf.erb @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_service_name'] %>" location = "us-central1" + deletion_protection = false launch_stage = "GA" template { containers { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_service_limits.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_service_limits.tf.erb index 30476a53159e..2c166453536f 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_service_limits.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_service_limits.tf.erb @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_service_name'] %>" location = "us-central1" + deletion_protection = false ingress = "INGRESS_TRAFFIC_ALL" template { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_service_mount_gcs.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_service_mount_gcs.tf.erb index 802110524ba3..396dd3a845af 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_service_mount_gcs.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_service_mount_gcs.tf.erb @@ -2,6 +2,7 @@ resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_service_name'] %>" location = "us-central1" + deletion_protection = false launch_stage = "BETA" template { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_service_mount_nfs.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_service_mount_nfs.tf.erb index 9f3451907065..e8c684382c97 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_service_mount_nfs.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_service_mount_nfs.tf.erb @@ -2,6 +2,7 @@ resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_service_name'] %>" location = "us-central1" + deletion_protection = false ingress = "INGRESS_TRAFFIC_ALL" launch_stage = "BETA" diff --git a/mmv1/templates/terraform/examples/cloudrunv2_service_multicontainer.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_service_multicontainer.tf.erb index c5d31ad40d13..6696c55c00ba 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_service_multicontainer.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_service_multicontainer.tf.erb @@ -2,6 +2,7 @@ resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" { provider = google-beta name = "<%= ctx[:vars]['cloud_run_service_name'] %>" location = "us-central1" + deletion_protection = false launch_stage = "BETA" ingress = "INGRESS_TRAFFIC_ALL" template { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_service_probes.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_service_probes.tf.erb index 22b763d5c052..7bab08c7ffa9 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_service_probes.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_service_probes.tf.erb @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_service_name'] %>" location = "us-central1" + deletion_protection = false template { containers { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_service_secret.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_service_secret.tf.erb index 5b06cd4ad619..5c89dbf447f6 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_service_secret.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_service_secret.tf.erb @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_service_name'] %>" location = "us-central1" + deletion_protection = false ingress = "INGRESS_TRAFFIC_ALL" template { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_service_sql.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_service_sql.tf.erb index 9a05e52a98f3..ff89c69f0a1a 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_service_sql.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_service_sql.tf.erb @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_service_name'] %>" location = "us-central1" + deletion_protection = false ingress = "INGRESS_TRAFFIC_ALL" template { diff --git a/mmv1/templates/terraform/examples/cloudrunv2_service_vpcaccess.tf.erb b/mmv1/templates/terraform/examples/cloudrunv2_service_vpcaccess.tf.erb index 416c4d3e1969..6573ae4bbcc2 100644 --- a/mmv1/templates/terraform/examples/cloudrunv2_service_vpcaccess.tf.erb +++ b/mmv1/templates/terraform/examples/cloudrunv2_service_vpcaccess.tf.erb @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['cloud_run_service_name'] %>" location = "us-central1" + deletion_protection = false template { containers { diff --git a/mmv1/templates/terraform/examples/compute_project_cloud_armor_tier_project_set.tf.erb b/mmv1/templates/terraform/examples/compute_project_cloud_armor_tier_project_set.tf.erb index 16122a86a963..ecd1950903d0 100644 --- a/mmv1/templates/terraform/examples/compute_project_cloud_armor_tier_project_set.tf.erb +++ b/mmv1/templates/terraform/examples/compute_project_cloud_armor_tier_project_set.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { diff --git a/mmv1/templates/terraform/examples/consumer_quota_override.tf.erb b/mmv1/templates/terraform/examples/consumer_quota_override.tf.erb index 1e6ed54a4599..366c3ca1c90e 100644 --- a/mmv1/templates/terraform/examples/consumer_quota_override.tf.erb +++ b/mmv1/templates/terraform/examples/consumer_quota_override.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "my_project" { name = "tf-test-project" project_id = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "google_service_usage_consumer_quota_override" "override" { diff --git a/mmv1/templates/terraform/examples/consumer_quota_override_custom_dimension.tf.erb b/mmv1/templates/terraform/examples/consumer_quota_override_custom_dimension.tf.erb index 156cbecae1ba..29542bdec03c 100644 --- a/mmv1/templates/terraform/examples/consumer_quota_override_custom_dimension.tf.erb +++ b/mmv1/templates/terraform/examples/consumer_quota_override_custom_dimension.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "my_project" { name = "tf-test-project" project_id = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "google_service_usage_consumer_quota_override" "override" { diff --git a/mmv1/templates/terraform/examples/consumer_quota_override_zero_value.tf.erb b/mmv1/templates/terraform/examples/consumer_quota_override_zero_value.tf.erb index 6bc2f6f00186..afab737e5575 100644 --- a/mmv1/templates/terraform/examples/consumer_quota_override_zero_value.tf.erb +++ b/mmv1/templates/terraform/examples/consumer_quota_override_zero_value.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "my_project" { name = "tf-test-project" project_id = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "google_service_usage_consumer_quota_override" "override" { diff --git a/mmv1/templates/terraform/examples/datastore_index.tf.erb b/mmv1/templates/terraform/examples/datastore_index.tf.erb deleted file mode 100644 index 8e1917ffad40..000000000000 --- a/mmv1/templates/terraform/examples/datastore_index.tf.erb +++ /dev/null @@ -1,26 +0,0 @@ -resource "google_firestore_database" "database" { - project = "<%= ctx[:test_env_vars]['project_id'] %>" - # google_datastore_index resources only support the (default) database. - # However, google_firestore_index can express any Datastore Mode index - # and should be preferred in all cases. - name = "(default)" - location_id = "nam5" - type = "DATASTORE_MODE" - - delete_protection_state = "DELETE_PROTECTION_DISABLED" - deletion_policy = "DELETE" -} - -resource "google_datastore_index" "<%= ctx[:primary_resource_id] %>" { - kind = "foo" - properties { - name = "<%= ctx[:vars]['property_name_1'] %>" - direction = "ASCENDING" - } - properties { - name = "<%= ctx[:vars]['property_name_2'] %>" - direction = "ASCENDING" - } - - depends_on = [google_firestore_database.database] -} diff --git a/mmv1/templates/terraform/examples/dialogflow_intent_full.tf.erb b/mmv1/templates/terraform/examples/dialogflow_intent_full.tf.erb index fc0560d4cbe4..d0364703f76c 100644 --- a/mmv1/templates/terraform/examples/dialogflow_intent_full.tf.erb +++ b/mmv1/templates/terraform/examples/dialogflow_intent_full.tf.erb @@ -2,6 +2,7 @@ resource "google_project" "agent_project" { project_id = "<%= ctx[:vars]['project_id'] %>" name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { diff --git a/mmv1/templates/terraform/examples/dns_managed_zone_private_multiproject.tf.erb b/mmv1/templates/terraform/examples/dns_managed_zone_private_multiproject.tf.erb index d22c70671f5b..49c51a8c3508 100644 --- a/mmv1/templates/terraform/examples/dns_managed_zone_private_multiproject.tf.erb +++ b/mmv1/templates/terraform/examples/dns_managed_zone_private_multiproject.tf.erb @@ -36,6 +36,7 @@ resource "google_project" "project_1" { project_id = "<%= ctx[:vars]['project_1_name'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project" "project_2" { @@ -43,6 +44,7 @@ resource "google_project" "project_2" { project_id = "<%= ctx[:vars]['project_2_name'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_compute_network" "network_1_project_1" { diff --git a/mmv1/templates/terraform/examples/dns_policy_multiproject.tf.erb b/mmv1/templates/terraform/examples/dns_policy_multiproject.tf.erb index cfedeccc7948..84e171274afe 100644 --- a/mmv1/templates/terraform/examples/dns_policy_multiproject.tf.erb +++ b/mmv1/templates/terraform/examples/dns_policy_multiproject.tf.erb @@ -30,6 +30,7 @@ resource "google_project" "project_1" { project_id = "<%= ctx[:vars]['project_1_name'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project" "project_2" { @@ -37,6 +38,7 @@ resource "google_project" "project_2" { project_id = "<%= ctx[:vars]['project_2_name'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_compute_network" "network_1_project_1" { diff --git a/mmv1/templates/terraform/examples/firebase_database_instance_default_database.tf.erb b/mmv1/templates/terraform/examples/firebase_database_instance_default_database.tf.erb index 6d691e3cbea5..a8cca389fc66 100644 --- a/mmv1/templates/terraform/examples/firebase_database_instance_default_database.tf.erb +++ b/mmv1/templates/terraform/examples/firebase_database_instance_default_database.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "default" { project_id = "<%= ctx[:vars]['project_id'] %>" name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" labels = { "firebase" = "enabled" } diff --git a/mmv1/templates/terraform/examples/firebase_project_basic.tf.erb b/mmv1/templates/terraform/examples/firebase_project_basic.tf.erb index 3334201307eb..39840aeaaefa 100644 --- a/mmv1/templates/terraform/examples/firebase_project_basic.tf.erb +++ b/mmv1/templates/terraform/examples/firebase_project_basic.tf.erb @@ -4,6 +4,7 @@ resource "google_project" "default" { project_id = "<%= ctx[:vars]['project_name'] %>" name = "<%= ctx[:vars]['project_name'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" labels = { "firebase" = "enabled" diff --git a/mmv1/templates/terraform/examples/firebasehosting_customdomain_cloud_run.tf.erb b/mmv1/templates/terraform/examples/firebasehosting_customdomain_cloud_run.tf.erb index c226ca54a7b8..df44959e46cf 100644 --- a/mmv1/templates/terraform/examples/firebasehosting_customdomain_cloud_run.tf.erb +++ b/mmv1/templates/terraform/examples/firebasehosting_customdomain_cloud_run.tf.erb @@ -18,6 +18,8 @@ resource "google_cloud_run_v2_service" "default" { image = "us-docker.pkg.dev/cloudrun/container/hello" } } + + deletion_protection = "<%= ctx[:vars]["deletion_protection"] %>" } resource "google_firebase_hosting_version" "default" { diff --git a/mmv1/templates/terraform/examples/firebasehosting_version_cloud_run.tf.erb b/mmv1/templates/terraform/examples/firebasehosting_version_cloud_run.tf.erb index 38da15944530..e8c32603ebad 100644 --- a/mmv1/templates/terraform/examples/firebasehosting_version_cloud_run.tf.erb +++ b/mmv1/templates/terraform/examples/firebasehosting_version_cloud_run.tf.erb @@ -18,6 +18,8 @@ resource "google_cloud_run_v2_service" "default" { image = "us-docker.pkg.dev/cloudrun/container/hello" } } + + deletion_protection = "<%= ctx[:vars]["deletion_protection"] %>" } resource "google_firebase_hosting_version" "default" { diff --git a/mmv1/templates/terraform/examples/firestore_document_basic.tf.erb b/mmv1/templates/terraform/examples/firestore_document_basic.tf.erb index 49aed49f7835..9302846d5497 100644 --- a/mmv1/templates/terraform/examples/firestore_document_basic.tf.erb +++ b/mmv1/templates/terraform/examples/firestore_document_basic.tf.erb @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "<%= ctx[:vars]['project_id'] %>" name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/templates/terraform/examples/firestore_document_nested_document.tf.erb b/mmv1/templates/terraform/examples/firestore_document_nested_document.tf.erb index c2e9d43a8192..9167ffcfa688 100644 --- a/mmv1/templates/terraform/examples/firestore_document_nested_document.tf.erb +++ b/mmv1/templates/terraform/examples/firestore_document_nested_document.tf.erb @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "<%= ctx[:vars]['project_id'] %>" name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/templates/terraform/examples/folder_access_approval_active_key_version.tf.erb b/mmv1/templates/terraform/examples/folder_access_approval_active_key_version.tf.erb index 474dc36b1b21..64f844f433c0 100644 --- a/mmv1/templates/terraform/examples/folder_access_approval_active_key_version.tf.erb +++ b/mmv1/templates/terraform/examples/folder_access_approval_active_key_version.tf.erb @@ -1,12 +1,14 @@ resource "google_folder" "my_folder" { display_name = "<%= ctx[:vars]['folder_name'] %>" parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" + deletion_protection = false } resource "google_project" "my_project" { name = "My Project" project_id = "your-project-id" folder_id = google_folder.my_folder.name + deletion_policy = "DELETE" } resource "google_kms_key_ring" "key_ring" { diff --git a/mmv1/templates/terraform/examples/folder_access_approval_full.tf.erb b/mmv1/templates/terraform/examples/folder_access_approval_full.tf.erb index 27927d1f06ec..140550f5a161 100644 --- a/mmv1/templates/terraform/examples/folder_access_approval_full.tf.erb +++ b/mmv1/templates/terraform/examples/folder_access_approval_full.tf.erb @@ -1,6 +1,7 @@ resource "google_folder" "my_folder" { display_name = "<%= ctx[:vars]['folder_name'] %>" parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" + deletion_protection = false } resource "google_folder_access_approval_settings" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/go/access_context_manager_access_policy_scoped.tf.tmpl b/mmv1/templates/terraform/examples/go/access_context_manager_access_policy_scoped.tf.tmpl index ba6eb1909505..b031c076fddc 100644 --- a/mmv1/templates/terraform/examples/go/access_context_manager_access_policy_scoped.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/access_context_manager_access_policy_scoped.tf.tmpl @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "{{index $.TestEnvVars "project"}}" name = "{{index $.TestEnvVars "project"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "google_access_context_manager_access_policy" "{{$.PrimaryResourceId}}" { diff --git a/mmv1/templates/terraform/examples/go/active_directory_domain_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/active_directory_domain_basic.tf.tmpl index 312e51b4ab75..25d7b18d8c8a 100644 --- a/mmv1/templates/terraform/examples/go/active_directory_domain_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/active_directory_domain_basic.tf.tmpl @@ -1,5 +1,6 @@ resource "google_active_directory_domain" "ad-domain" { domain_name = "{{index $.Vars "domain_name"}}.org.com" locations = ["us-central1"] - reserved_ip_range = "192.168.255.0/24" + reserved_ip_range = "192.168.255.0/24" + deletion_protection = false } \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/go/active_directory_peering_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/active_directory_peering_basic.tf.tmpl index 9a5436051f16..51c61dea4d78 100644 --- a/mmv1/templates/terraform/examples/go/active_directory_peering_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/active_directory_peering_basic.tf.tmpl @@ -39,4 +39,5 @@ resource "google_project" "peered-project" { project_id = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/go/alloydb_backup_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/alloydb_backup_basic_test.tf.tmpl index 3514822927c3..b09d5a4be7ef 100644 --- a/mmv1/templates/terraform/examples/go/alloydb_backup_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/alloydb_backup_basic_test.tf.tmpl @@ -9,7 +9,9 @@ resource "google_alloydb_backup" "{{$.PrimaryResourceId}}" { resource "google_alloydb_cluster" "{{$.PrimaryResourceId}}" { cluster_id = "{{index $.Vars "alloydb_cluster_name"}}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "{{$.PrimaryResourceId}}" { diff --git a/mmv1/templates/terraform/examples/go/alloydb_backup_full_test.tf.tmpl b/mmv1/templates/terraform/examples/go/alloydb_backup_full_test.tf.tmpl index 089e04ee0177..218bc7ee3bed 100644 --- a/mmv1/templates/terraform/examples/go/alloydb_backup_full_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/alloydb_backup_full_test.tf.tmpl @@ -14,7 +14,9 @@ resource "google_alloydb_backup" "{{$.PrimaryResourceId}}" { resource "google_alloydb_cluster" "{{$.PrimaryResourceId}}" { cluster_id = "{{index $.Vars "alloydb_cluster_name"}}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "{{$.PrimaryResourceId}}" { diff --git a/mmv1/templates/terraform/examples/go/alloydb_cluster_restore.tf.tmpl b/mmv1/templates/terraform/examples/go/alloydb_cluster_restore.tf.tmpl index 2b3842496b21..ad96d25ec95e 100644 --- a/mmv1/templates/terraform/examples/go/alloydb_cluster_restore.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/alloydb_cluster_restore.tf.tmpl @@ -42,7 +42,9 @@ resource "google_alloydb_cluster" "restored_from_backup" { resource "google_alloydb_cluster" "restored_via_pitr" { cluster_id = "{{index $.Vars "alloydb_pitr_restored_cluster_name"}}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.{{$.PrimaryResourceId}}.name diff --git a/mmv1/templates/terraform/examples/go/alloydb_instance_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/alloydb_instance_basic_test.tf.tmpl index c45404a0e56a..7c2b09d69979 100644 --- a/mmv1/templates/terraform/examples/go/alloydb_instance_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/alloydb_instance_basic_test.tf.tmpl @@ -11,7 +11,9 @@ resource "google_alloydb_instance" "{{$.PrimaryResourceId}}" { resource "google_alloydb_cluster" "{{$.PrimaryResourceId}}" { cluster_id = "{{index $.Vars "alloydb_cluster_name"}}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "{{index $.Vars "alloydb_cluster_name"}}" diff --git a/mmv1/templates/terraform/examples/go/alloydb_secondary_cluster_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/alloydb_secondary_cluster_basic.tf.tmpl index 6388355ea837..6911d955d778 100644 --- a/mmv1/templates/terraform/examples/go/alloydb_secondary_cluster_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/alloydb_secondary_cluster_basic.tf.tmpl @@ -1,7 +1,9 @@ resource "google_alloydb_cluster" "primary" { cluster_id = "{{index $.Vars "alloydb_primary_cluster_name"}}" location = "us-central1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -19,7 +21,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "{{$.PrimaryResourceId}}" { cluster_id = "{{index $.Vars "alloydb_secondary_cluster_name"}}" location = "us-east1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/mmv1/templates/terraform/examples/go/alloydb_secondary_cluster_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/alloydb_secondary_cluster_basic_test.tf.tmpl index 1b61bfe253b6..9b04de5953d4 100644 --- a/mmv1/templates/terraform/examples/go/alloydb_secondary_cluster_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/alloydb_secondary_cluster_basic_test.tf.tmpl @@ -1,7 +1,9 @@ resource "google_alloydb_cluster" "primary" { cluster_id = "{{index $.Vars "alloydb_primary_cluster_name"}}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -17,7 +19,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "{{$.PrimaryResourceId}}" { cluster_id = "{{index $.Vars "alloydb_secondary_cluster_name"}}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/mmv1/templates/terraform/examples/go/alloydb_secondary_instance_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/alloydb_secondary_instance_basic.tf.tmpl index cc3599ff181a..8b202bad443e 100644 --- a/mmv1/templates/terraform/examples/go/alloydb_secondary_instance_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/alloydb_secondary_instance_basic.tf.tmpl @@ -1,7 +1,9 @@ resource "google_alloydb_cluster" "primary" { cluster_id = "{{index $.Vars "alloydb_primary_cluster_name"}}" location = "us-central1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -19,7 +21,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "{{index $.Vars "alloydb_secondary_cluster_name"}}" location = "us-east1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/mmv1/templates/terraform/examples/go/alloydb_secondary_instance_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/alloydb_secondary_instance_basic_test.tf.tmpl index 7298d9f03e40..432fd4d91e80 100644 --- a/mmv1/templates/terraform/examples/go/alloydb_secondary_instance_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/alloydb_secondary_instance_basic_test.tf.tmpl @@ -1,7 +1,9 @@ resource "google_alloydb_cluster" "primary" { cluster_id = "{{index $.Vars "alloydb_primary_cluster_name"}}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -17,7 +19,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "{{index $.Vars "alloydb_secondary_cluster_name"}}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/mmv1/templates/terraform/examples/go/alloydb_user_builtin.tf.tmpl b/mmv1/templates/terraform/examples/go/alloydb_user_builtin.tf.tmpl index 0bda58624664..6ae9ee261194 100644 --- a/mmv1/templates/terraform/examples/go/alloydb_user_builtin.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/alloydb_user_builtin.tf.tmpl @@ -9,7 +9,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "{{index $.Vars "alloydb_cluster_name"}}" location = "us-central1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } initial_user { password = "{{index $.Vars "alloydb_cluster_pass"}}" diff --git a/mmv1/templates/terraform/examples/go/alloydb_user_builtin_test.tf.tmpl b/mmv1/templates/terraform/examples/go/alloydb_user_builtin_test.tf.tmpl index 6a67312f2ef9..a46757d8a79e 100644 --- a/mmv1/templates/terraform/examples/go/alloydb_user_builtin_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/alloydb_user_builtin_test.tf.tmpl @@ -7,7 +7,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "{{index $.Vars "alloydb_cluster_name"}}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "{{index $.Vars "alloydb_cluster_pass"}}" diff --git a/mmv1/templates/terraform/examples/go/alloydb_user_iam.tf.tmpl b/mmv1/templates/terraform/examples/go/alloydb_user_iam.tf.tmpl index 98747b69e4ee..107cdaf25b3f 100644 --- a/mmv1/templates/terraform/examples/go/alloydb_user_iam.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/alloydb_user_iam.tf.tmpl @@ -9,7 +9,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "{{index $.Vars "alloydb_cluster_name"}}" location = "us-central1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } initial_user { password = "{{index $.Vars "alloydb_cluster_pass"}}" diff --git a/mmv1/templates/terraform/examples/go/alloydb_user_iam_test.tf.tmpl b/mmv1/templates/terraform/examples/go/alloydb_user_iam_test.tf.tmpl index 94b602f04c17..e3b2b4743180 100644 --- a/mmv1/templates/terraform/examples/go/alloydb_user_iam_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/alloydb_user_iam_test.tf.tmpl @@ -7,7 +7,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "{{index $.Vars "alloydb_cluster_name"}}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "{{index $.Vars "alloydb_cluster_pass"}}" diff --git a/mmv1/templates/terraform/examples/go/apigee_addons_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_addons_test.tf.tmpl index 4312512591c3..7dd26447e516 100644 --- a/mmv1/templates/terraform/examples/go/apigee_addons_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_addons_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_endpoint_attachment_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_endpoint_attachment_basic_test.tf.tmpl index da403eb64ef7..613a4a98606f 100644 --- a/mmv1/templates/terraform/examples/go/apigee_endpoint_attachment_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_endpoint_attachment_basic_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_env_keystore_alias_self_signed_cert.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_env_keystore_alias_self_signed_cert.tf.tmpl index 2e2ccacf9bfb..4cffd3f021e3 100644 --- a/mmv1/templates/terraform/examples/go/apigee_env_keystore_alias_self_signed_cert.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_env_keystore_alias_self_signed_cert.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_environment_basic_deployment_apiproxy_type_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_environment_basic_deployment_apiproxy_type_test.tf.tmpl index 4899f8167119..c1e4045d48c5 100644 --- a/mmv1/templates/terraform/examples/go/apigee_environment_basic_deployment_apiproxy_type_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_environment_basic_deployment_apiproxy_type_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_environment_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_environment_basic_test.tf.tmpl index 5b510fe6a2c7..ff63f69ed691 100644 --- a/mmv1/templates/terraform/examples/go/apigee_environment_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_environment_basic_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_environment_group_attachment_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_environment_group_attachment_basic.tf.tmpl index 173f42d34b56..d008def35c06 100644 --- a/mmv1/templates/terraform/examples/go/apigee_environment_group_attachment_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_environment_group_attachment_basic.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_environment_group_attachment_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_environment_group_attachment_basic_test.tf.tmpl index 0372045cf58f..611e1a31136f 100644 --- a/mmv1/templates/terraform/examples/go/apigee_environment_group_attachment_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_environment_group_attachment_basic_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_environment_group_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_environment_group_basic_test.tf.tmpl index 2399abcbbc81..6118cc0b6c98 100644 --- a/mmv1/templates/terraform/examples/go/apigee_environment_group_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_environment_group_basic_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_environment_keystore_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_environment_keystore_test.tf.tmpl index 715b93230502..3806673a0c61 100644 --- a/mmv1/templates/terraform/examples/go/apigee_environment_keystore_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_environment_keystore_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_environment_patch_update_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_environment_patch_update_test.tf.tmpl index 62f000185328..d2bb56710d93 100644 --- a/mmv1/templates/terraform/examples/go/apigee_environment_patch_update_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_environment_patch_update_test.tf.tmpl @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_environment_reference_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_environment_reference_test.tf.tmpl index 2ce22afb50d6..2acd802bba19 100644 --- a/mmv1/templates/terraform/examples/go/apigee_environment_reference_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_environment_reference_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_environment_type_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_environment_type_test.tf.tmpl index 9bff358f70f0..8e0a87c5e0aa 100644 --- a/mmv1/templates/terraform/examples/go/apigee_environment_type_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_environment_type_test.tf.tmpl @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_instance_attachment_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_instance_attachment_basic.tf.tmpl index c245b1b8c59c..9c535fae47c7 100644 --- a/mmv1/templates/terraform/examples/go/apigee_instance_attachment_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_instance_attachment_basic.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_instance_attachment_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_instance_attachment_basic_test.tf.tmpl index 691d9485db61..b70cf9d4d3b4 100644 --- a/mmv1/templates/terraform/examples/go/apigee_instance_attachment_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_instance_attachment_basic_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_instance_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_instance_basic_test.tf.tmpl index d9d4273f89f4..2c8e0d988950 100644 --- a/mmv1/templates/terraform/examples/go/apigee_instance_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_instance_basic_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_instance_cidr_range_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_instance_cidr_range_test.tf.tmpl index ac11534b18f2..6136c01baeac 100644 --- a/mmv1/templates/terraform/examples/go/apigee_instance_cidr_range_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_instance_cidr_range_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_instance_full_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_instance_full_test.tf.tmpl index 0a2b9b0ce1f9..80ee6da8ae87 100644 --- a/mmv1/templates/terraform/examples/go/apigee_instance_full_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_instance_full_test.tf.tmpl @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_instance_ip_range_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_instance_ip_range_test.tf.tmpl index 45077f0bcc56..edb467cc02f5 100644 --- a/mmv1/templates/terraform/examples/go/apigee_instance_ip_range_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_instance_ip_range_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_instance_service_attachment_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_instance_service_attachment_basic_test.tf.tmpl index 94b875d626be..1a4cfddcba23 100644 --- a/mmv1/templates/terraform/examples/go/apigee_instance_service_attachment_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_instance_service_attachment_basic_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_nat_address_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_nat_address_basic_test.tf.tmpl index 505f4e07c7ec..ce2a4f9206f8 100644 --- a/mmv1/templates/terraform/examples/go/apigee_nat_address_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_nat_address_basic_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_organization_cloud_basic_disable_vpc_peering_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_organization_cloud_basic_disable_vpc_peering_test.tf.tmpl index 013329cc595e..5b5b6adf8ea2 100644 --- a/mmv1/templates/terraform/examples/go/apigee_organization_cloud_basic_disable_vpc_peering_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_organization_cloud_basic_disable_vpc_peering_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_organization_cloud_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_organization_cloud_basic_test.tf.tmpl index 97cf9790c9c2..508d8899f826 100644 --- a/mmv1/templates/terraform/examples/go/apigee_organization_cloud_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_organization_cloud_basic_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_organization_cloud_full_disable_vpc_peering_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_organization_cloud_full_disable_vpc_peering_test.tf.tmpl index de620539eef3..457d32a0aefa 100644 --- a/mmv1/templates/terraform/examples/go/apigee_organization_cloud_full_disable_vpc_peering_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_organization_cloud_full_disable_vpc_peering_test.tf.tmpl @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_organization_cloud_full_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_organization_cloud_full_test.tf.tmpl index 70ef75f38fca..4e193a9658bc 100644 --- a/mmv1/templates/terraform/examples/go/apigee_organization_cloud_full_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_organization_cloud_full_test.tf.tmpl @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_organization_drz_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_organization_drz_test.tf.tmpl index 280e00517261..269b2bfe70ba 100644 --- a/mmv1/templates/terraform/examples/go/apigee_organization_drz_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_organization_drz_test.tf.tmpl @@ -9,6 +9,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_organization_retention_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_organization_retention_test.tf.tmpl index 482896c22f35..95f5f38fb758 100644 --- a/mmv1/templates/terraform/examples/go/apigee_organization_retention_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_organization_retention_test.tf.tmpl @@ -5,6 +5,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_sync_authorization_basic_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_sync_authorization_basic_test.tf.tmpl index f8e15b09457d..277bdf85022e 100644 --- a/mmv1/templates/terraform/examples/go/apigee_sync_authorization_basic_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_sync_authorization_basic_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_target_server_test.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_target_server_test.tf.tmpl index d18b8ca6a11b..3930cc27ff5a 100644 --- a/mmv1/templates/terraform/examples/go/apigee_target_server_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_target_server_test.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/apigee_target_server_test_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/apigee_target_server_test_basic.tf.tmpl index b456180b129d..f5d53555ed45 100644 --- a/mmv1/templates/terraform/examples/go/apigee_target_server_test_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apigee_target_server_test_basic.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/templates/terraform/examples/go/app_engine_firewall_rule_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/app_engine_firewall_rule_basic.tf.tmpl index 3a0850c57aae..65ff5428d7bb 100644 --- a/mmv1/templates/terraform/examples/go/app_engine_firewall_rule_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/app_engine_firewall_rule_basic.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "my_project" { project_id = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_app_engine_application" "app" { diff --git a/mmv1/templates/terraform/examples/go/app_engine_flexible_app_version.tf.tmpl b/mmv1/templates/terraform/examples/go/app_engine_flexible_app_version.tf.tmpl index c5d1d2098ec0..242bdbd85d13 100644 --- a/mmv1/templates/terraform/examples/go/app_engine_flexible_app_version.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/app_engine_flexible_app_version.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "my_project" { project_id = "{{index $.Vars "project"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_app_engine_application" "app" { diff --git a/mmv1/templates/terraform/examples/go/apphub_service_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/apphub_service_basic.tf.tmpl index 37cb491126ae..0c11196256e0 100644 --- a/mmv1/templates/terraform/examples/go/apphub_service_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apphub_service_basic.tf.tmpl @@ -11,6 +11,7 @@ resource "google_project" "service_project" { name = "Service Project" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } # Enable Compute API diff --git a/mmv1/templates/terraform/examples/go/apphub_service_full.tf.tmpl b/mmv1/templates/terraform/examples/go/apphub_service_full.tf.tmpl index 8a0807d03794..e9a8ee7e82ef 100644 --- a/mmv1/templates/terraform/examples/go/apphub_service_full.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apphub_service_full.tf.tmpl @@ -11,6 +11,7 @@ resource "google_project" "service_project" { name = "Service Project" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } # Enable Compute API diff --git a/mmv1/templates/terraform/examples/go/apphub_service_project_attachment_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/apphub_service_project_attachment_basic.tf.tmpl index d62798e1a249..f70836d2f6bb 100644 --- a/mmv1/templates/terraform/examples/go/apphub_service_project_attachment_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apphub_service_project_attachment_basic.tf.tmpl @@ -7,6 +7,7 @@ resource "google_project" "service_project" { project_id ="{{index $.Vars "service_project_attachment_id"}}" name = "Service Project" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "time_sleep" "wait_120s" { diff --git a/mmv1/templates/terraform/examples/go/apphub_service_project_attachment_full.tf.tmpl b/mmv1/templates/terraform/examples/go/apphub_service_project_attachment_full.tf.tmpl index 5577a71f60e4..080cc3ff9072 100644 --- a/mmv1/templates/terraform/examples/go/apphub_service_project_attachment_full.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apphub_service_project_attachment_full.tf.tmpl @@ -8,6 +8,7 @@ resource "google_project" "service_project_full" { project_id ="{{index $.Vars "service_project_attachment_id"}}" name = "Service Project Full" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "time_sleep" "wait_120s" { diff --git a/mmv1/templates/terraform/examples/go/apphub_workload_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/apphub_workload_basic.tf.tmpl index 9006e8db8ea4..392395e8017e 100644 --- a/mmv1/templates/terraform/examples/go/apphub_workload_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apphub_workload_basic.tf.tmpl @@ -11,6 +11,7 @@ resource "google_project" "service_project" { name = "Service Project" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } # Enable Compute API diff --git a/mmv1/templates/terraform/examples/go/apphub_workload_full.tf.tmpl b/mmv1/templates/terraform/examples/go/apphub_workload_full.tf.tmpl index 9d179903e1a8..ca13f5699c30 100644 --- a/mmv1/templates/terraform/examples/go/apphub_workload_full.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/apphub_workload_full.tf.tmpl @@ -11,6 +11,7 @@ resource "google_project" "service_project" { name = "Service Project" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } # Enable Compute API diff --git a/mmv1/templates/terraform/examples/go/billing_project_info_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/billing_project_info_basic.tf.tmpl index ff23a6ca4bb8..df607cce8e6f 100644 --- a/mmv1/templates/terraform/examples/go/billing_project_info_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/billing_project_info_basic.tf.tmpl @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "tf-test%{random_suffix}" name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" lifecycle { ignore_changes = [billing_account] } diff --git a/mmv1/templates/terraform/examples/go/cloud_asset_folder_feed.tf.tmpl b/mmv1/templates/terraform/examples/go/cloud_asset_folder_feed.tf.tmpl index 3666a76bff71..a164c381c778 100644 --- a/mmv1/templates/terraform/examples/go/cloud_asset_folder_feed.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloud_asset_folder_feed.tf.tmpl @@ -37,6 +37,7 @@ resource "google_pubsub_topic" "feed_output" { resource "google_folder" "my_folder" { display_name = "{{index $.Vars "folder_name"}}" parent = "organizations/{{index $.TestEnvVars "org_id"}}" + deletion_protection = false } # Find the project number of the project whose identity will be used for sending diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_job_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_job_basic.tf.tmpl index 69c80116cd54..f32711e510d1 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_job_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_job_basic.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_job" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_job_name"}}" location = "us-central1" + deletion_protection = false template { template { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_job_directvpc.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_job_directvpc.tf.tmpl index 4a869bf081d1..3c8ca197aaef 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_job_directvpc.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_job_directvpc.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_job" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_job_name"}}" location = "us-central1" + deletion_protection = false launch_stage = "GA" template { template{ diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_job_emptydir.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_job_emptydir.tf.tmpl index 7231e35938a0..fbabbe991fd8 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_job_emptydir.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_job_emptydir.tf.tmpl @@ -2,6 +2,7 @@ resource "google_cloud_run_v2_job" "{{$.PrimaryResourceId}}" { provider = google-beta name = "{{index $.Vars "cloud_run_job_name"}}" location = "us-central1" + deletion_protection = false launch_stage = "BETA" template { template { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_job_limits.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_job_limits.tf.tmpl index 5d2ae17ba840..c1ba237176f3 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_job_limits.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_job_limits.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_job" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_job_name"}}" location = "us-central1" + deletion_protection = false template { template { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_job_run_job.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_job_run_job.tf.tmpl index 329025cdb242..438eeab91d8f 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_job_run_job.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_job_run_job.tf.tmpl @@ -2,6 +2,7 @@ resource "google_cloud_run_v2_job" "{{$.PrimaryResourceId}}" { provider = google-beta name = "{{index $.Vars "cloud_run_job_name"}}" location = "us-central1" + deletion_protection = false start_execution_token = "start-once-created" template { template { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_job_secret.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_job_secret.tf.tmpl index 34a753f31bba..520ef2410540 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_job_secret.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_job_secret.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_job" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_job_name"}}" location = "us-central1" + deletion_protection = false template { template { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_job_sql.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_job_sql.tf.tmpl index e1f652e4145c..3dd95f7ce2ca 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_job_sql.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_job_sql.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_job" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_job_name"}}" location = "us-central1" + deletion_protection = false template { template{ diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_job_vpcaccess.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_job_vpcaccess.tf.tmpl index a2f00a6fdf6f..39cbc126eaf9 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_job_vpcaccess.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_job_vpcaccess.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_job" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_job_name"}}" location = "us-central1" + deletion_protection = false template { template{ diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_service_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_service_basic.tf.tmpl index dbcff1f1a3f9..2949efc82151 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_service_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_service_basic.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_service_name"}}" location = "us-central1" + deletion_protection = false ingress = "INGRESS_TRAFFIC_ALL" template { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_service_custom_audiences.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_service_custom_audiences.tf.tmpl index 4b511b8a92de..7530526f6b0c 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_service_custom_audiences.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_service_custom_audiences.tf.tmpl @@ -2,6 +2,7 @@ resource "google_cloud_run_v2_service" "{{$.PrimaryResourceId}}" { provider = google-beta name = "{{index $.Vars "cloud_run_service_name"}}" location = "us-central1" + deletion_protection = false launch_stage = "BETA" ingress = "INGRESS_TRAFFIC_ALL" diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_service_directvpc.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_service_directvpc.tf.tmpl index 502ffc36f77a..5fbee602618e 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_service_directvpc.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_service_directvpc.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_service_name"}}" location = "us-central1" + deletion_protection = false launch_stage = "GA" template { containers { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_service_limits.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_service_limits.tf.tmpl index 12ccb1d11ae0..5929b55b4757 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_service_limits.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_service_limits.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_service_name"}}" location = "us-central1" + deletion_protection = false ingress = "INGRESS_TRAFFIC_ALL" template { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_service_mount_gcs.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_service_mount_gcs.tf.tmpl index 8921ad840b10..8a2b39996a0d 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_service_mount_gcs.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_service_mount_gcs.tf.tmpl @@ -2,6 +2,7 @@ resource "google_cloud_run_v2_service" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_service_name"}}" location = "us-central1" + deletion_protection = false launch_stage = "BETA" template { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_service_mount_nfs.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_service_mount_nfs.tf.tmpl index c1cd7667cfcc..fa77b3569c35 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_service_mount_nfs.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_service_mount_nfs.tf.tmpl @@ -2,6 +2,7 @@ resource "google_cloud_run_v2_service" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_service_name"}}" location = "us-central1" + deletion_protection = false ingress = "INGRESS_TRAFFIC_ALL" launch_stage = "BETA" diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_service_multicontainer.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_service_multicontainer.tf.tmpl index b34230a8d239..9ee26f40bda1 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_service_multicontainer.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_service_multicontainer.tf.tmpl @@ -2,6 +2,7 @@ resource "google_cloud_run_v2_service" "{{$.PrimaryResourceId}}" { provider = google-beta name = "{{index $.Vars "cloud_run_service_name"}}" location = "us-central1" + deletion_protection = false launch_stage = "BETA" ingress = "INGRESS_TRAFFIC_ALL" template { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_service_probes.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_service_probes.tf.tmpl index 51edcd7a8aef..7c4adc1f1e6d 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_service_probes.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_service_probes.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_service_name"}}" location = "us-central1" + deletion_protection = false template { containers { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_service_secret.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_service_secret.tf.tmpl index a350573ecd8c..6755d1de94d7 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_service_secret.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_service_secret.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_service_name"}}" location = "us-central1" + deletion_protection = false ingress = "INGRESS_TRAFFIC_ALL" template { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_service_sql.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_service_sql.tf.tmpl index 7c3da92a2ccf..6c873e5696e2 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_service_sql.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_service_sql.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_service_name"}}" location = "us-central1" + deletion_protection = false ingress = "INGRESS_TRAFFIC_ALL" template { diff --git a/mmv1/templates/terraform/examples/go/cloudrunv2_service_vpcaccess.tf.tmpl b/mmv1/templates/terraform/examples/go/cloudrunv2_service_vpcaccess.tf.tmpl index 537ecb3c28bf..cc005f756b99 100644 --- a/mmv1/templates/terraform/examples/go/cloudrunv2_service_vpcaccess.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/cloudrunv2_service_vpcaccess.tf.tmpl @@ -1,6 +1,7 @@ resource "google_cloud_run_v2_service" "{{$.PrimaryResourceId}}" { name = "{{index $.Vars "cloud_run_service_name"}}" location = "us-central1" + deletion_protection = false template { containers { diff --git a/mmv1/templates/terraform/examples/go/compute_project_cloud_armor_tier_project_set.tf.tmpl b/mmv1/templates/terraform/examples/go/compute_project_cloud_armor_tier_project_set.tf.tmpl index a92fbbb8d92c..15afc43b736e 100644 --- a/mmv1/templates/terraform/examples/go/compute_project_cloud_armor_tier_project_set.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/compute_project_cloud_armor_tier_project_set.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { diff --git a/mmv1/templates/terraform/examples/go/consumer_quota_override.tf.tmpl b/mmv1/templates/terraform/examples/go/consumer_quota_override.tf.tmpl index 487659dc7297..95c967625eed 100644 --- a/mmv1/templates/terraform/examples/go/consumer_quota_override.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/consumer_quota_override.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "my_project" { name = "tf-test-project" project_id = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "google_service_usage_consumer_quota_override" "override" { diff --git a/mmv1/templates/terraform/examples/go/consumer_quota_override_custom_dimension.tf.tmpl b/mmv1/templates/terraform/examples/go/consumer_quota_override_custom_dimension.tf.tmpl index 714b2c414c64..6fd2996027cc 100644 --- a/mmv1/templates/terraform/examples/go/consumer_quota_override_custom_dimension.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/consumer_quota_override_custom_dimension.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "my_project" { name = "tf-test-project" project_id = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "google_service_usage_consumer_quota_override" "override" { diff --git a/mmv1/templates/terraform/examples/go/consumer_quota_override_zero_value.tf.tmpl b/mmv1/templates/terraform/examples/go/consumer_quota_override_zero_value.tf.tmpl index 23237c9729ce..7c79a3180b36 100644 --- a/mmv1/templates/terraform/examples/go/consumer_quota_override_zero_value.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/consumer_quota_override_zero_value.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "my_project" { name = "tf-test-project" project_id = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "google_service_usage_consumer_quota_override" "override" { diff --git a/mmv1/templates/terraform/examples/go/datastore_index.tf.tmpl b/mmv1/templates/terraform/examples/go/datastore_index.tf.tmpl deleted file mode 100644 index d66ba3a1144a..000000000000 --- a/mmv1/templates/terraform/examples/go/datastore_index.tf.tmpl +++ /dev/null @@ -1,26 +0,0 @@ -resource "google_firestore_database" "database" { - project = "{{index $.TestEnvVars "project_id"}}" - # google_datastore_index resources only support the (default) database. - # However, google_firestore_index can express any Datastore Mode index - # and should be preferred in all cases. - name = "(default)" - location_id = "nam5" - type = "DATASTORE_MODE" - - delete_protection_state = "DELETE_PROTECTION_DISABLED" - deletion_policy = "DELETE" -} - -resource "google_datastore_index" "{{$.PrimaryResourceId}}" { - kind = "foo" - properties { - name = "{{index $.Vars "property_name_1"}}" - direction = "ASCENDING" - } - properties { - name = "{{index $.Vars "property_name_2"}}" - direction = "ASCENDING" - } - - depends_on = [google_firestore_database.database] -} diff --git a/mmv1/templates/terraform/examples/go/dialogflow_intent_full.tf.tmpl b/mmv1/templates/terraform/examples/go/dialogflow_intent_full.tf.tmpl index c46b0a27c917..9fcbced7f5a0 100644 --- a/mmv1/templates/terraform/examples/go/dialogflow_intent_full.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/dialogflow_intent_full.tf.tmpl @@ -2,6 +2,7 @@ resource "google_project" "agent_project" { project_id = "{{index $.Vars "project_id"}}" name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { diff --git a/mmv1/templates/terraform/examples/go/dns_managed_zone_private_multiproject.tf.tmpl b/mmv1/templates/terraform/examples/go/dns_managed_zone_private_multiproject.tf.tmpl index 4aa0b22e0ce5..692a8ef0864e 100644 --- a/mmv1/templates/terraform/examples/go/dns_managed_zone_private_multiproject.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/dns_managed_zone_private_multiproject.tf.tmpl @@ -36,6 +36,7 @@ resource "google_project" "project_1" { project_id = "{{index $.Vars "project_1_name"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project" "project_2" { @@ -43,6 +44,7 @@ resource "google_project" "project_2" { project_id = "{{index $.Vars "project_2_name"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_compute_network" "network_1_project_1" { diff --git a/mmv1/templates/terraform/examples/go/dns_policy_multiproject.tf.tmpl b/mmv1/templates/terraform/examples/go/dns_policy_multiproject.tf.tmpl index 235066c9d50f..74be0624fdc8 100644 --- a/mmv1/templates/terraform/examples/go/dns_policy_multiproject.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/dns_policy_multiproject.tf.tmpl @@ -30,6 +30,7 @@ resource "google_project" "project_1" { project_id = "{{index $.Vars "project_1_name"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project" "project_2" { @@ -37,6 +38,7 @@ resource "google_project" "project_2" { project_id = "{{index $.Vars "project_2_name"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_compute_network" "network_1_project_1" { diff --git a/mmv1/templates/terraform/examples/go/firebase_database_instance_default_database.tf.tmpl b/mmv1/templates/terraform/examples/go/firebase_database_instance_default_database.tf.tmpl index 90d7fd0f5a29..083fa263b42d 100644 --- a/mmv1/templates/terraform/examples/go/firebase_database_instance_default_database.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/firebase_database_instance_default_database.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "default" { project_id = "{{index $.Vars "project_id"}}" name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" labels = { "firebase" = "enabled" } diff --git a/mmv1/templates/terraform/examples/go/firebase_project_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/firebase_project_basic.tf.tmpl index 045e9f84a588..46a2cb2d62b4 100644 --- a/mmv1/templates/terraform/examples/go/firebase_project_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/firebase_project_basic.tf.tmpl @@ -4,6 +4,7 @@ resource "google_project" "default" { project_id = "{{index $.Vars "project_name"}}" name = "{{index $.Vars "project_name"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" labels = { "firebase" = "enabled" diff --git a/mmv1/templates/terraform/examples/go/firestore_document_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/firestore_document_basic.tf.tmpl index c9a43f186d74..34f54c069258 100644 --- a/mmv1/templates/terraform/examples/go/firestore_document_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/firestore_document_basic.tf.tmpl @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "{{index $.Vars "project_id"}}" name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/templates/terraform/examples/go/firestore_document_nested_document.tf.tmpl b/mmv1/templates/terraform/examples/go/firestore_document_nested_document.tf.tmpl index 3d97035fa01a..c49b4e96b329 100644 --- a/mmv1/templates/terraform/examples/go/firestore_document_nested_document.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/firestore_document_nested_document.tf.tmpl @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "{{index $.Vars "project_id"}}" name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/templates/terraform/examples/go/folder_access_approval_active_key_version.tf.tmpl b/mmv1/templates/terraform/examples/go/folder_access_approval_active_key_version.tf.tmpl index dc2770e2b6d8..64d4f3a55e47 100644 --- a/mmv1/templates/terraform/examples/go/folder_access_approval_active_key_version.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/folder_access_approval_active_key_version.tf.tmpl @@ -1,12 +1,14 @@ resource "google_folder" "my_folder" { display_name = "{{index $.Vars "folder_name"}}" parent = "organizations/{{index $.TestEnvVars "org_id"}}" + deletion_protection = false } resource "google_project" "my_project" { name = "My Project" project_id = "your-project-id" folder_id = google_folder.my_folder.name + deletion_policy = "DELETE" } resource "google_kms_key_ring" "key_ring" { diff --git a/mmv1/templates/terraform/examples/go/folder_access_approval_full.tf.tmpl b/mmv1/templates/terraform/examples/go/folder_access_approval_full.tf.tmpl index 5bce3c5e52a2..fc08b3dee4f8 100644 --- a/mmv1/templates/terraform/examples/go/folder_access_approval_full.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/folder_access_approval_full.tf.tmpl @@ -1,6 +1,7 @@ resource "google_folder" "my_folder" { display_name = "{{index $.Vars "folder_name"}}" parent = "organizations/{{index $.TestEnvVars "org_id"}}" + deletion_protection = false } resource "google_folder_access_approval_settings" "{{$.PrimaryResourceId}}" { diff --git a/mmv1/templates/terraform/examples/go/iam_access_boundary_policy_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/iam_access_boundary_policy_basic.tf.tmpl index 7d5a95ef331d..d988b22f66e3 100644 --- a/mmv1/templates/terraform/examples/go/iam_access_boundary_policy_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/iam_access_boundary_policy_basic.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_access_context_manager_access_level" "test-access" { diff --git a/mmv1/templates/terraform/examples/go/iam_deny_policy_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/iam_deny_policy_basic.tf.tmpl index cb88784e1f17..90536245f8fb 100644 --- a/mmv1/templates/terraform/examples/go/iam_deny_policy_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/iam_deny_policy_basic.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "{{index $.Vars "project_name"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_iam_deny_policy" "{{$.PrimaryResourceId}}" { diff --git a/mmv1/templates/terraform/examples/go/iap_app_engine_service.tf.tmpl b/mmv1/templates/terraform/examples/go/iap_app_engine_service.tf.tmpl index dff90f5307e6..96f9c87817eb 100644 --- a/mmv1/templates/terraform/examples/go/iap_app_engine_service.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/iap_app_engine_service.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "my_project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "project_service" { diff --git a/mmv1/templates/terraform/examples/go/iap_appengine.tf.tmpl b/mmv1/templates/terraform/examples/go/iap_appengine.tf.tmpl index f63aa36038ea..45ad554567ec 100644 --- a/mmv1/templates/terraform/examples/go/iap_appengine.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/iap_appengine.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/templates/terraform/examples/go/iap_brand.tf.tmpl b/mmv1/templates/terraform/examples/go/iap_brand.tf.tmpl index c84d3f3c5830..feec98ca93c8 100644 --- a/mmv1/templates/terraform/examples/go/iap_brand.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/iap_brand.tf.tmpl @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "{{index $.Vars "project_id"}}" name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "google_project_service" "project_service" { diff --git a/mmv1/templates/terraform/examples/go/iap_client.tf.tmpl b/mmv1/templates/terraform/examples/go/iap_client.tf.tmpl index 2f1b53827816..88af2235248c 100644 --- a/mmv1/templates/terraform/examples/go/iap_client.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/iap_client.tf.tmpl @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "{{index $.Vars "project_id"}}" name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "google_project_service" "project_service" { diff --git a/mmv1/templates/terraform/examples/go/iap_project.tf.tmpl b/mmv1/templates/terraform/examples/go/iap_project.tf.tmpl index f099d4bf62a9..70a68b4a8fd7 100644 --- a/mmv1/templates/terraform/examples/go/iap_project.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/iap_project.tf.tmpl @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "tf-test%{random_suffix}" name = "tf-test%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/templates/terraform/examples/go/identity_platform_config_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/identity_platform_config_basic.tf.tmpl index ae84812c99dc..445c1a377e0a 100644 --- a/mmv1/templates/terraform/examples/go/identity_platform_config_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/identity_platform_config_basic.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "default" { name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_acct"}}" + deletion_policy = "DELETE" labels = { firebase = "enabled" } diff --git a/mmv1/templates/terraform/examples/go/identity_platform_config_minimal.tf.tmpl b/mmv1/templates/terraform/examples/go/identity_platform_config_minimal.tf.tmpl index fa59b765874f..f9a77e23061a 100644 --- a/mmv1/templates/terraform/examples/go/identity_platform_config_minimal.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/identity_platform_config_minimal.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "default" { name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_acct"}}" + deletion_policy = "DELETE" labels = { firebase = "enabled" } diff --git a/mmv1/templates/terraform/examples/go/identity_platform_project_default_config.tf.tmpl b/mmv1/templates/terraform/examples/go/identity_platform_project_default_config.tf.tmpl deleted file mode 100644 index 54f5b0c1bd49..000000000000 --- a/mmv1/templates/terraform/examples/go/identity_platform_project_default_config.tf.tmpl +++ /dev/null @@ -1,21 +0,0 @@ -resource "google_identity_platform_project_default_config" "{{$.PrimaryResourceId}}" { - sign_in { - allow_duplicate_emails = true - - anonymous { - enabled = true - } - - email { - enabled = true - password_required = false - } - - phone_number { - enabled = true - test_phone_numbers = { - "+11231231234" = "000000" - } - } - } -} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/go/integration_connectors_managed_zone.tf.tmpl b/mmv1/templates/terraform/examples/go/integration_connectors_managed_zone.tf.tmpl index d60da1736c11..6ba34c480050 100644 --- a/mmv1/templates/terraform/examples/go/integration_connectors_managed_zone.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/integration_connectors_managed_zone.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "target_project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project_iam_member" "dns_peer_binding" { diff --git a/mmv1/templates/terraform/examples/go/kms_autokey_config_all.tf.tmpl b/mmv1/templates/terraform/examples/go/kms_autokey_config_all.tf.tmpl index 2c4b2ec6c841..1dfef71cbf3f 100644 --- a/mmv1/templates/terraform/examples/go/kms_autokey_config_all.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/kms_autokey_config_all.tf.tmpl @@ -3,6 +3,7 @@ resource "google_folder" "autokms_folder" { provider = google-beta display_name = "{{index $.Vars "folder_name"}}" parent = "organizations/{{index $.TestEnvVars "org_id"}}" + deletion_protection = false } # Create the key project @@ -13,6 +14,7 @@ resource "google_project" "key_project" { folder_id = google_folder.autokms_folder.folder_id billing_account = "{{index $.TestEnvVars "billing_account"}}" depends_on = [google_folder.autokms_folder] + deletion_policy = "DELETE" } # Enable the Cloud KMS API diff --git a/mmv1/templates/terraform/examples/go/kms_key_handle_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/kms_key_handle_basic.tf.tmpl index f681e7679bb3..a1aec00b4930 100644 --- a/mmv1/templates/terraform/examples/go/kms_key_handle_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/kms_key_handle_basic.tf.tmpl @@ -3,6 +3,7 @@ resource "google_folder" "autokms_folder" { provider = google-beta display_name = "folder-example" parent = "organizations/{{index $.TestEnvVars "org_id"}}" + deletion_protection = false } # Create the key project @@ -13,6 +14,7 @@ resource "google_project" "key_project" { folder_id = google_folder.autokms_folder.folder_id billing_account = "{{index $.TestEnvVars "billing_account"}}" depends_on = [google_folder.autokms_folder] + deletion_policy = "DELETE" } # Create the resource project diff --git a/mmv1/templates/terraform/examples/go/logging_folder_settings_all.tf.tmpl b/mmv1/templates/terraform/examples/go/logging_folder_settings_all.tf.tmpl index bd11b5e2de7e..fbd552c14b33 100644 --- a/mmv1/templates/terraform/examples/go/logging_folder_settings_all.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/logging_folder_settings_all.tf.tmpl @@ -9,6 +9,7 @@ resource "google_logging_folder_settings" "{{$.PrimaryResourceId}}" { resource "google_folder" "my_folder" { display_name = "{{index $.Vars "folder_name"}}" parent = "organizations/{{index $.TestEnvVars "org_id"}}" + deletion_protection = false } data "google_logging_folder_settings" "settings" { diff --git a/mmv1/templates/terraform/examples/go/monitoring_monitored_project_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/monitoring_monitored_project_basic.tf.tmpl index 7aeff8242ab7..a043ba953711 100644 --- a/mmv1/templates/terraform/examples/go/monitoring_monitored_project_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/monitoring_monitored_project_basic.tf.tmpl @@ -7,4 +7,5 @@ resource "google_project" "basic" { project_id = "{{index $.Vars "monitored_project"}}" name = "{{index $.Vars "monitored_project"}}-display" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } diff --git a/mmv1/templates/terraform/examples/go/monitoring_monitored_project_long_form.tf.tmpl b/mmv1/templates/terraform/examples/go/monitoring_monitored_project_long_form.tf.tmpl index e96c7923651f..c26cdc569f60 100644 --- a/mmv1/templates/terraform/examples/go/monitoring_monitored_project_long_form.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/monitoring_monitored_project_long_form.tf.tmpl @@ -7,4 +7,5 @@ resource "google_project" "basic" { project_id = "{{index $.Vars "monitored_project"}}" name = "{{index $.Vars "monitored_project"}}-display" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } diff --git a/mmv1/templates/terraform/examples/go/network_attachment_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/network_attachment_basic.tf.tmpl index 948b3a02ba43..ec9f23221b61 100644 --- a/mmv1/templates/terraform/examples/go/network_attachment_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/network_attachment_basic.tf.tmpl @@ -35,6 +35,7 @@ resource "google_project" "rejected_producer_project" { name = "{{index $.Vars "rejected_producer_project_name"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "google_project" "accepted_producer_project" { @@ -42,4 +43,5 @@ resource "google_project" "accepted_producer_project" { name = "{{index $.Vars "accepted_producer_project_name"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } diff --git a/mmv1/templates/terraform/examples/go/node_group_share_settings.tf.tmpl b/mmv1/templates/terraform/examples/go/node_group_share_settings.tf.tmpl index fbf5d9836c8a..94800793ec5c 100644 --- a/mmv1/templates/terraform/examples/go/node_group_share_settings.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/node_group_share_settings.tf.tmpl @@ -2,6 +2,7 @@ resource "google_project" "guest_project" { project_id = "{{index $.Vars "guest_project_id"}}" name = "{{index $.Vars "guest_project_name"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "google_compute_node_template" "soletenant-tmpl" { diff --git a/mmv1/templates/terraform/examples/go/org_policy_policy_enforce.tf.tmpl b/mmv1/templates/terraform/examples/go/org_policy_policy_enforce.tf.tmpl index fa739896cb30..8441f6dcdc8f 100644 --- a/mmv1/templates/terraform/examples/go/org_policy_policy_enforce.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/org_policy_policy_enforce.tf.tmpl @@ -13,4 +13,5 @@ resource "google_project" "basic" { project_id = "id" name = "id" org_id = "123456789" + deletion_policy = "DELETE" } diff --git a/mmv1/templates/terraform/examples/go/org_policy_policy_folder.tf.tmpl b/mmv1/templates/terraform/examples/go/org_policy_policy_folder.tf.tmpl index c924f1226c53..6d58a8cbc60b 100644 --- a/mmv1/templates/terraform/examples/go/org_policy_policy_folder.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/org_policy_policy_folder.tf.tmpl @@ -14,4 +14,5 @@ resource "google_org_policy_policy" "primary" { resource "google_folder" "basic" { parent = "organizations/123456789" display_name = "folder" + deletion_protection = false } diff --git a/mmv1/templates/terraform/examples/go/org_policy_policy_project.tf.tmpl b/mmv1/templates/terraform/examples/go/org_policy_policy_project.tf.tmpl index 96c248672ba0..7016cda43ed8 100644 --- a/mmv1/templates/terraform/examples/go/org_policy_policy_project.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/org_policy_policy_project.tf.tmpl @@ -27,4 +27,5 @@ resource "google_project" "basic" { project_id = "id" name = "id" org_id = "123456789" + deletion_policy = "DELETE" } diff --git a/mmv1/templates/terraform/examples/go/organization_access_approval_active_key_version.tf.tmpl b/mmv1/templates/terraform/examples/go/organization_access_approval_active_key_version.tf.tmpl index ffd6fb7b41b5..629a4195a5be 100644 --- a/mmv1/templates/terraform/examples/go/organization_access_approval_active_key_version.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/organization_access_approval_active_key_version.tf.tmpl @@ -2,6 +2,7 @@ resource "google_project" "my_project" { name = "My Project" project_id = "your-project-id" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "google_kms_key_ring" "key_ring" { diff --git a/mmv1/templates/terraform/examples/go/organization_security_policy_association_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/organization_security_policy_association_basic.tf.tmpl index e803ddc2ff83..a8fd86eef059 100644 --- a/mmv1/templates/terraform/examples/go/organization_security_policy_association_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/organization_security_policy_association_basic.tf.tmpl @@ -2,6 +2,7 @@ resource "google_folder" "security_policy_target" { provider = google-beta display_name = "tf-test-secpol-%{random_suffix}" parent = "organizations/{{index $.TestEnvVars "org_id"}}" + deletion_protection = false } resource "google_compute_organization_security_policy" "policy" { diff --git a/mmv1/templates/terraform/examples/go/region_backend_service_balancing_mode.tf.tmpl b/mmv1/templates/terraform/examples/go/region_backend_service_balancing_mode.tf.tmpl index be1bc742abba..8b5b89a412e7 100644 --- a/mmv1/templates/terraform/examples/go/region_backend_service_balancing_mode.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/region_backend_service_balancing_mode.tf.tmpl @@ -7,12 +7,12 @@ resource "google_compute_region_backend_service" "default" { capacity_scaler = 1.0 } - region = "us-central1" - name = "{{index $.Vars "region_backend_service_name"}}" - protocol = "HTTP" - timeout_sec = 10 - - health_checks = [google_compute_region_health_check.default.id] + region = "us-central1" + name = "{{index $.Vars "region_backend_service_name"}}" + protocol = "HTTP" + timeout_sec = 10 + connection_draining_timeout_sec = 0 + health_checks = [google_compute_region_health_check.default.id] } data "google_compute_image" "debian_image" { diff --git a/mmv1/templates/terraform/examples/go/region_consumer_quota_override.tf.tmpl b/mmv1/templates/terraform/examples/go/region_consumer_quota_override.tf.tmpl index 108f57c012d4..cf6953b9cffb 100644 --- a/mmv1/templates/terraform/examples/go/region_consumer_quota_override.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/region_consumer_quota_override.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "my_project" { name = "tf-test-project" project_id = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "google_service_usage_consumer_quota_override" "override" { diff --git a/mmv1/templates/terraform/examples/go/resource_manager_lien.tf.tmpl b/mmv1/templates/terraform/examples/go/resource_manager_lien.tf.tmpl index ca5698d04162..e847ec9b4eac 100644 --- a/mmv1/templates/terraform/examples/go/resource_manager_lien.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/resource_manager_lien.tf.tmpl @@ -8,4 +8,5 @@ resource "google_resource_manager_lien" "{{$.PrimaryResourceId}}" { resource "google_project" "project" { project_id = "{{index $.Vars "project_id"}}" name = "A very important project!" + deletion_policy = "DELETE" } diff --git a/mmv1/templates/terraform/examples/go/scc_folder_custom_module_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/scc_folder_custom_module_basic.tf.tmpl index dc500936f42a..594d8ee62d72 100644 --- a/mmv1/templates/terraform/examples/go/scc_folder_custom_module_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/scc_folder_custom_module_basic.tf.tmpl @@ -1,6 +1,7 @@ resource "google_folder" "folder" { parent = "organizations/{{index $.TestEnvVars "org_id"}}" display_name = "{{index $.Vars "folder_display_name"}}" + deletion_protection = false } resource "google_scc_folder_custom_module" "{{$.PrimaryResourceId}}" { diff --git a/mmv1/templates/terraform/examples/go/scc_folder_custom_module_full.tf.tmpl b/mmv1/templates/terraform/examples/go/scc_folder_custom_module_full.tf.tmpl index 058069aae278..56c049c3436b 100644 --- a/mmv1/templates/terraform/examples/go/scc_folder_custom_module_full.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/scc_folder_custom_module_full.tf.tmpl @@ -1,6 +1,7 @@ resource "google_folder" "folder" { parent = "organizations/{{index $.TestEnvVars "org_id"}}" display_name = "{{index $.Vars "folder_display_name"}}" + deletion_protection = false } resource "google_scc_folder_custom_module" "{{$.PrimaryResourceId}}" { diff --git a/mmv1/templates/terraform/examples/go/scc_management_folder_security_health_analytics_custom_module_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/scc_management_folder_security_health_analytics_custom_module_basic.tf.tmpl index 49eb43a28cc2..a06a45f0fab6 100644 --- a/mmv1/templates/terraform/examples/go/scc_management_folder_security_health_analytics_custom_module_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/scc_management_folder_security_health_analytics_custom_module_basic.tf.tmpl @@ -1,6 +1,7 @@ resource "google_folder" "folder" { parent = "organizations/{{index $.TestEnvVars "org_id"}}" display_name = "{{index $.Vars "folder_display_name"}}" + deletion_protection = false } resource "google_scc_management_folder_security_health_analytics_custom_module" "{{$.PrimaryResourceId}}" { diff --git a/mmv1/templates/terraform/examples/go/scc_management_folder_security_health_analytics_custom_module_full.tf.tmpl b/mmv1/templates/terraform/examples/go/scc_management_folder_security_health_analytics_custom_module_full.tf.tmpl index 45964d5b11b8..1c328913e752 100644 --- a/mmv1/templates/terraform/examples/go/scc_management_folder_security_health_analytics_custom_module_full.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/scc_management_folder_security_health_analytics_custom_module_full.tf.tmpl @@ -1,6 +1,7 @@ resource "google_folder" "folder" { parent = "organizations/{{index $.TestEnvVars "org_id"}}" display_name = "{{index $.Vars "folder_display_name"}}" + deletion_protection = false } resource "google_scc_management_folder_security_health_analytics_custom_module" "{{$.PrimaryResourceId}}" { diff --git a/mmv1/templates/terraform/examples/go/shared_reservation_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/shared_reservation_basic.tf.tmpl index adc0fe50ad3c..202f64c469d6 100644 --- a/mmv1/templates/terraform/examples/go/shared_reservation_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/shared_reservation_basic.tf.tmpl @@ -3,6 +3,7 @@ resource "google_project" "owner_project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } @@ -16,6 +17,7 @@ resource "google_project" "guest_project" { project_id = "tf-test-2%{random_suffix}" name = "tf-test-2%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "google_organization_policy" "shared_reservation_org_policy" { diff --git a/mmv1/templates/terraform/examples/go/sql_instance_ssl_cert.tf.tmpl b/mmv1/templates/terraform/examples/go/sql_instance_ssl_cert.tf.tmpl index 0ac9a24a3c81..552191869738 100644 --- a/mmv1/templates/terraform/examples/go/sql_instance_ssl_cert.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/sql_instance_ssl_cert.tf.tmpl @@ -5,7 +5,7 @@ resource "google_sql_database_instance" "mysql_instance" { settings { tier = "db-f1-micro" ip_configuration { - require_ssl = "true" + ssl_mode = "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" } } deletion_protection = "{{index $.Vars "deletion_protection"}}" @@ -23,7 +23,7 @@ resource "google_sql_database_instance" "postgres_instance" { settings { tier = "db-custom-2-7680" ip_configuration { - require_ssl = "true" + ssl_mode = "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" } } deletion_protection = "{{index $.Vars "deletion_protection"}}" @@ -42,7 +42,7 @@ resource "google_sql_database_instance" "{{$.PrimaryResourceId}}" { settings { tier = "db-custom-2-7680" ip_configuration { - require_ssl = "true" + ssl_mode = "ENCRYPTED_ONLY" } } deletion_protection = "{{index $.Vars "deletion_protection"}}" diff --git a/mmv1/templates/terraform/examples/go/tag_binding_basic.tf.tmpl b/mmv1/templates/terraform/examples/go/tag_binding_basic.tf.tmpl index 5ce32b6d2022..e66f8369874d 100644 --- a/mmv1/templates/terraform/examples/go/tag_binding_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/tag_binding_basic.tf.tmpl @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "{{index $.Vars "project_id"}}" name = "{{index $.Vars "project_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" + deletion_policy = "DELETE" } resource "google_tags_tag_key" "key" { diff --git a/mmv1/templates/terraform/examples/go/vertex_ai_featureonlinestore_featureview_cross_project.tf.tmpl b/mmv1/templates/terraform/examples/go/vertex_ai_featureonlinestore_featureview_cross_project.tf.tmpl index 05b8eab12560..e81d0081edc8 100644 --- a/mmv1/templates/terraform/examples/go/vertex_ai_featureonlinestore_featureview_cross_project.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/vertex_ai_featureonlinestore_featureview_cross_project.tf.tmpl @@ -6,6 +6,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/templates/terraform/examples/go/vmware_engine_network_legacy.tf.tmpl b/mmv1/templates/terraform/examples/go/vmware_engine_network_legacy.tf.tmpl index 4dcf950f8f30..9936dabd3275 100644 --- a/mmv1/templates/terraform/examples/go/vmware_engine_network_legacy.tf.tmpl +++ b/mmv1/templates/terraform/examples/go/vmware_engine_network_legacy.tf.tmpl @@ -21,6 +21,7 @@ resource "google_project" "acceptance" { project_id = "{{index $.Vars "proj_id"}}" org_id = "{{index $.TestEnvVars "org_id"}}" billing_account = "{{index $.TestEnvVars "billing_account"}}" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/templates/terraform/examples/iam_access_boundary_policy_basic.tf.erb b/mmv1/templates/terraform/examples/iam_access_boundary_policy_basic.tf.erb index 8bc48667ae54..0fd56cf941be 100644 --- a/mmv1/templates/terraform/examples/iam_access_boundary_policy_basic.tf.erb +++ b/mmv1/templates/terraform/examples/iam_access_boundary_policy_basic.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "<%= ctx[:vars]["project_id"] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_access_context_manager_access_level" "test-access" { diff --git a/mmv1/templates/terraform/examples/iam_deny_policy_basic.tf.erb b/mmv1/templates/terraform/examples/iam_deny_policy_basic.tf.erb index ce12af38140c..7242616fbfbf 100644 --- a/mmv1/templates/terraform/examples/iam_deny_policy_basic.tf.erb +++ b/mmv1/templates/terraform/examples/iam_deny_policy_basic.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { name = "<%= ctx[:vars]["project_name"] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_iam_deny_policy" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/iap_app_engine_service.tf.erb b/mmv1/templates/terraform/examples/iap_app_engine_service.tf.erb index dff90f5307e6..96f9c87817eb 100644 --- a/mmv1/templates/terraform/examples/iap_app_engine_service.tf.erb +++ b/mmv1/templates/terraform/examples/iap_app_engine_service.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "my_project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "project_service" { diff --git a/mmv1/templates/terraform/examples/iap_appengine.tf.erb b/mmv1/templates/terraform/examples/iap_appengine.tf.erb index f63aa36038ea..45ad554567ec 100644 --- a/mmv1/templates/terraform/examples/iap_appengine.tf.erb +++ b/mmv1/templates/terraform/examples/iap_appengine.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/templates/terraform/examples/iap_brand.tf.erb b/mmv1/templates/terraform/examples/iap_brand.tf.erb index 3c65c7abfef0..d0dbffdc62b4 100644 --- a/mmv1/templates/terraform/examples/iap_brand.tf.erb +++ b/mmv1/templates/terraform/examples/iap_brand.tf.erb @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "<%= ctx[:vars]['project_id'] %>" name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "project_service" { diff --git a/mmv1/templates/terraform/examples/iap_client.tf.erb b/mmv1/templates/terraform/examples/iap_client.tf.erb index 9ea7623f4527..126817dc9d10 100644 --- a/mmv1/templates/terraform/examples/iap_client.tf.erb +++ b/mmv1/templates/terraform/examples/iap_client.tf.erb @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "<%= ctx[:vars]['project_id'] %>" name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "google_project_service" "project_service" { diff --git a/mmv1/templates/terraform/examples/iap_project.tf.erb b/mmv1/templates/terraform/examples/iap_project.tf.erb index f099d4bf62a9..70a68b4a8fd7 100644 --- a/mmv1/templates/terraform/examples/iap_project.tf.erb +++ b/mmv1/templates/terraform/examples/iap_project.tf.erb @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "tf-test%{random_suffix}" name = "tf-test%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/templates/terraform/examples/identity_platform_config_basic.tf.erb b/mmv1/templates/terraform/examples/identity_platform_config_basic.tf.erb index 0405bf9620ea..5529d34c7fb3 100644 --- a/mmv1/templates/terraform/examples/identity_platform_config_basic.tf.erb +++ b/mmv1/templates/terraform/examples/identity_platform_config_basic.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "default" { name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_acct'] -%>" + deletion_policy = "DELETE" labels = { firebase = "enabled" } diff --git a/mmv1/templates/terraform/examples/identity_platform_config_minimal.tf.erb b/mmv1/templates/terraform/examples/identity_platform_config_minimal.tf.erb index fda0049ecc1d..4c6186816d5d 100644 --- a/mmv1/templates/terraform/examples/identity_platform_config_minimal.tf.erb +++ b/mmv1/templates/terraform/examples/identity_platform_config_minimal.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "default" { name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_acct'] -%>" + deletion_policy = "DELETE" labels = { firebase = "enabled" } diff --git a/mmv1/templates/terraform/examples/identity_platform_project_default_config.tf.erb b/mmv1/templates/terraform/examples/identity_platform_project_default_config.tf.erb deleted file mode 100644 index a863b7a11726..000000000000 --- a/mmv1/templates/terraform/examples/identity_platform_project_default_config.tf.erb +++ /dev/null @@ -1,21 +0,0 @@ -resource "google_identity_platform_project_default_config" "<%= ctx[:primary_resource_id] %>" { - sign_in { - allow_duplicate_emails = true - - anonymous { - enabled = true - } - - email { - enabled = true - password_required = false - } - - phone_number { - enabled = true - test_phone_numbers = { - "+11231231234" = "000000" - } - } - } -} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/integration_connectors_managed_zone.tf.erb b/mmv1/templates/terraform/examples/integration_connectors_managed_zone.tf.erb index 4ab8b003ebd5..fb5d58ad28c4 100644 --- a/mmv1/templates/terraform/examples/integration_connectors_managed_zone.tf.erb +++ b/mmv1/templates/terraform/examples/integration_connectors_managed_zone.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "target_project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project_iam_member" "dns_peer_binding" { diff --git a/mmv1/templates/terraform/examples/integrations_client_deprecated_fields.tf.erb b/mmv1/templates/terraform/examples/integrations_client_deprecated_fields.tf.erb deleted file mode 100644 index ccac00b1f5f5..000000000000 --- a/mmv1/templates/terraform/examples/integrations_client_deprecated_fields.tf.erb +++ /dev/null @@ -1,5 +0,0 @@ -resource "google_integrations_client" "<%= ctx[:primary_resource_id] %>" { - location = "asia-south1" - provision_gmek = true - create_sample_workflows = true -} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/kms_autokey_config_all.tf.erb b/mmv1/templates/terraform/examples/kms_autokey_config_all.tf.erb index 5611cbc65db0..f72418bdba8c 100644 --- a/mmv1/templates/terraform/examples/kms_autokey_config_all.tf.erb +++ b/mmv1/templates/terraform/examples/kms_autokey_config_all.tf.erb @@ -3,6 +3,7 @@ resource "google_folder" "autokms_folder" { provider = google-beta display_name = "<%= ctx[:vars]["folder_name"] %>" parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" + deletion_protection = false } # Create the key project @@ -13,6 +14,7 @@ resource "google_project" "key_project" { folder_id = google_folder.autokms_folder.folder_id billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" depends_on = [google_folder.autokms_folder] + deletion_policy = "DELETE" } # Enable the Cloud KMS API diff --git a/mmv1/templates/terraform/examples/kms_key_handle_basic.tf.erb b/mmv1/templates/terraform/examples/kms_key_handle_basic.tf.erb index a03be1027829..327cf589046c 100644 --- a/mmv1/templates/terraform/examples/kms_key_handle_basic.tf.erb +++ b/mmv1/templates/terraform/examples/kms_key_handle_basic.tf.erb @@ -3,6 +3,7 @@ resource "google_folder" "autokms_folder" { provider = google-beta display_name = "folder-example" parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" + deletion_protection = false } # Create the key project @@ -13,6 +14,7 @@ resource "google_project" "key_project" { folder_id = google_folder.autokms_folder.folder_id billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" depends_on = [google_folder.autokms_folder] + deletion_policy = "DELETE" } # Create the resource project @@ -23,6 +25,7 @@ resource "google_project" "resource_project" { folder_id = google_folder.autokms_folder.folder_id billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" depends_on = [google_folder.autokms_folder] + deletion_policy = "DELETE" } # Enable the Cloud KMS API diff --git a/mmv1/templates/terraform/examples/logging_folder_settings_all.tf.erb b/mmv1/templates/terraform/examples/logging_folder_settings_all.tf.erb index 35a35ccd6fac..c9a44202cab3 100644 --- a/mmv1/templates/terraform/examples/logging_folder_settings_all.tf.erb +++ b/mmv1/templates/terraform/examples/logging_folder_settings_all.tf.erb @@ -9,6 +9,7 @@ resource "google_logging_folder_settings" "<%= ctx[:primary_resource_id] %>" { resource "google_folder" "my_folder" { display_name = "<%= ctx[:vars]['folder_name'] %>" parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" + deletion_protection = false } data "google_logging_folder_settings" "settings" { diff --git a/mmv1/templates/terraform/examples/monitoring_monitored_project_basic.tf.erb b/mmv1/templates/terraform/examples/monitoring_monitored_project_basic.tf.erb index ce32ef1a7978..814a40f47a51 100644 --- a/mmv1/templates/terraform/examples/monitoring_monitored_project_basic.tf.erb +++ b/mmv1/templates/terraform/examples/monitoring_monitored_project_basic.tf.erb @@ -7,4 +7,5 @@ resource "google_project" "basic" { project_id = "<%= ctx[:vars]['monitored_project'] %>" name = "<%= ctx[:vars]['monitored_project'] %>-display" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } diff --git a/mmv1/templates/terraform/examples/monitoring_monitored_project_long_form.tf.erb b/mmv1/templates/terraform/examples/monitoring_monitored_project_long_form.tf.erb index 877056db134a..086c9d5ac80e 100644 --- a/mmv1/templates/terraform/examples/monitoring_monitored_project_long_form.tf.erb +++ b/mmv1/templates/terraform/examples/monitoring_monitored_project_long_form.tf.erb @@ -7,4 +7,5 @@ resource "google_project" "basic" { project_id = "<%= ctx[:vars]['monitored_project'] %>" name = "<%= ctx[:vars]['monitored_project'] %>-display" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } diff --git a/mmv1/templates/terraform/examples/network_attachment_basic.tf.erb b/mmv1/templates/terraform/examples/network_attachment_basic.tf.erb index 3fe14b29adfe..fadfe335ec09 100644 --- a/mmv1/templates/terraform/examples/network_attachment_basic.tf.erb +++ b/mmv1/templates/terraform/examples/network_attachment_basic.tf.erb @@ -35,6 +35,7 @@ resource "google_project" "rejected_producer_project" { name = "<%= ctx[:vars]['rejected_producer_project_name'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "google_project" "accepted_producer_project" { @@ -42,4 +43,5 @@ resource "google_project" "accepted_producer_project" { name = "<%= ctx[:vars]['accepted_producer_project_name'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } diff --git a/mmv1/templates/terraform/examples/node_group_share_settings.tf.erb b/mmv1/templates/terraform/examples/node_group_share_settings.tf.erb index b2658a831187..64d2f3073139 100644 --- a/mmv1/templates/terraform/examples/node_group_share_settings.tf.erb +++ b/mmv1/templates/terraform/examples/node_group_share_settings.tf.erb @@ -2,6 +2,7 @@ resource "google_project" "guest_project" { project_id = "<%= ctx[:vars]['guest_project_id'] %>" name = "<%= ctx[:vars]['guest_project_name'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "google_compute_node_template" "soletenant-tmpl" { diff --git a/mmv1/templates/terraform/examples/org_policy_policy_enforce.tf.erb b/mmv1/templates/terraform/examples/org_policy_policy_enforce.tf.erb index fa739896cb30..8441f6dcdc8f 100644 --- a/mmv1/templates/terraform/examples/org_policy_policy_enforce.tf.erb +++ b/mmv1/templates/terraform/examples/org_policy_policy_enforce.tf.erb @@ -13,4 +13,5 @@ resource "google_project" "basic" { project_id = "id" name = "id" org_id = "123456789" + deletion_policy = "DELETE" } diff --git a/mmv1/templates/terraform/examples/org_policy_policy_folder.tf.erb b/mmv1/templates/terraform/examples/org_policy_policy_folder.tf.erb index c924f1226c53..6d58a8cbc60b 100644 --- a/mmv1/templates/terraform/examples/org_policy_policy_folder.tf.erb +++ b/mmv1/templates/terraform/examples/org_policy_policy_folder.tf.erb @@ -14,4 +14,5 @@ resource "google_org_policy_policy" "primary" { resource "google_folder" "basic" { parent = "organizations/123456789" display_name = "folder" + deletion_protection = false } diff --git a/mmv1/templates/terraform/examples/org_policy_policy_project.tf.erb b/mmv1/templates/terraform/examples/org_policy_policy_project.tf.erb index 96c248672ba0..7016cda43ed8 100644 --- a/mmv1/templates/terraform/examples/org_policy_policy_project.tf.erb +++ b/mmv1/templates/terraform/examples/org_policy_policy_project.tf.erb @@ -27,4 +27,5 @@ resource "google_project" "basic" { project_id = "id" name = "id" org_id = "123456789" + deletion_policy = "DELETE" } diff --git a/mmv1/templates/terraform/examples/organization_access_approval_active_key_version.tf.erb b/mmv1/templates/terraform/examples/organization_access_approval_active_key_version.tf.erb index c100453e7d35..52e8ccab0dbd 100644 --- a/mmv1/templates/terraform/examples/organization_access_approval_active_key_version.tf.erb +++ b/mmv1/templates/terraform/examples/organization_access_approval_active_key_version.tf.erb @@ -2,6 +2,7 @@ resource "google_project" "my_project" { name = "My Project" project_id = "your-project-id" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "google_kms_key_ring" "key_ring" { diff --git a/mmv1/templates/terraform/examples/organization_security_policy_association_basic.tf.erb b/mmv1/templates/terraform/examples/organization_security_policy_association_basic.tf.erb index 5ea24c0c0fa2..dd02a5433776 100644 --- a/mmv1/templates/terraform/examples/organization_security_policy_association_basic.tf.erb +++ b/mmv1/templates/terraform/examples/organization_security_policy_association_basic.tf.erb @@ -2,6 +2,7 @@ resource "google_folder" "security_policy_target" { provider = google-beta display_name = "tf-test-secpol-%{random_suffix}" parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" + deletion_protection = false } resource "google_compute_organization_security_policy" "policy" { diff --git a/mmv1/templates/terraform/examples/redis_cluster_ha.tf.erb b/mmv1/templates/terraform/examples/redis_cluster_ha.tf.erb index 9420df6abb47..0ea4d32b4e28 100644 --- a/mmv1/templates/terraform/examples/redis_cluster_ha.tf.erb +++ b/mmv1/templates/terraform/examples/redis_cluster_ha.tf.erb @@ -12,16 +12,14 @@ resource "google_redis_cluster" "<%= ctx[:primary_resource_id] %>" { redis_configs = { maxmemory-policy = "volatile-ttl" } + deletion_protection_enabled = <%= ctx[:vars]['deletion_protection_enabled'] == 'true' %> + zone_distribution_config { mode = "MULTI_ZONE" } depends_on = [ google_network_connectivity_service_connection_policy.default ] - - lifecycle { - prevent_destroy = <%= ctx[:vars]['prevent_destroy'] %> - } } resource "google_network_connectivity_service_connection_policy" "default" { diff --git a/mmv1/templates/terraform/examples/redis_cluster_ha_single_zone.tf.erb b/mmv1/templates/terraform/examples/redis_cluster_ha_single_zone.tf.erb index 63c7b20f5f81..8ff059978093 100644 --- a/mmv1/templates/terraform/examples/redis_cluster_ha_single_zone.tf.erb +++ b/mmv1/templates/terraform/examples/redis_cluster_ha_single_zone.tf.erb @@ -9,13 +9,11 @@ resource "google_redis_cluster" "<%= ctx[:primary_resource_id] %>" { mode = "SINGLE_ZONE" zone = "us-central1-f" } + deletion_protection_enabled = <%= ctx[:vars]['deletion_protection_enabled'] == 'true' %> depends_on = [ google_network_connectivity_service_connection_policy.default ] - lifecycle { - prevent_destroy = <%= ctx[:vars]['prevent_destroy'] %> - } } resource "google_network_connectivity_service_connection_policy" "default" { diff --git a/mmv1/templates/terraform/examples/region_backend_service_external_iap.tf.erb b/mmv1/templates/terraform/examples/region_backend_service_external_iap.tf.erb index ec9ca33f00b0..2f418bc0f037 100644 --- a/mmv1/templates/terraform/examples/region_backend_service_external_iap.tf.erb +++ b/mmv1/templates/terraform/examples/region_backend_service_external_iap.tf.erb @@ -4,6 +4,7 @@ resource "google_compute_region_backend_service" "<%= ctx[:primary_resource_id] protocol = "HTTP" load_balancing_scheme = "EXTERNAL" iap { + enabled = true oauth2_client_id = "abc" oauth2_client_secret = "xyz" } diff --git a/mmv1/templates/terraform/examples/region_consumer_quota_override.tf.erb b/mmv1/templates/terraform/examples/region_consumer_quota_override.tf.erb index 0263adf61ef6..ab9e111fc966 100644 --- a/mmv1/templates/terraform/examples/region_consumer_quota_override.tf.erb +++ b/mmv1/templates/terraform/examples/region_consumer_quota_override.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "my_project" { name = "tf-test-project" project_id = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "google_service_usage_consumer_quota_override" "override" { diff --git a/mmv1/templates/terraform/examples/resource_manager_lien.tf.erb b/mmv1/templates/terraform/examples/resource_manager_lien.tf.erb index fedab4764e14..5f64d49be9fb 100644 --- a/mmv1/templates/terraform/examples/resource_manager_lien.tf.erb +++ b/mmv1/templates/terraform/examples/resource_manager_lien.tf.erb @@ -8,4 +8,5 @@ resource "google_resource_manager_lien" "<%= ctx[:primary_resource_id] %>" { resource "google_project" "project" { project_id = "<%= ctx[:vars]["project_id"] %>" name = "A very important project!" + deletion_policy = "DELETE" } diff --git a/mmv1/templates/terraform/examples/scc_folder_custom_module_basic.tf.erb b/mmv1/templates/terraform/examples/scc_folder_custom_module_basic.tf.erb index 5a56b75249da..dd07ad92a244 100644 --- a/mmv1/templates/terraform/examples/scc_folder_custom_module_basic.tf.erb +++ b/mmv1/templates/terraform/examples/scc_folder_custom_module_basic.tf.erb @@ -1,6 +1,7 @@ resource "google_folder" "folder" { parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" display_name = "<%= ctx[:vars]['folder_display_name'] %>" + deletion_protection = false } resource "google_scc_folder_custom_module" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/scc_folder_custom_module_full.tf.erb b/mmv1/templates/terraform/examples/scc_folder_custom_module_full.tf.erb index b54bcd04c701..cce74f61865d 100644 --- a/mmv1/templates/terraform/examples/scc_folder_custom_module_full.tf.erb +++ b/mmv1/templates/terraform/examples/scc_folder_custom_module_full.tf.erb @@ -1,6 +1,7 @@ resource "google_folder" "folder" { parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" display_name = "<%= ctx[:vars]['folder_display_name'] %>" + deletion_protection = false } resource "google_scc_folder_custom_module" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/scc_management_folder_security_health_analytics_custom_module_basic.tf.erb b/mmv1/templates/terraform/examples/scc_management_folder_security_health_analytics_custom_module_basic.tf.erb index 9b773df17903..7042af8d7d20 100644 --- a/mmv1/templates/terraform/examples/scc_management_folder_security_health_analytics_custom_module_basic.tf.erb +++ b/mmv1/templates/terraform/examples/scc_management_folder_security_health_analytics_custom_module_basic.tf.erb @@ -1,6 +1,7 @@ resource "google_folder" "folder" { parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" display_name = "<%= ctx[:vars]['folder_display_name'] %>" + deletion_protection = false } resource "google_scc_management_folder_security_health_analytics_custom_module" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/scc_management_folder_security_health_analytics_custom_module_full.tf.erb b/mmv1/templates/terraform/examples/scc_management_folder_security_health_analytics_custom_module_full.tf.erb index 0108ada4cd1a..c0974a7b35b5 100644 --- a/mmv1/templates/terraform/examples/scc_management_folder_security_health_analytics_custom_module_full.tf.erb +++ b/mmv1/templates/terraform/examples/scc_management_folder_security_health_analytics_custom_module_full.tf.erb @@ -1,6 +1,7 @@ resource "google_folder" "folder" { parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" display_name = "<%= ctx[:vars]['folder_display_name'] %>" + deletion_protection = false } resource "google_scc_management_folder_security_health_analytics_custom_module" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/shared_reservation_basic.tf.erb b/mmv1/templates/terraform/examples/shared_reservation_basic.tf.erb index 5980471808c0..fc58d27f8605 100644 --- a/mmv1/templates/terraform/examples/shared_reservation_basic.tf.erb +++ b/mmv1/templates/terraform/examples/shared_reservation_basic.tf.erb @@ -3,6 +3,7 @@ resource "google_project" "owner_project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } @@ -16,6 +17,7 @@ resource "google_project" "guest_project" { project_id = "tf-test-2%{random_suffix}" name = "tf-test-2%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "google_organization_policy" "shared_reservation_org_policy" { diff --git a/mmv1/templates/terraform/examples/sql_instance_ssl_cert.tf.erb b/mmv1/templates/terraform/examples/sql_instance_ssl_cert.tf.erb index 0baba74f59ef..9453223a0e9a 100644 --- a/mmv1/templates/terraform/examples/sql_instance_ssl_cert.tf.erb +++ b/mmv1/templates/terraform/examples/sql_instance_ssl_cert.tf.erb @@ -5,7 +5,7 @@ resource "google_sql_database_instance" "mysql_instance" { settings { tier = "db-f1-micro" ip_configuration { - require_ssl = "true" + ssl_mode = "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" } } deletion_protection = "<%= ctx[:vars]['deletion_protection'] %>" @@ -23,7 +23,7 @@ resource "google_sql_database_instance" "postgres_instance" { settings { tier = "db-custom-2-7680" ip_configuration { - require_ssl = "true" + ssl_mode = "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" } } deletion_protection = "<%= ctx[:vars]['deletion_protection'] %>" @@ -42,7 +42,7 @@ resource "google_sql_database_instance" "<%= ctx[:primary_resource_id] %>" { settings { tier = "db-custom-2-7680" ip_configuration { - require_ssl = "true" + ssl_mode = "ENCRYPTED_ONLY" } } deletion_protection = "<%= ctx[:vars]['deletion_protection'] %>" diff --git a/mmv1/templates/terraform/examples/subnetwork_reserved_internal_range.tf.erb b/mmv1/templates/terraform/examples/subnetwork_reserved_internal_range.tf.erb new file mode 100644 index 000000000000..7ab6053aba55 --- /dev/null +++ b/mmv1/templates/terraform/examples/subnetwork_reserved_internal_range.tf.erb @@ -0,0 +1,25 @@ +resource "google_compute_subnetwork" "<%= ctx[:primary_resource_id] %>" { + provider = google-beta + name = "<%= ctx[:vars]['subnetwork_name'] %>" + region = "us-central1" + network = google_compute_network.default.id + reserved_internal_range = "networkconnectivity.googleapis.com/${google_network_connectivity_internal_range.reserved.id}" +} + +resource "google_compute_network" "default" { + provider = google-beta + name = "<%= ctx[:vars]['network_name'] %>" + auto_create_subnetworks = false +} + +resource "google_network_connectivity_internal_range" "reserved" { + provider = google-beta + name = "reserved" + network = google_compute_network.default.id + usage = "FOR_VPC" + peering = "FOR_SELF" + prefix_length = 24 + target_cidr_range = [ + "10.0.0.0/8" + ] +} diff --git a/mmv1/templates/terraform/examples/subnetwork_reserved_secondary_range.tf.erb b/mmv1/templates/terraform/examples/subnetwork_reserved_secondary_range.tf.erb new file mode 100644 index 000000000000..7016615f74ad --- /dev/null +++ b/mmv1/templates/terraform/examples/subnetwork_reserved_secondary_range.tf.erb @@ -0,0 +1,42 @@ +resource "google_compute_subnetwork" "<%= ctx[:primary_resource_id] %>" { + provider = google-beta + name = "<%= ctx[:vars]['subnetwork_name'] %>" + region = "us-central1" + network = google_compute_network.default.id + reserved_internal_range = "networkconnectivity.googleapis.com/${google_network_connectivity_internal_range.reserved.id}" + + secondary_ip_range { + range_name = "secondary" + reserved_internal_range = "networkconnectivity.googleapis.com/${google_network_connectivity_internal_range.reserved_secondary.id}" + } +} + +resource "google_compute_network" "default" { + provider = google-beta + name = "<%= ctx[:vars]['network_name'] %>" + auto_create_subnetworks = false +} + +resource "google_network_connectivity_internal_range" "reserved" { + provider = google-beta + name = "reserved" + network = google_compute_network.default.id + usage = "FOR_VPC" + peering = "FOR_SELF" + prefix_length = 24 + target_cidr_range = [ + "10.0.0.0/8" + ] +} + +resource "google_network_connectivity_internal_range" "reserved_secondary" { + provider = google-beta + name = "reserved-secondary" + network = google_compute_network.default.id + usage = "FOR_VPC" + peering = "FOR_SELF" + prefix_length = 16 + target_cidr_range = [ + "10.0.0.0/8" + ] +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/tag_binding_basic.tf.erb b/mmv1/templates/terraform/examples/tag_binding_basic.tf.erb index 055199f03747..570f74c5e471 100644 --- a/mmv1/templates/terraform/examples/tag_binding_basic.tf.erb +++ b/mmv1/templates/terraform/examples/tag_binding_basic.tf.erb @@ -2,6 +2,7 @@ resource "google_project" "project" { project_id = "<%= ctx[:vars]['project_id'] %>" name = "<%= ctx[:vars]['project_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" + deletion_policy = "DELETE" } resource "google_tags_tag_key" "key" { diff --git a/mmv1/templates/terraform/examples/vertex_ai_featureonlinestore_featureview_cross_project.tf.erb b/mmv1/templates/terraform/examples/vertex_ai_featureonlinestore_featureview_cross_project.tf.erb index cd3b9f230e57..0608b40ec410 100644 --- a/mmv1/templates/terraform/examples/vertex_ai_featureonlinestore_featureview_cross_project.tf.erb +++ b/mmv1/templates/terraform/examples/vertex_ai_featureonlinestore_featureview_cross_project.tf.erb @@ -6,6 +6,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/templates/terraform/examples/vmware_engine_network_legacy.tf.erb b/mmv1/templates/terraform/examples/vmware_engine_network_legacy.tf.erb index 2e339d7b0113..f3e033249b4a 100644 --- a/mmv1/templates/terraform/examples/vmware_engine_network_legacy.tf.erb +++ b/mmv1/templates/terraform/examples/vmware_engine_network_legacy.tf.erb @@ -21,6 +21,7 @@ resource "google_project" "acceptance" { project_id = "<%= ctx[:vars]['proj_id'] %>" org_id = "<%= ctx[:test_env_vars]['org_id'] %>" billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/templates/terraform/examples/vpc_access_connector.tf.erb b/mmv1/templates/terraform/examples/vpc_access_connector.tf.erb index 46ab6b13120d..57fa413a5a36 100644 --- a/mmv1/templates/terraform/examples/vpc_access_connector.tf.erb +++ b/mmv1/templates/terraform/examples/vpc_access_connector.tf.erb @@ -2,4 +2,6 @@ resource "google_vpc_access_connector" "connector" { name = "<%= ctx[:vars]['name'] %>" ip_cidr_range = "10.8.0.0/28" network = "<%= ctx[:vars]['network_name'] %>" + min_instances = 2 + max_instances = 3 } diff --git a/mmv1/templates/terraform/examples/vpc_access_connector_shared_vpc.tf.erb b/mmv1/templates/terraform/examples/vpc_access_connector_shared_vpc.tf.erb index e2ce01691191..822e5f9eb02d 100644 --- a/mmv1/templates/terraform/examples/vpc_access_connector_shared_vpc.tf.erb +++ b/mmv1/templates/terraform/examples/vpc_access_connector_shared_vpc.tf.erb @@ -4,6 +4,8 @@ resource "google_vpc_access_connector" "connector" { name = google_compute_subnetwork.custom_test.name } machine_type = "e2-standard-4" + min_instances = 2 + max_instances = 3 } resource "google_compute_subnetwork" "custom_test" { diff --git a/mmv1/templates/terraform/extra_schema_entry/ssl_certificate.erb b/mmv1/templates/terraform/extra_schema_entry/ssl_certificate.erb index 589b25919642..e23b16ed87ec 100644 --- a/mmv1/templates/terraform/extra_schema_entry/ssl_certificate.erb +++ b/mmv1/templates/terraform/extra_schema_entry/ssl_certificate.erb @@ -7,11 +7,11 @@ Description: "Creates a unique name beginning with the specified prefix. Conflicts with name.", ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { // https://cloud.google.com/compute/docs/reference/latest/sslCertificates#resource - // uuid is 26 characters, limit the prefix to 37. + // uuid is 9 characters, limit the prefix to 54. value := v.(string) - if len(value) > 37 { + if len(value) > 54 { errors = append(errors, fmt.Errorf( - "%q cannot be longer than 37 characters, name is limited to 63", k)) + "%q cannot be longer than 54 characters, name is limited to 63", k)) } return }, diff --git a/mmv1/templates/terraform/pre_delete/active_directory_domain.go.erb b/mmv1/templates/terraform/pre_delete/active_directory_domain.go.erb new file mode 100644 index 000000000000..511c002f5e1c --- /dev/null +++ b/mmv1/templates/terraform/pre_delete/active_directory_domain.go.erb @@ -0,0 +1,3 @@ +if d.Get("deletion_protection").(bool) { + return fmt.Errorf("cannot destroy domain without setting deletion_protection=false and running `terraform apply`") +} diff --git a/mmv1/templates/terraform/pre_delete/cloudrunv2_job_deletion_policy.go.erb b/mmv1/templates/terraform/pre_delete/cloudrunv2_job_deletion_policy.go.erb new file mode 100644 index 000000000000..38c30189ea27 --- /dev/null +++ b/mmv1/templates/terraform/pre_delete/cloudrunv2_job_deletion_policy.go.erb @@ -0,0 +1,3 @@ +if d.Get("deletion_protection").(bool) { + return fmt.Errorf("cannot destroy job without setting deletion_protection=false and running `terraform apply`") +} \ No newline at end of file diff --git a/mmv1/templates/terraform/pre_delete/cloudrunv2_service_deletion_policy.go.erb b/mmv1/templates/terraform/pre_delete/cloudrunv2_service_deletion_policy.go.erb new file mode 100644 index 000000000000..444ac1bfe13c --- /dev/null +++ b/mmv1/templates/terraform/pre_delete/cloudrunv2_service_deletion_policy.go.erb @@ -0,0 +1,3 @@ +if d.Get("deletion_protection").(bool) { + return fmt.Errorf("cannot destroy service without setting deletion_protection=false and running `terraform apply`") +} \ No newline at end of file diff --git a/mmv1/templates/terraform/pre_delete/go/active_directory_domain.go.tmpl b/mmv1/templates/terraform/pre_delete/go/active_directory_domain.go.tmpl new file mode 100644 index 000000000000..511c002f5e1c --- /dev/null +++ b/mmv1/templates/terraform/pre_delete/go/active_directory_domain.go.tmpl @@ -0,0 +1,3 @@ +if d.Get("deletion_protection").(bool) { + return fmt.Errorf("cannot destroy domain without setting deletion_protection=false and running `terraform apply`") +} diff --git a/mmv1/templates/terraform/schema_property.erb b/mmv1/templates/terraform/schema_property.erb index 2be854b5b578..d2fe15b92c3a 100644 --- a/mmv1/templates/terraform/schema_property.erb +++ b/mmv1/templates/terraform/schema_property.erb @@ -26,9 +26,6 @@ <% if property.default_from_api -%> Computed: true, Optional: true, - <% if property.schema_config_mode_attr -%> - ConfigMode: schema.SchemaConfigModeAttr, - <% end -%> <% elsif property.required -%> Required: true, <% elsif property.output -%> diff --git a/mmv1/templates/terraform/schema_property.go.tmpl b/mmv1/templates/terraform/schema_property.go.tmpl index c17177d98427..10a70b36781e 100644 --- a/mmv1/templates/terraform/schema_property.go.tmpl +++ b/mmv1/templates/terraform/schema_property.go.tmpl @@ -27,9 +27,6 @@ {{ if .DefaultFromApi -}} Computed: true, Optional: true, - {{ if .SchemaConfigModeAttr -}} - ConfigMode: schema.SchemaConfigModeAttr, - {{ end -}} {{ else if .Required -}} Required: true, {{ else if .Output -}} diff --git a/mmv1/third_party/terraform/.teamcity/components/inputs/services_beta.kt b/mmv1/third_party/terraform/.teamcity/components/inputs/services_beta.kt index f34fbacc057e..a6c8565d1780 100644 --- a/mmv1/third_party/terraform/.teamcity/components/inputs/services_beta.kt +++ b/mmv1/third_party/terraform/.teamcity/components/inputs/services_beta.kt @@ -301,11 +301,6 @@ var ServicesListBeta = mapOf( "displayName" to "Dataprocmetastore", "path" to "./google-beta/services/dataprocmetastore" ), - "datastore" to mapOf( - "name" to "datastore", - "displayName" to "Datastore", - "path" to "./google-beta/services/datastore" - ), "datastream" to mapOf( "name" to "datastream", "displayName" to "Datastream", diff --git a/mmv1/third_party/terraform/.teamcity/components/inputs/services_ga.kt b/mmv1/third_party/terraform/.teamcity/components/inputs/services_ga.kt index f8a3bd76e6d9..bc928ad729c1 100644 --- a/mmv1/third_party/terraform/.teamcity/components/inputs/services_ga.kt +++ b/mmv1/third_party/terraform/.teamcity/components/inputs/services_ga.kt @@ -301,11 +301,6 @@ var ServicesListGa = mapOf( "displayName" to "Dataprocmetastore", "path" to "./google/services/dataprocmetastore" ), - "datastore" to mapOf( - "name" to "datastore", - "displayName" to "Datastore", - "path" to "./google/services/datastore" - ), "datastream" to mapOf( "name" to "datastream", "displayName" to "Datastream", diff --git a/mmv1/third_party/terraform/acctest/test_utils.go.erb b/mmv1/third_party/terraform/acctest/test_utils.go.erb index ae0ecaaf40e0..998a82f5bb1b 100644 --- a/mmv1/third_party/terraform/acctest/test_utils.go.erb +++ b/mmv1/third_party/terraform/acctest/test_utils.go.erb @@ -50,10 +50,7 @@ func CheckDataSourceStateMatchesResourceStateWithIgnores(dataSourceName, resourc if _, ok := ignoreFields[k]; ok { continue } - if _, ok := ignoreFields["labels.%"]; ok && strings.HasPrefix(k, "labels.") { - continue - } - if _, ok := ignoreFields["terraform_labels.%"]; ok && strings.HasPrefix(k, "terraform_labels.") { + if strings.HasPrefix(k, "labels.") || strings.HasPrefix(k, "terraform_labels.") || strings.HasPrefix(k, "effective_labels.") { continue } if k == "%" { diff --git a/mmv1/third_party/terraform/acctest/vcr_utils.go b/mmv1/third_party/terraform/acctest/vcr_utils.go index feea805d5999..a90c24fcc3a0 100644 --- a/mmv1/third_party/terraform/acctest/vcr_utils.go +++ b/mmv1/third_party/terraform/acctest/vcr_utils.go @@ -14,6 +14,7 @@ import ( "path/filepath" "reflect" "regexp" + "slices" "strconv" "strings" "sync" @@ -147,6 +148,20 @@ func VcrTest(t *testing.T, c resource.TestCase) { } else if isReleaseDiffEnabled() { c = initializeReleaseDiffTest(c, t.Name()) } + + // terraform_labels is a computed field to which "goog-terraform-provisioned": "true" is always + // added by the provider. ImportStateVerify "checks for strict equality and does not respect + // DiffSuppressFunc or CustomizeDiff" so any test using ImportStateVerify must ignore + // terraform_labels. + var steps []resource.TestStep + for _, s := range c.Steps { + if s.ImportStateVerify && !slices.Contains(s.ImportStateVerifyIgnore, "terraform_labels") { + s.ImportStateVerifyIgnore = append(s.ImportStateVerifyIgnore, "terraform_labels") + } + steps = append(steps, s) + } + c.Steps = steps + resource.Test(t, c) } diff --git a/mmv1/third_party/terraform/provider/provider.go.erb b/mmv1/third_party/terraform/provider/provider.go.erb index 59a6b338d90a..3c4dce74acd3 100644 --- a/mmv1/third_party/terraform/provider/provider.go.erb +++ b/mmv1/third_party/terraform/provider/provider.go.erb @@ -135,6 +135,7 @@ func Provider() *schema.Provider { "add_terraform_attribution_label": { Type: schema.TypeBool, Optional: true, + Default: true, }, "terraform_attribution_label_addition_strategy": { @@ -328,7 +329,6 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr config.DefaultLabels[k] = v.(string) } - // Attribution label is opt-in; if unset, the default for AddTerraformAttributionLabel is false. config.AddTerraformAttributionLabel = d.Get("add_terraform_attribution_label").(bool) if config.AddTerraformAttributionLabel { config.TerraformAttributionLabelAdditionStrategy = transport_tpg.CreateOnlyAttributionStrategy diff --git a/mmv1/third_party/terraform/services/accessapproval/data_source_access_approval_folder_service_account_test.go b/mmv1/third_party/terraform/services/accessapproval/data_source_access_approval_folder_service_account_test.go index b8d5438a9cf2..4af0dc66ba87 100644 --- a/mmv1/third_party/terraform/services/accessapproval/data_source_access_approval_folder_service_account_test.go +++ b/mmv1/third_party/terraform/services/accessapproval/data_source_access_approval_folder_service_account_test.go @@ -40,6 +40,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/mmv1/third_party/terraform/services/accessapproval/resource_access_approval_folder_settings_test.go b/mmv1/third_party/terraform/services/accessapproval/resource_access_approval_folder_settings_test.go index d6515f0a1f01..c24eb6f568b2 100644 --- a/mmv1/third_party/terraform/services/accessapproval/resource_access_approval_folder_settings_test.go +++ b/mmv1/third_party/terraform/services/accessapproval/resource_access_approval_folder_settings_test.go @@ -67,6 +67,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. @@ -94,6 +95,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. @@ -121,6 +123,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/mmv1/third_party/terraform/services/accesscontextmanager/resource_access_context_manager_access_policy_iam_test.go b/mmv1/third_party/terraform/services/accesscontextmanager/resource_access_context_manager_access_policy_iam_test.go index 493fdd7c385f..ba5c68df2dfd 100644 --- a/mmv1/third_party/terraform/services/accesscontextmanager/resource_access_context_manager_access_policy_iam_test.go +++ b/mmv1/third_party/terraform/services/accesscontextmanager/resource_access_context_manager_access_policy_iam_test.go @@ -138,6 +138,7 @@ func createScopedPolicy(t *testing.T, org string) string { project_id = "acm-tf-test-%s" name = "acm-tf-test-%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_access_context_manager_access_policy" "access-policy" { diff --git a/mmv1/third_party/terraform/services/activedirectory/resource_active_directory_domain_trust_test.go b/mmv1/third_party/terraform/services/activedirectory/resource_active_directory_domain_trust_test.go index 53d1d9516f2e..1ac00ac0457c 100644 --- a/mmv1/third_party/terraform/services/activedirectory/resource_active_directory_domain_trust_test.go +++ b/mmv1/third_party/terraform/services/activedirectory/resource_active_directory_domain_trust_test.go @@ -38,7 +38,7 @@ func TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample(t ResourceName: "google_active_directory_domain_trust.ad-domain-trust", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"trust_handshake_secret", "domain"}, + ImportStateVerifyIgnore: []string{"trust_handshake_secret", "domain", "deletion_protection"}, }, { Config: testAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustUpdate(context), @@ -47,7 +47,7 @@ func TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample(t ResourceName: "google_active_directory_domain_trust.ad-domain-trust", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"trust_handshake_secret", "domain"}, + ImportStateVerifyIgnore: []string{"trust_handshake_secret", "domain", "deletion_protection"}, }, }, }) @@ -56,12 +56,13 @@ func TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample(t func testAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_active_directory_domain_trust" "ad-domain-trust" { - domain = "ci-managed-ad.com" +domain = "ci-managed-ad.com" target_domain_name = "example-gcp.com" target_dns_ip_addresses = ["10.1.0.100"] trust_direction = "OUTBOUND" trust_type = "FOREST" trust_handshake_secret = "Testing1!" + deletion_protection = false } `, context) } @@ -75,6 +76,7 @@ resource "google_active_directory_domain_trust" "ad-domain-trust" { trust_direction = "OUTBOUND" trust_type = "FOREST" trust_handshake_secret = "Testing1!" + deletion_protection = false } `, context) } diff --git a/mmv1/third_party/terraform/services/activedirectory/resource_active_directory_domain_update_test.go b/mmv1/third_party/terraform/services/activedirectory/resource_active_directory_domain_update_test.go index ca16715704e8..99cfd99add05 100644 --- a/mmv1/third_party/terraform/services/activedirectory/resource_active_directory_domain_update_test.go +++ b/mmv1/third_party/terraform/services/activedirectory/resource_active_directory_domain_update_test.go @@ -39,7 +39,7 @@ func TestAccActiveDirectoryDomain_update(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"domain_name", "labels", "terraform_labels"}, + ImportStateVerifyIgnore: []string{"domain_name", "labels", "terraform_labels", "deletion_protection"}, }, { Config: testAccADDomainUpdate(context), @@ -48,7 +48,7 @@ func TestAccActiveDirectoryDomain_update(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"domain_name", "labels", "terraform_labels"}, + ImportStateVerifyIgnore: []string{"domain_name", "labels", "terraform_labels", "deletion_protection"}, }, { Config: testAccADDomainBasic(context), @@ -57,7 +57,7 @@ func TestAccActiveDirectoryDomain_update(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"domain_name", "labels", "terraform_labels"}, + ImportStateVerifyIgnore: []string{"domain_name", "labels", "terraform_labels", "deletion_protection"}, }, }, }) @@ -70,6 +70,7 @@ func testAccADDomainBasic(context map[string]interface{}) string { domain_name = "%{domain}" locations = ["us-central1"] reserved_ip_range = "192.168.255.0/24" + deletion_protection = false } `, context) } @@ -80,6 +81,7 @@ func testAccADDomainUpdate(context map[string]interface{}) string { domain_name = "%{domain}" locations = ["us-central1", "us-west1"] reserved_ip_range = "192.168.255.0/24" + deletion_protection = false labels = { env = "test" } diff --git a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_backup_test.go b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_backup_test.go index f26a57f986b6..cecaaa8c708c 100644 --- a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_backup_test.go +++ b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_backup_test.go @@ -60,7 +60,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "default" { @@ -94,7 +96,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "default" { @@ -142,7 +146,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "default" { location = "us-central1" cluster_id = "tf-test-alloydb-cluster%{random_suffix}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" { } @@ -209,7 +215,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "default" { diff --git a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_cluster_restore_test.go b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_cluster_restore_test.go index c59d8a8c1029..4685bd07752a 100644 --- a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_cluster_restore_test.go +++ b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_cluster_restore_test.go @@ -86,7 +86,9 @@ func testAccAlloydbClusterAndInstanceAndBackup(context map[string]interface{}) s resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -117,7 +119,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_OnlyOneSourceAllowed(context map[ resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -137,7 +141,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "restored" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_backup_source { backup_name = google_alloydb_backup.default.name } @@ -165,7 +171,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_SourceClusterAndPointInTimeRequir resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -185,7 +193,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "restored" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.source.name @@ -209,7 +219,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_RestoredFromBackup(context map[st resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -229,7 +241,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "restored_from_backup" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_backup_source { backup_name = google_alloydb_backup.default.name } @@ -254,7 +268,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_RestoredFromBackupAndRestoredFrom resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -274,7 +290,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "restored_from_backup" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_backup_source { backup_name = google_alloydb_backup.default.name } @@ -287,7 +305,9 @@ resource "google_alloydb_cluster" "restored_from_backup" { resource "google_alloydb_cluster" "restored_from_point_in_time" { cluster_id = "tf-test-alloydb-pitr-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.source.name point_in_time = google_alloydb_backup.default.update_time @@ -313,7 +333,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_RestoredFromBackupAndRestoredFrom resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -333,7 +355,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "restored_from_backup" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_backup_source { backup_name = google_alloydb_backup.default.name } @@ -351,7 +375,9 @@ resource "google_alloydb_cluster" "restored_from_backup" { resource "google_alloydb_cluster" "restored_from_point_in_time" { cluster_id = "tf-test-alloydb-pitr-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.source.name point_in_time = google_alloydb_backup.default.update_time @@ -382,7 +408,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_RestoredFromBackupAndRestoredFrom resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -410,7 +438,9 @@ resource "google_alloydb_backup" "default2" { resource "google_alloydb_cluster" "restored_from_backup" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_backup_source { backup_name = google_alloydb_backup.default2.name } @@ -430,7 +460,9 @@ resource "google_alloydb_cluster" "restored_from_backup" { resource "google_alloydb_cluster" "restored_from_point_in_time" { cluster_id = "tf-test-alloydb-pitr-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.restored_from_backup.name point_in_time = google_alloydb_backup.default.update_time @@ -461,7 +493,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_RestoredFromBackupAndRestoredFrom resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -481,7 +515,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "restored_from_backup" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_backup_source { backup_name = google_alloydb_backup.default.name } @@ -490,7 +526,9 @@ resource "google_alloydb_cluster" "restored_from_backup" { resource "google_alloydb_cluster" "restored_from_point_in_time" { cluster_id = "tf-test-alloydb-pitr-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.source.name point_in_time = google_alloydb_backup.default.update_time diff --git a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_cluster_test.go b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_cluster_test.go index f1ed5a5614e7..0850932b2102 100644 --- a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_cluster_test.go +++ b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_cluster_test.go @@ -50,7 +50,9 @@ func testAccAlloydbCluster_update(context map[string]interface{}) string { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } labels = { foo = "bar" @@ -188,7 +190,9 @@ func testAccAlloydbCluster_withInitialUserAndAutomatedBackupPolicy(context map[s resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } initial_user { user = "tf-test-alloydb-cluster%{random_suffix}" @@ -238,7 +242,9 @@ func testAccAlloydbCluster_withoutInitialUserAndAutomatedBackupPolicy(context ma resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } lifecycle { prevent_destroy = true } @@ -283,7 +289,9 @@ func testAccAlloydbCluster_missingWeeklySchedule(context map[string]interface{}) resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } automated_backup_policy { location = "us-central1" backup_window = "1800s" @@ -384,7 +392,9 @@ func testAccAlloydbCluster_withTimeBasedRetentionPolicy(context map[string]inter resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } automated_backup_policy { location = "us-central1" backup_window = "1800s" @@ -425,7 +435,9 @@ func testAccAlloydbCluster_withoutTimeBasedRetentionPolicy(context map[string]in resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } automated_backup_policy { location = "us-central1" backup_window = "1800s" @@ -488,7 +500,9 @@ func testAccAlloydbCluster_usingCMEK(context map[string]interface{}) string { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } encryption_config { kms_key_name = google_kms_crypto_key.key.id } @@ -563,7 +577,9 @@ func testAccAlloydbCluster_usingCMEKInClusterAndAutomatedBackup(context map[stri resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } encryption_config { kms_key_name = google_kms_crypto_key.key.id } @@ -613,7 +629,9 @@ func testAccAlloydbCluster_updateCMEKInAutomatedBackup(context map[string]interf resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } encryption_config { kms_key_name = google_kms_crypto_key.key.id } @@ -674,7 +692,9 @@ func testAccAlloydbCluster_usingCMEKallowDeletion(context map[string]interface{} resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } encryption_config { kms_key_name = google_kms_crypto_key.key.id } @@ -921,7 +941,9 @@ func testAccAlloydbCluster_withoutContinuousBackupConfig(context map[string]inte resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } lifecycle { prevent_destroy = true } @@ -941,7 +963,9 @@ func testAccAlloydbCluster_continuousBackupConfig(context map[string]interface{} resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } continuous_backup_config { enabled = %{enabled} @@ -1020,7 +1044,9 @@ func testAccAlloydbCluster_usingCMEKInClusterAndContinuousBackup(context map[str resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } continuous_backup_config { enabled = true recovery_window_days = 20 @@ -1053,7 +1079,9 @@ func testAccAlloydbCluster_continuousBackupUsingCMEKAllowDeletion(context map[st resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } continuous_backup_config { enabled = true recovery_window_days = 20 @@ -1109,7 +1137,7 @@ resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" } } data "google_project" "project" {} @@ -1150,8 +1178,8 @@ resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" - allocated_ip_range = google_compute_global_address.private_ip_alloc.name + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + allocated_ip_range = google_compute_global_address.private_ip_alloc.name } } data "google_project" "project" {} @@ -1200,7 +1228,7 @@ resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" } maintenance_update_policy { maintenance_windows { @@ -1252,7 +1280,9 @@ func testAccAlloydbCluster_withMaintenanceWindowMissingStartTime(context map[str resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } maintenance_update_policy { maintenance_windows { @@ -1274,7 +1304,9 @@ func testAccAlloydbCluster_withMaintenanceWindowMissingDay(context map[string]in resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } maintenance_update_policy { maintenance_windows { diff --git a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_instance_test.go b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_instance_test.go index 37d9cd7309a5..440134ac5b70 100644 --- a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_instance_test.go +++ b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_instance_test.go @@ -58,8 +58,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id - + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf-test-alloydb-cluster%{random_suffix}" } @@ -90,7 +91,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf-test-alloydb-cluster%{random_suffix}" @@ -135,7 +138,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -205,7 +210,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -258,7 +265,9 @@ resource "google_alloydb_instance" "read_pool" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -312,7 +321,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -337,7 +348,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -525,7 +538,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -554,7 +569,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -668,7 +685,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf-test-alloydb-cluster%{random_suffix}" } @@ -703,7 +722,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf-test-alloydb-cluster%{random_suffix}" } diff --git a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_secondary_cluster_test.go b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_secondary_cluster_test.go index 649014e4b7d5..f088012353ac 100644 --- a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_secondary_cluster_test.go +++ b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_secondary_cluster_test.go @@ -41,7 +41,9 @@ func testAccAlloydbCluster_secondaryClusterMandatoryFields(context map[string]in resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -57,7 +59,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -106,7 +110,9 @@ func testAccAlloydbCluster_secondaryClusterMissingSecondaryConfig(context map[st resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -122,7 +128,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -170,7 +178,9 @@ func testAccAlloydbCluster_secondaryClusterDefinedSecondaryConfigButMissingClust resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -186,7 +196,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } continuous_backup_config { enabled = false @@ -234,7 +246,9 @@ func testAccAlloydbCluster_secondaryClusterDefinedSecondaryConfigButClusterTypeI resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -250,7 +264,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -313,7 +329,9 @@ func testAccAlloydbCluster_secondaryClusterUpdate(context map[string]interface{} resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -329,7 +347,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -387,7 +407,9 @@ func testAccAlloydbCluster_secondaryClusterUsingCMEK(context map[string]interfac resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -403,7 +425,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -481,7 +505,7 @@ resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" + network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" } } @@ -499,7 +523,7 @@ resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" + network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" } cluster_type = "SECONDARY" @@ -556,8 +580,8 @@ resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" - allocated_ip_range = data.google_compute_global_address.private_ip_alloc.name + network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" + allocated_ip_range = data.google_compute_global_address.private_ip_alloc.name } } @@ -575,8 +599,8 @@ resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" - allocated_ip_range = data.google_compute_global_address.private_ip_alloc.name + network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" + allocated_ip_range = data.google_compute_global_address.private_ip_alloc.name } cluster_type = "SECONDARY" @@ -645,7 +669,9 @@ func testAccAlloydbInstance_secondaryClusterWithInstance(context map[string]inte resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -661,7 +687,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -704,7 +732,9 @@ func testAccAlloydbCluster_secondaryClusterPromote(context map[string]interface{ resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -720,7 +750,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -792,7 +824,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteAndSimultaneousUpdate(context resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -808,7 +842,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -893,7 +929,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteAndDeleteOriginalPrimary(conte resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -974,7 +1012,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteAndUpdate(context map[string]i resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -990,7 +1030,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -1253,7 +1295,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteAndAddAutomatedBackupPolicyAnd resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -1269,7 +1313,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -1389,7 +1435,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteWithTimeBasedRetentionPolicy(c resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -1405,7 +1453,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -1470,7 +1520,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteWithoutTimeBasedRetentionPolic resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -1486,7 +1538,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -1594,7 +1648,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteAndAddContinuousBackupConfig(c resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -1610,7 +1666,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { diff --git a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_secondary_instance_test.go b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_secondary_instance_test.go index a167c4a1d69c..eddf0b2c77fe 100644 --- a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_secondary_instance_test.go +++ b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_secondary_instance_test.go @@ -48,7 +48,9 @@ func testAccAlloydbInstance_secondaryInstanceInitial(context map[string]interfac resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -64,7 +66,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -103,7 +107,9 @@ func testAccAlloydbInstance_secondaryInstanceUpdateMachineConfig(context map[str resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -119,7 +125,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -185,7 +193,9 @@ func testAccAlloydbInstance_secondaryInstanceWithReadPoolInstance(context map[st resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -201,7 +211,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-west1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -379,7 +391,9 @@ func testAccAlloydbInstance_secondaryInstanceUpdateDatabaseFlag(context map[stri resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -395,7 +409,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -474,7 +490,9 @@ func testAccAlloydbInstance_secondaryInstanceUpdateQueryInsightConfig(context ma resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -490,7 +508,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -563,7 +583,9 @@ func testAccAlloydbInstance_secondaryInstanceMaximumFields(context map[string]in resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -579,7 +601,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-west1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_user_test.go b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_user_test.go index 73d18bb4fb7e..ef4d7c99d674 100644 --- a/mmv1/third_party/terraform/services/alloydb/resource_alloydb_user_test.go +++ b/mmv1/third_party/terraform/services/alloydb/resource_alloydb_user_test.go @@ -53,7 +53,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf_test_cluster_secret%{random_suffix}" @@ -123,7 +125,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf_test_cluster_secret%{random_suffix}" @@ -192,7 +196,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf_test_cluster_secret%{random_suffix}" } diff --git a/mmv1/third_party/terraform/services/apigee/go/resource_apigee_environment_type_test.go.tmpl b/mmv1/third_party/terraform/services/apigee/go/resource_apigee_environment_type_test.go.tmpl index 3742eb83d05f..3660864ab62f 100644 --- a/mmv1/third_party/terraform/services/apigee/go/resource_apigee_environment_type_test.go.tmpl +++ b/mmv1/third_party/terraform/services/apigee/go/resource_apigee_environment_type_test.go.tmpl @@ -55,6 +55,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/third_party/terraform/services/apigee/resource_apigee_env_keystore_alias_pkcs12_test.go b/mmv1/third_party/terraform/services/apigee/resource_apigee_env_keystore_alias_pkcs12_test.go index dc31cf1e22f9..0552bfc2f450 100644 --- a/mmv1/third_party/terraform/services/apigee/resource_apigee_env_keystore_alias_pkcs12_test.go +++ b/mmv1/third_party/terraform/services/apigee/resource_apigee_env_keystore_alias_pkcs12_test.go @@ -50,6 +50,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/third_party/terraform/services/apigee/resource_apigee_environment_type_test.go.erb b/mmv1/third_party/terraform/services/apigee/resource_apigee_environment_type_test.go.erb index 075ac5bd3911..b6e640e691ee 100644 --- a/mmv1/third_party/terraform/services/apigee/resource_apigee_environment_type_test.go.erb +++ b/mmv1/third_party/terraform/services/apigee/resource_apigee_environment_type_test.go.erb @@ -56,6 +56,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/third_party/terraform/services/apigee/resource_apigee_flowhook_test.go b/mmv1/third_party/terraform/services/apigee/resource_apigee_flowhook_test.go index bef990185f2f..79619fee6e82 100644 --- a/mmv1/third_party/terraform/services/apigee/resource_apigee_flowhook_test.go +++ b/mmv1/third_party/terraform/services/apigee/resource_apigee_flowhook_test.go @@ -49,6 +49,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/third_party/terraform/services/apigee/resource_apigee_keystores_aliases_key_cert_file_test.go b/mmv1/third_party/terraform/services/apigee/resource_apigee_keystores_aliases_key_cert_file_test.go index e55b29ffeee0..5a9e912ae451 100644 --- a/mmv1/third_party/terraform/services/apigee/resource_apigee_keystores_aliases_key_cert_file_test.go +++ b/mmv1/third_party/terraform/services/apigee/resource_apigee_keystores_aliases_key_cert_file_test.go @@ -59,6 +59,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { @@ -180,6 +181,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/third_party/terraform/services/apigee/resource_apigee_sharedflow_deployment_test.go b/mmv1/third_party/terraform/services/apigee/resource_apigee_sharedflow_deployment_test.go index 036d39673ce2..f069067d3c97 100644 --- a/mmv1/third_party/terraform/services/apigee/resource_apigee_sharedflow_deployment_test.go +++ b/mmv1/third_party/terraform/services/apigee/resource_apigee_sharedflow_deployment_test.go @@ -60,6 +60,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/third_party/terraform/services/apigee/resource_apigee_sharedflow_test.go b/mmv1/third_party/terraform/services/apigee/resource_apigee_sharedflow_test.go index d4ef8ef4289a..6e8761c69987 100644 --- a/mmv1/third_party/terraform/services/apigee/resource_apigee_sharedflow_test.go +++ b/mmv1/third_party/terraform/services/apigee/resource_apigee_sharedflow_test.go @@ -60,6 +60,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { @@ -166,6 +167,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/third_party/terraform/services/apigee/resource_apigee_sync_authorization_test.go b/mmv1/third_party/terraform/services/apigee/resource_apigee_sync_authorization_test.go index 97d0a8830f32..e297e3171f14 100644 --- a/mmv1/third_party/terraform/services/apigee/resource_apigee_sync_authorization_test.go +++ b/mmv1/third_party/terraform/services/apigee/resource_apigee_sync_authorization_test.go @@ -59,6 +59,7 @@ resource "google_project" "project" { name = "tf-test-my-project%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { @@ -102,6 +103,7 @@ resource "google_project" "project" { name = "tf-test-my-project%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { @@ -161,6 +163,7 @@ resource "google_project" "project" { name = "tf-test-my-project%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/third_party/terraform/services/apigee/resource_apigee_target_server_test.go b/mmv1/third_party/terraform/services/apigee/resource_apigee_target_server_test.go index 6387d6828a6b..2676b594408b 100644 --- a/mmv1/third_party/terraform/services/apigee/resource_apigee_target_server_test.go +++ b/mmv1/third_party/terraform/services/apigee/resource_apigee_target_server_test.go @@ -52,6 +52,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { @@ -128,6 +129,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { @@ -240,6 +242,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { @@ -349,6 +352,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "apigee" { diff --git a/mmv1/third_party/terraform/services/appengine/resource_app_engine_application_test.go b/mmv1/third_party/terraform/services/appengine/resource_app_engine_application_test.go index bf13977689b8..f666f04bd5d6 100644 --- a/mmv1/third_party/terraform/services/appengine/resource_app_engine_application_test.go +++ b/mmv1/third_party/terraform/services/appengine/resource_app_engine_application_test.go @@ -78,6 +78,7 @@ resource "google_project" "acceptance" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_app_engine_application" "acceptance" { @@ -102,6 +103,7 @@ resource "google_project" "acceptance" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_app_engine_application" "acceptance" { @@ -121,6 +123,7 @@ resource "google_project" "acceptance" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_app_engine_application" "acceptance" { diff --git a/mmv1/third_party/terraform/services/appengine/resource_app_engine_flexible_app_version_test.go.erb b/mmv1/third_party/terraform/services/appengine/resource_app_engine_flexible_app_version_test.go.erb index a233e5c3aa97..bd3832d48dd1 100644 --- a/mmv1/third_party/terraform/services/appengine/resource_app_engine_flexible_app_version_test.go.erb +++ b/mmv1/third_party/terraform/services/appengine/resource_app_engine_flexible_app_version_test.go.erb @@ -59,6 +59,7 @@ resource "google_project" "my_project" { project_id = "tf-test-appeng-flex%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { @@ -245,6 +246,7 @@ resource "google_project" "my_project" { project_id = "tf-test-appeng-flex%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { diff --git a/mmv1/third_party/terraform/services/appengine/resource_app_engine_standard_app_version_test.go b/mmv1/third_party/terraform/services/appengine/resource_app_engine_standard_app_version_test.go index 8fee78713b8e..e0dcae079430 100644 --- a/mmv1/third_party/terraform/services/appengine/resource_app_engine_standard_app_version_test.go +++ b/mmv1/third_party/terraform/services/appengine/resource_app_engine_standard_app_version_test.go @@ -64,6 +64,7 @@ resource "google_project" "my_project" { project_id = "tf-test-appeng-std%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_app_engine_application" "app" { @@ -151,6 +152,7 @@ resource "google_project" "my_project" { project_id = "tf-test-appeng-std%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_app_engine_application" "app" { @@ -190,6 +192,8 @@ resource "google_vpc_access_connector" "bar" { region = "us-central1" ip_cidr_range = "10.8.0.16/28" network = "default" + min_throughput = 200 + max_throughput = 300 } resource "google_app_engine_standard_app_version" "foo" { @@ -270,6 +274,7 @@ resource "google_project" "my_project" { project_id = "tf-test-appeng-std%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_app_engine_application" "app" { diff --git a/mmv1/third_party/terraform/services/apphub/data_source_apphub_discovered_service_test.go b/mmv1/third_party/terraform/services/apphub/data_source_apphub_discovered_service_test.go index be4d994d6ec0..6612c9caa0a7 100644 --- a/mmv1/third_party/terraform/services/apphub/data_source_apphub_discovered_service_test.go +++ b/mmv1/third_party/terraform/services/apphub/data_source_apphub_discovered_service_test.go @@ -42,6 +42,7 @@ resource "google_project" "service_project" { name = "Service Project" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } # Enable Compute API diff --git a/mmv1/third_party/terraform/services/apphub/data_source_apphub_discovered_workload_test.go b/mmv1/third_party/terraform/services/apphub/data_source_apphub_discovered_workload_test.go index 0a8ba2ec4253..d47fd4d35c50 100644 --- a/mmv1/third_party/terraform/services/apphub/data_source_apphub_discovered_workload_test.go +++ b/mmv1/third_party/terraform/services/apphub/data_source_apphub_discovered_workload_test.go @@ -41,6 +41,7 @@ resource "google_project" "service_project" { name = "Service Project" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } # Enable Compute API diff --git a/mmv1/third_party/terraform/services/apphub/resource_apphub_service_test.go b/mmv1/third_party/terraform/services/apphub/resource_apphub_service_test.go index 943f03bb5900..bda173d120cf 100644 --- a/mmv1/third_party/terraform/services/apphub/resource_apphub_service_test.go +++ b/mmv1/third_party/terraform/services/apphub/resource_apphub_service_test.go @@ -64,6 +64,7 @@ resource "google_project" "service_project" { name = "Service Project" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } # Enable Compute API diff --git a/mmv1/third_party/terraform/services/apphub/resource_apphub_workload_test.go b/mmv1/third_party/terraform/services/apphub/resource_apphub_workload_test.go index 7f03b3d35ea7..9093ff57aecc 100644 --- a/mmv1/third_party/terraform/services/apphub/resource_apphub_workload_test.go +++ b/mmv1/third_party/terraform/services/apphub/resource_apphub_workload_test.go @@ -64,6 +64,7 @@ resource "google_project" "service_project" { name = "Service Project" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } # Enable Compute API diff --git a/mmv1/third_party/terraform/services/bigquery/resource_bigquery_dataset_test.go b/mmv1/third_party/terraform/services/bigquery/resource_bigquery_dataset_test.go index 52c52f5eab07..876291d15ef3 100644 --- a/mmv1/third_party/terraform/services/bigquery/resource_bigquery_dataset_test.go +++ b/mmv1/third_party/terraform/services/bigquery/resource_bigquery_dataset_test.go @@ -123,7 +123,7 @@ func TestAccBigQueryDataset_withComputedLabels(t *testing.T) { resource.TestCheckResourceAttr("google_bigquery_dataset.test", "labels.env", "foo"), resource.TestCheckResourceAttr("google_bigquery_dataset.test", "labels.default_table_expiration_ms", "3600000"), - resource.TestCheckResourceAttr("google_bigquery_dataset.test", "effective_labels.%", "2"), + resource.TestCheckResourceAttr("google_bigquery_dataset.test", "effective_labels.%", "3"), resource.TestCheckResourceAttr("google_bigquery_dataset.test", "effective_labels.env", "foo"), resource.TestCheckResourceAttr("google_bigquery_dataset.test", "effective_labels.default_table_expiration_ms", "3600000"), ), @@ -494,6 +494,10 @@ func addOutOfBandLabels(t *testing.T, datasetID string) resource.TestCheckFunc { func testAccBigQueryDataset_withoutLabels(datasetID string) string { return fmt.Sprintf(` +provider "google" { + add_terraform_attribution_label = false +} + resource "google_bigquery_dataset" "test" { dataset_id = "%s" friendly_name = "foo" diff --git a/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go b/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go index 6294de78c108..1a991ee0eb08 100644 --- a/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go +++ b/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go @@ -1250,14 +1250,6 @@ func ResourceBigQueryTable() *schema.Resource { Description: `Whether Terraform will be prevented from destroying the instance. When the field is set to true or unset in Terraform state, a terraform apply or terraform destroy that would delete the table will fail. When the field is set to false, deleting the table is allowed.`, }, - "allow_resource_tags_on_deletion": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: `**Deprecated** Whether or not to allow table deletion when there are still resource tags attached.`, - Deprecated: `This field is deprecated and will be removed in a future major release. The default behavior will be allowing the presence of resource tags on deletion after the next major release.`, - }, - // TableConstraints: [Optional] Defines the primary key and foreign keys. "table_constraints": { Type: schema.TypeList, @@ -1592,6 +1584,9 @@ func resourceBigQueryTableCreate(d *schema.ResourceData, meta interface{}) error } if table.View != nil && table.Schema != nil { + if schemaHasRequiredFields(table.Schema) { + return errors.New("Schema cannot contain required fields when creating a view") + } log.Printf("[INFO] Removing schema from table definition because BigQuery does not support setting schema on view creation") schemaBack := table.Schema @@ -1927,17 +1922,6 @@ func resourceBigQueryTableDelete(d *schema.ResourceData, meta interface{}) error if d.Get("deletion_protection").(bool) { return fmt.Errorf("cannot destroy table %v without setting deletion_protection=false and running `terraform apply`", d.Id()) } - if v, ok := d.GetOk("resource_tags"); ok { - if !d.Get("allow_resource_tags_on_deletion").(bool) { - var resourceTags []string - - for k, v := range v.(map[string]interface{}) { - resourceTags = append(resourceTags, fmt.Sprintf("%s:%s", k, v.(string))) - } - - return fmt.Errorf("cannot destroy table %v without unsetting the following resource tags or setting allow_resource_tags_on_deletion=true: %v", d.Id(), resourceTags) - } - } config := meta.(*transport_tpg.Config) userAgent, err := tpgresource.GenerateUserAgentString(d, config.UserAgent) @@ -2550,6 +2534,15 @@ func setEmptyPolicyTagsInSchema(field *bigquery.TableFieldSchema) { } } +func schemaHasRequiredFields(schema *bigquery.TableSchema) bool { + for _, field := range schema.Fields { + if "REQUIRED" == field.Mode { + return true + } + } + return false +} + func expandTimePartitioning(configured interface{}) *bigquery.TimePartitioning { raw := configured.([]interface{})[0].(map[string]interface{}) tp := &bigquery.TimePartitioning{Type: raw["type"].(string)} @@ -2935,9 +2928,6 @@ func resourceBigQueryTableImport(d *schema.ResourceData, meta interface{}) ([]*s if err := d.Set("deletion_protection", true); err != nil { return nil, fmt.Errorf("Error setting deletion_protection: %s", err) } - if err := d.Set("allow_resource_tags_on_deletion", false); err != nil { - return nil, fmt.Errorf("Error setting allow_resource_tags_on_deletion: %s", err) - } // Replace import id for the resource id id, err := tpgresource.ReplaceVars(d, config, "projects/{{project}}/datasets/{{dataset_id}}/tables/{{table_id}}") diff --git a/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table_test.go b/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table_test.go index a9f324b2b986..1f2edf51cf90 100644 --- a/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table_test.go +++ b/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table_test.go @@ -1515,6 +1515,23 @@ func TestAccBigQueryTable_invalidSchemas(t *testing.T) { }) } +func TestAccBigQueryTable_schemaWithRequiredFieldAndView(t *testing.T) { + datasetID := fmt.Sprintf("tf_test_%s", acctest.RandString(t, 10)) + tableID := fmt.Sprintf("tf_test_%s", acctest.RandString(t, 10)) + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + CheckDestroy: testAccCheckBigQueryTableDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccBigQueryTableWithSchemaWithRequiredFieldAndView(datasetID, tableID), + ExpectError: regexp.MustCompile("Schema cannot contain required fields when creating a view"), + }, + }, + }) +} + func TestAccBigQueryTable_TableReplicationInfo_ConflictsWithView(t *testing.T) { t.Parallel() @@ -1628,7 +1645,7 @@ func TestAccBigQueryTable_ResourceTags(t *testing.T) { ResourceName: "google_bigquery_table.test", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"deletion_protection", "allow_resource_tags_on_deletion"}, + ImportStateVerifyIgnore: []string{"deletion_protection"}, }, { Config: testAccBigQueryTableWithResourceTagsUpdate(context), @@ -1637,7 +1654,7 @@ func TestAccBigQueryTable_ResourceTags(t *testing.T) { ResourceName: "google_bigquery_table.test", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"deletion_protection", "allow_resource_tags_on_deletion"}, + ImportStateVerifyIgnore: []string{"deletion_protection"}, }, // testAccBigQueryTableWithResourceTagsDestroy must be called at the end of this test to clear the resource tag bindings of the table before deletion. { @@ -1647,7 +1664,7 @@ func TestAccBigQueryTable_ResourceTags(t *testing.T) { ResourceName: "google_bigquery_table.test", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"deletion_protection", "allow_resource_tags_on_deletion"}, + ImportStateVerifyIgnore: []string{"deletion_protection"}, }, }, }) @@ -4038,6 +4055,42 @@ resource "google_bigquery_table" "test" { `, datasetID, tableID) } +func testAccBigQueryTableWithSchemaWithRequiredFieldAndView(datasetID, tableID string) string { + return fmt.Sprintf(` +resource "google_bigquery_dataset" "test" { + dataset_id = "%s" +} + +resource "google_bigquery_table" "test" { + deletion_protection = false + table_id = "%s" + dataset_id = google_bigquery_dataset.test.dataset_id + schema = < func TestAccCloudRunService_csiVolume(t *testing.T) { + acctest.SkipIfVcr(t) t.Parallel() project := envvar.GetTestProjectFromEnv() diff --git a/mmv1/third_party/terraform/services/cloudrunv2/data_source_google_cloud_run_v2_job_test.go b/mmv1/third_party/terraform/services/cloudrunv2/data_source_google_cloud_run_v2_job_test.go index a3afa67f6769..e59989e2e0f5 100644 --- a/mmv1/third_party/terraform/services/cloudrunv2/data_source_google_cloud_run_v2_job_test.go +++ b/mmv1/third_party/terraform/services/cloudrunv2/data_source_google_cloud_run_v2_job_test.go @@ -39,6 +39,7 @@ func testAccDataSourceGoogleCloudRunV2Job_basic(name, location string) string { resource "google_cloud_run_v2_job" "hello" { name = "%s" location = "%s" + deletion_protection = false template { template { @@ -100,6 +101,7 @@ func testAccDataSourceGoogleCloudRunV2Job_bindIAMPermission(name, location strin resource "google_cloud_run_v2_job" "hello" { name = "%s" location = "%s" + deletion_protection = false template { template { diff --git a/mmv1/third_party/terraform/services/cloudrunv2/data_source_google_cloud_run_v2_service_test.go b/mmv1/third_party/terraform/services/cloudrunv2/data_source_google_cloud_run_v2_service_test.go index 4c9cedb3c7e7..cb5921fa2567 100644 --- a/mmv1/third_party/terraform/services/cloudrunv2/data_source_google_cloud_run_v2_service_test.go +++ b/mmv1/third_party/terraform/services/cloudrunv2/data_source_google_cloud_run_v2_service_test.go @@ -39,6 +39,7 @@ func testAccDataSourceGoogleCloudRunV2Service_basic(name, location string) strin resource "google_cloud_run_v2_service" "hello" { name = "%s" location = "%s" + deletion_protection = false ingress = "INGRESS_TRAFFIC_ALL" template { @@ -93,6 +94,7 @@ func testAccDataSourceGoogleCloudRunV2Service_bindIAMPermission(name, location s resource "google_cloud_run_v2_service" "hello" { name = "%s" location = "%s" + deletion_protection = false ingress = "INGRESS_TRAFFIC_ALL" template { diff --git a/mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_job_test.go.erb b/mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_job_test.go.erb index 48f87130f25e..114ed5e58652 100644 --- a/mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_job_test.go.erb +++ b/mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_job_test.go.erb @@ -38,7 +38,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobFullUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_job.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"location", "launch_stage", "labels", "terraform_labels", "annotations"}, + ImportStateVerifyIgnore: []string{"location", "launch_stage", "labels", "terraform_labels", "annotations", "deletion_protection"}, }, }, }) @@ -117,6 +117,7 @@ func testAccCloudRunV2Job_cloudrunv2JobFullUpdate(context map[string]interface{} resource "google_cloud_run_v2_job" "default" { name = "tf-test-cloudrun-job%{random_suffix}" location = "us-central1" + deletion_protection = false binary_authorization { use_default = true breakglass_justification = "Some justification" @@ -229,7 +230,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobWithDirectVPCUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_job.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"location", "launch_stage"}, + ImportStateVerifyIgnore: []string{"location", "launch_stage", "deletion_protection"}, }, { Config: testAccCloudRunV2Job_cloudrunv2JobWithDirectVPCAndNamedBinAuthPolicyUpdate(context), @@ -238,7 +239,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobWithDirectVPCUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_job.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"location", "launch_stage"}, + ImportStateVerifyIgnore: []string{"location", "launch_stage", "deletion_protection"}, }, }, }) @@ -249,6 +250,8 @@ func testAccCloudRunV2Job_cloudrunv2JobWithDirectVPC(context map[string]interfac resource "google_cloud_run_v2_job" "default" { name = "%{job_name}" location = "us-central1" + deletion_protection = false + launch_stage = "BETA" template { template { containers { @@ -276,6 +279,8 @@ func testAccCloudRunV2Job_cloudrunv2JobWithDirectVPCAndNamedBinAuthPolicyUpdate( resource "google_cloud_run_v2_job" "default" { name = "%{job_name}" location = "us-central1" + deletion_protection = false + launch_stage = "BETA" binary_authorization { policy = "projects/%{project}/platforms/cloudRun/policies/my-policy" breakglass_justification = "Some justification" @@ -306,6 +311,7 @@ func testAccCloudRunV2Job_cloudrunv2JobWithDirectVPCAndNamedBinAuthPolicyUpdate( <% unless version == 'ga' -%> func TestAccCloudRunV2Job_cloudrunv2JobWithGcsUpdate(t *testing.T) { + acctest.SkipIfVcr(t) t.Parallel() jobName := fmt.Sprintf("tf-test-cloudrun-service%s", acctest.RandString(t, 10)) @@ -325,7 +331,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobWithGcsUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_job.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"location", "launch_stage"}, + ImportStateVerifyIgnore: []string{"location", "launch_stage", "deletion_protection"}, }, { Config: testAccCloudRunV2Job_cloudrunv2JobWithGcsVolume(context), @@ -334,7 +340,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobWithGcsUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_job.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"location", "launch_stage"}, + ImportStateVerifyIgnore: []string{"location", "launch_stage", "deletion_protection"}, }, }, }) @@ -345,6 +351,7 @@ func testAccCloudRunV2Job_cloudrunv2JobWithNoVolume(context map[string]interface resource "google_cloud_run_v2_job" "default" { name = "%{job_name}" location = "us-central1" + deletion_protection = false launch_stage = "BETA" template { template { @@ -368,6 +375,7 @@ func testAccCloudRunV2Job_cloudrunv2JobWithGcsVolume(context map[string]interfac resource "google_cloud_run_v2_job" "default" { name = "%{job_name}" location = "us-central1" + deletion_protection = false launch_stage = "BETA" template { template { @@ -392,6 +400,7 @@ func testAccCloudRunV2Job_cloudrunv2JobWithGcsVolume(context map[string]interfac } func TestAccCloudRunV2Job_cloudrunv2JobWithNfsUpdate(t *testing.T) { + acctest.SkipIfVcr(t) t.Parallel() jobName := fmt.Sprintf("tf-test-cloudrun-service%s", acctest.RandString(t, 10)) @@ -411,7 +420,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobWithNfsUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_job.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"location", "launch_stage"}, + ImportStateVerifyIgnore: []string{"location", "launch_stage", "deletion_protection"}, }, { Config: testAccCloudRunV2Job_cloudrunv2JobWithNfsVolume(context), @@ -420,7 +429,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobWithNfsUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_job.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"location", "launch_stage"}, + ImportStateVerifyIgnore: []string{"location", "launch_stage", "deletion_protection"}, }, }, }) @@ -431,6 +440,7 @@ func testAccCloudRunV2Job_cloudrunv2JobWithNfsVolume(context map[string]interfac resource "google_cloud_run_v2_job" "default" { name = "%{job_name}" location = "us-central1" + deletion_protection = false launch_stage = "BETA" template { template { @@ -480,7 +490,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobWithStartExecutionTokenUpdate(t *testing. ResourceName: "google_cloud_run_v2_job.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"location", "launch_stage"}, + ImportStateVerifyIgnore: []string{"location", "launch_stage", "deletion_protection"}, }, { Config: testAccCloudRunV2Job_cloudrunv2JobWithStartExecutionToken(context2), @@ -489,7 +499,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobWithStartExecutionTokenUpdate(t *testing. ResourceName: "google_cloud_run_v2_job.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"location", "launch_stage"}, + ImportStateVerifyIgnore: []string{"location", "launch_stage", "deletion_protection"}, }, }, }) @@ -500,6 +510,7 @@ func testAccCloudRunV2Job_cloudrunv2JobWithStartExecutionToken(context map[strin resource "google_cloud_run_v2_job" "default" { name = "%{job_name}" location = "us-central1" + deletion_protection = false start_execution_token = "%{token}" template { template { @@ -537,7 +548,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobWithRunExecutionTokenUpdate(t *testing.T) ResourceName: "google_cloud_run_v2_job.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"location", "launch_stage"}, + ImportStateVerifyIgnore: []string{"location", "launch_stage", "deletion_protection"}, }, { Config: testAccCloudRunV2Job_cloudrunv2JobWithRunExecutionToken(context2), @@ -546,7 +557,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobWithRunExecutionTokenUpdate(t *testing.T) ResourceName: "google_cloud_run_v2_job.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"location", "launch_stage"}, + ImportStateVerifyIgnore: []string{"location", "launch_stage", "deletion_protection"}, }, }, }) @@ -557,6 +568,7 @@ func testAccCloudRunV2Job_cloudrunv2JobWithRunExecutionToken(context map[string] resource "google_cloud_run_v2_job" "default" { name = "%{job_name}" location = "us-central1" + deletion_protection = false run_execution_token = "%{token}" template { template { diff --git a/mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_service_test.go.erb b/mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_service_test.go.erb index 01b421e3b391..9d2a77a252f0 100644 --- a/mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_service_test.go.erb +++ b/mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_service_test.go.erb @@ -41,7 +41,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceFullUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels", "deletion_protection"}, }, }, }) @@ -117,6 +117,7 @@ resource "google_cloud_run_v2_service" "default" { name = "tf-test-cloudrun-service%{random_suffix}" description = "description updating" location = "us-central1" + deletion_protection = false annotations = { generated-by = "magic-modules-files" } @@ -211,6 +212,7 @@ resource "google_compute_network" "custom_test" { } <% unless version == 'ga' -%> func TestAccCloudRunV2Service_cloudrunv2ServiceGcsVolume(t *testing.T) { + acctest.SkipIfVcr(t) t.Parallel() context := map[string]interface{}{ @@ -229,7 +231,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceGcsVolume(t *testing.T) { ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels", "launch_stage"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels", "launch_stage", "deletion_protection"}, }, }, }) @@ -241,6 +243,7 @@ resource "google_cloud_run_v2_service" "default" { name = "tf-test-cloudrun-service%{random_suffix}" description = "description creating" location = "us-central1" + deletion_protection = false launch_stage = "BETA" annotations = { generated-by = "magic-modules" @@ -330,7 +333,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceTCPProbesUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "deletion_protection"}, }, { Config: testAccCloudRunV2Service_cloudrunv2ServiceUpdateWithTCPStartupProbeAndHTTPLivenessProbe(context), @@ -339,7 +342,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceTCPProbesUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "deletion_protection"}, }, }, }) @@ -364,7 +367,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceHTTPProbesUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "deletion_protection"}, }, { Config: testAccCloudRunV2Service_cloudrunv2ServiceUpdateWithHTTPStartupProbe(context), @@ -373,7 +376,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceHTTPProbesUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "deletion_protection"}, }, }, }) @@ -399,7 +402,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceGRPCProbesUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "deletion_protection"}, }, { Config: testAccCloudRunV2Service_cloudRunServiceUpdateWithGRPCLivenessProbe(context), @@ -408,7 +411,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceGRPCProbesUpdate(t *testing.T) { ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "deletion_protection"}, }, // The following test steps of gRPC startup probe are expected to fail with startup probe check failures. // This is because, due to the unavailability of ready-to-use container images of a gRPC service that @@ -461,6 +464,7 @@ func testAccCloudRunV2Service_cloudrunv2ServiceWithEmptyTCPStartupProbeAndHTTPLi resource "google_cloud_run_v2_service" "default" { name = "tf-test-cloudrun-service%{random_suffix}" location = "us-central1" + deletion_protection = false template { containers { @@ -485,6 +489,7 @@ func testAccCloudRunV2Service_cloudrunv2ServiceUpdateWithTCPStartupProbeAndHTTPL resource "google_cloud_run_v2_service" "default" { name = "tf-test-cloudrun-service%{random_suffix}" location = "us-central1" + deletion_protection = false template { containers { @@ -529,6 +534,7 @@ func testAccCloudRunV2Service_cloudrunv2ServiceUpdateWithEmptyHTTPStartupProbe(c resource "google_cloud_run_v2_service" "default" { name = "tf-test-cloudrun-service%{random_suffix}" location = "us-central1" + deletion_protection = false template { containers { @@ -547,6 +553,7 @@ func testAccCloudRunV2Service_cloudrunv2ServiceUpdateWithHTTPStartupProbe(contex resource "google_cloud_run_v2_service" "default" { name = "tf-test-cloudrun-service%{random_suffix}" location = "us-central1" + deletion_protection = false template { containers { @@ -579,6 +586,7 @@ func testAccCloudRunV2Service_cloudRunServiceUpdateWithEmptyGRPCLivenessProbe(co resource "google_cloud_run_v2_service" "default" { name ="%{service_name}" location = "us-central1" + deletion_protection = false template { containers { @@ -600,6 +608,7 @@ func testAccCloudRunV2Service_cloudRunServiceUpdateWithGRPCLivenessProbe(context resource "google_cloud_run_v2_service" "default" { name = "%{service_name}" location = "us-central1" + deletion_protection = false template { containers { @@ -624,6 +633,7 @@ func testAccCloudRunV2Service_cloudRunServiceUpdateWithEmptyGRPCStartupProbe(con resource "google_cloud_run_v2_service" "default" { name = "%{service_name}" location = "us-central1" + deletion_protection = false template { containers { @@ -645,6 +655,7 @@ func testAccCloudRunV2Service_cloudRunServiceUpdateWithGRPCStartupProbe(context resource "google_cloud_run_v2_service" "default" { name = "%{service_name}" location = "us-central1" + deletion_protection = false template { containers { @@ -669,6 +680,7 @@ func testAccCloudRunV2Service_cloudRunServiceUpdateWithGRPCLivenessAndStartupPro resource "google_cloud_run_v2_service" "default" { name = "%{service_name}" location = "us-central1" + deletion_protection = false template { containers { @@ -715,7 +727,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceWithDirectVPCUpdate(t *testing.T) ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location"}, + ImportStateVerifyIgnore: []string{"name", "location", "deletion_protection"}, }, { Config: testAccCloudRunV2Service_cloudRunServiceWithDirectVPCAndNamedBinAuthPolicyUpdate(context), @@ -724,7 +736,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceWithDirectVPCUpdate(t *testing.T) ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location"}, + ImportStateVerifyIgnore: []string{"name", "location", "deletion_protection"}, }, }, }) @@ -735,6 +747,7 @@ func testAccCloudRunV2Service_cloudRunServiceWithDirectVPC(context map[string]in resource "google_cloud_run_v2_service" "default" { name = "%{service_name}" location = "us-central1" + deletion_protection = false launch_stage = "GA" template { containers { @@ -755,6 +768,7 @@ func testAccCloudRunV2Service_cloudRunServiceWithDirectVPCAndNamedBinAuthPolicyU resource "google_cloud_run_v2_service" "default" { name = "%{service_name}" location = "us-central1" + deletion_protection = false launch_stage = "GA" binary_authorization { policy = "projects/%{project}/platforms/cloudRun/policies/my-policy" @@ -792,7 +806,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceCustomAudienceUpdate(t *testing.T ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations", "launch_stage"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "launch_stage", "deletion_protection"}, }, { Config: testAccCloudRunV2Service_cloudRunServiceUpdateWithCustomAudience(serviceName, "test_update"), @@ -801,7 +815,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceCustomAudienceUpdate(t *testing.T ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations", "launch_stage"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "launch_stage", "deletion_protection"}, }, { Config: testAccCloudRunV2Service_cloudRunServiceUpdateWithoutCustomAudience(serviceName), @@ -810,7 +824,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceCustomAudienceUpdate(t *testing.T ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations", "launch_stage"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "launch_stage", "deletion_protection"}, }, }, }) @@ -821,6 +835,7 @@ func testAccCloudRunV2Service_cloudRunServiceUpdateWithoutCustomAudience(service resource "google_cloud_run_v2_service" "default" { name = "%s" location = "us-central1" + deletion_protection = false template { containers { @@ -839,6 +854,7 @@ func testAccCloudRunV2Service_cloudRunServiceUpdateWithCustomAudience(serviceNam resource "google_cloud_run_v2_service" "default" { name = "%s" location = "us-central1" + deletion_protection = false custom_audiences = ["%s"] template { @@ -911,6 +927,7 @@ provider "google" { resource "google_cloud_run_v2_service" "default" { name = "tf-test-cloudrun-service%{random_suffix}" location = "us-central1" + deletion_protection = false labels = { user_label = "foo" @@ -938,6 +955,7 @@ provider "google" { resource "google_cloud_run_v2_service" "default" { name = "tf-test-cloudrun-service%{random_suffix}" location = "us-central1" + deletion_protection = false labels = { user_label = "bar" @@ -973,7 +991,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceWithServiceMinInstances(t *testin ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels", "launch_stage"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels", "launch_stage", "deletion_protection"}, }, { Config: testAccCloudRunV2Service_cloudrunv2ServiceWithNoMinInstances(context), @@ -982,7 +1000,7 @@ func TestAccCloudRunV2Service_cloudrunv2ServiceWithServiceMinInstances(t *testin ResourceName: "google_cloud_run_v2_service.default", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels", "launch_stage"}, + ImportStateVerifyIgnore: []string{"name", "location", "annotations", "labels", "terraform_labels", "launch_stage", "deletion_protection"}, }, }, @@ -995,6 +1013,7 @@ resource "google_cloud_run_v2_service" "default" { name = "tf-test-cloudrun-service%{random_suffix}" description = "description creating" location = "us-central1" + deletion_protection = false launch_stage = "BETA" annotations = { generated-by = "magic-modules" @@ -1026,6 +1045,7 @@ resource "google_cloud_run_v2_service" "default" { name = "tf-test-cloudrun-service%{random_suffix}" description = "description creating" location = "us-central1" + deletion_protection = false launch_stage = "BETA" annotations = { generated-by = "magic-modules" diff --git a/mmv1/third_party/terraform/services/composer/resource_composer_environment.go.erb b/mmv1/third_party/terraform/services/composer/resource_composer_environment.go.erb index e374bbf4724c..110856c16e93 100644 --- a/mmv1/third_party/terraform/services/composer/resource_composer_environment.go.erb +++ b/mmv1/third_party/terraform/services/composer/resource_composer_environment.go.erb @@ -338,7 +338,6 @@ func ResourceComposerEnvironment() *schema.Resource { Optional: true, Computed: true, ForceNew: true, - ConfigMode: schema.SchemaConfigModeAttr, MaxItems: 1, Description: `Configuration for controlling how IPs are allocated in the GKE cluster. Cannot be updated.`, Elem: &schema.Resource{ diff --git a/mmv1/third_party/terraform/services/composer/resource_composer_environment_test.go.erb b/mmv1/third_party/terraform/services/composer/resource_composer_environment_test.go.erb index 576cded24877..ea71ec030c88 100644 --- a/mmv1/third_party/terraform/services/composer/resource_composer_environment_test.go.erb +++ b/mmv1/third_party/terraform/services/composer/resource_composer_environment_test.go.erb @@ -81,6 +81,8 @@ func TestAccComposerEnvironment_basic(t *testing.T) { // Checks that all updatable fields can be updated in one apply // (PATCH for Environments only is per-field) func TestAccComposerEnvironment_update(t *testing.T) { + // Currently failing + acctest.SkipIfVcr(t) t.Parallel() envName := fmt.Sprintf("%s-%d", testComposerEnvironmentPrefix, acctest.RandInt(t)) @@ -280,6 +282,8 @@ func TestAccComposerEnvironment_withDatabaseConfig(t *testing.T) { } func TestAccComposerEnvironment_withWebServerConfig(t *testing.T) { + // Currently failing + acctest.SkipIfVcr(t) t.Parallel() envName := fmt.Sprintf("%s-%d", testComposerEnvironmentPrefix, acctest.RandInt(t)) network := fmt.Sprintf("%s-%d", testComposerNetworkPrefix, acctest.RandInt(t)) @@ -354,6 +358,7 @@ func TestAccComposerEnvironment_withEncryptionConfigComposer1(t *testing.T) { } func TestAccComposerEnvironment_withEncryptionConfigComposer2(t *testing.T) { + acctest.SkipIfVcr(t) t.Parallel() kms := acctest.BootstrapKMSKeyInLocation(t, "us-central1") diff --git a/mmv1/third_party/terraform/services/compute/go/resource_compute_firewall_policy_rule_test.go b/mmv1/third_party/terraform/services/compute/go/resource_compute_firewall_policy_rule_test.go index d84a5a2d4449..7bf2366c2455 100644 --- a/mmv1/third_party/terraform/services/compute/go/resource_compute_firewall_policy_rule_test.go +++ b/mmv1/third_party/terraform/services/compute/go/resource_compute_firewall_policy_rule_test.go @@ -66,92 +66,93 @@ func TestAccComputeFirewallPolicyRule_update(t *testing.T) { } func TestAccComputeFirewallPolicyRule_multipleRules(t *testing.T) { - t.Parallel() + t.Parallel() - context := map[string]interface{}{ - "random_suffix": acctest.RandString(t, 10), - "org_name": fmt.Sprintf("organizations/%s", envvar.GetTestOrgFromEnv(t)), - } + context := map[string]interface{}{ + "random_suffix": acctest.RandString(t, 10), + "org_name": fmt.Sprintf("organizations/%s", envvar.GetTestOrgFromEnv(t)), + } - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - Steps: []resource.TestStep{ - { - Config: testAccComputeFirewallPolicyRule_multiple(context), - }, - { - ResourceName: "google_compute_firewall_policy_rule.fw_policy_rule1", - ImportState: true, - ImportStateVerify: true, - // Referencing using ID causes import to fail - ImportStateVerifyIgnore: []string{"firewall_policy"}, - }, - { - ResourceName: "google_compute_firewall_policy_rule.fw_policy_rule2", - ImportState: true, - ImportStateVerify: true, - // Referencing using ID causes import to fail - ImportStateVerifyIgnore: []string{"firewall_policy"}, - }, - { - Config: testAccComputeFirewallPolicyRule_multipleAdd(context), - }, - { - ResourceName: "google_compute_firewall_policy_rule.fw_policy_rule3", - ImportState: true, - ImportStateVerify: true, - // Referencing using ID causes import to fail - ImportStateVerifyIgnore: []string{"firewall_policy"}, - }, - { - Config: testAccComputeFirewallPolicyRule_multipleRemove(context), - }, - }, - }) + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + Steps: []resource.TestStep{ + { + Config: testAccComputeFirewallPolicyRule_multiple(context), + }, + { + ResourceName: "google_compute_firewall_policy_rule.fw_policy_rule1", + ImportState: true, + ImportStateVerify: true, + // Referencing using ID causes import to fail + ImportStateVerifyIgnore: []string{"firewall_policy"}, + }, + { + ResourceName: "google_compute_firewall_policy_rule.fw_policy_rule2", + ImportState: true, + ImportStateVerify: true, + // Referencing using ID causes import to fail + ImportStateVerifyIgnore: []string{"firewall_policy"}, + }, + { + Config: testAccComputeFirewallPolicyRule_multipleAdd(context), + }, + { + ResourceName: "google_compute_firewall_policy_rule.fw_policy_rule3", + ImportState: true, + ImportStateVerify: true, + // Referencing using ID causes import to fail + ImportStateVerifyIgnore: []string{"firewall_policy"}, + }, + { + Config: testAccComputeFirewallPolicyRule_multipleRemove(context), + }, + }, + }) } func TestAccComputeFirewallPolicyRule_securityProfileGroup_update(t *testing.T) { - t.Parallel() + t.Parallel() - context := map[string]interface{}{ - "random_suffix": acctest.RandString(t, 10), - "org_name": fmt.Sprintf("organizations/%s", envvar.GetTestOrgFromEnv(t)), - } + context := map[string]interface{}{ + "random_suffix": acctest.RandString(t, 10), + "org_name": fmt.Sprintf("organizations/%s", envvar.GetTestOrgFromEnv(t)), + } - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - Steps: []resource.TestStep{ - { - Config: testAccComputeFirewallPolicyRule_securityProfileGroup_basic(context), - }, - { - ResourceName: "google_compute_firewall_policy_rule.fw_policy_rule1", - ImportState: true, - ImportStateVerify: true, - // Referencing using ID causes import to fail - ImportStateVerifyIgnore: []string{"firewall_policy"}, - }, - { - Config: testAccComputeFirewallPolicyRule_securityProfileGroup_update(context), - }, - { - ResourceName: "google_compute_firewall_policy_rule.fw_policy_rule1", - ImportState: true, - ImportStateVerify: true, - // Referencing using ID causes import to fail - ImportStateVerifyIgnore: []string{"firewall_policy", "target_resources"}, - }, - }, - }) + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + Steps: []resource.TestStep{ + { + Config: testAccComputeFirewallPolicyRule_securityProfileGroup_basic(context), + }, + { + ResourceName: "google_compute_firewall_policy_rule.fw_policy_rule1", + ImportState: true, + ImportStateVerify: true, + // Referencing using ID causes import to fail + ImportStateVerifyIgnore: []string{"firewall_policy"}, + }, + { + Config: testAccComputeFirewallPolicyRule_securityProfileGroup_update(context), + }, + { + ResourceName: "google_compute_firewall_policy_rule.fw_policy_rule1", + ImportState: true, + ImportStateVerify: true, + // Referencing using ID causes import to fail + ImportStateVerifyIgnore: []string{"firewall_policy", "target_resources"}, + }, + }, + }) } func testAccComputeFirewallPolicyRule_securityProfileGroup_basic(context map[string]interface{}) string { - return acctest.Nprintf(` + return acctest.Nprintf(` 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" { @@ -197,10 +198,11 @@ resource "google_compute_firewall_policy_rule" "fw_policy_rule1" { } func testAccComputeFirewallPolicyRule_securityProfileGroup_update(context map[string]interface{}) string { - return acctest.Nprintf(` + return acctest.Nprintf(` 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" { @@ -276,6 +278,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" { @@ -341,6 +344,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" { @@ -416,6 +420,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" { @@ -467,6 +472,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" { @@ -539,6 +545,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" { @@ -632,6 +639,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/mmv1/third_party/terraform/services/compute/go/resource_compute_firewall_policy_test.go b/mmv1/third_party/terraform/services/compute/go/resource_compute_firewall_policy_test.go index edd2ceab96de..2112aba5ce6f 100644 --- a/mmv1/third_party/terraform/services/compute/go/resource_compute_firewall_policy_test.go +++ b/mmv1/third_party/terraform/services/compute/go/resource_compute_firewall_policy_test.go @@ -3,6 +3,7 @@ package compute_test import ( "fmt" "testing" + "github.com/hashicorp/terraform-provider-google/google/acctest" "github.com/hashicorp/terraform-provider-google/google/envvar" @@ -50,10 +51,11 @@ func TestAccComputeFirewallPolicy_update(t *testing.T) { } func testAccComputeFirewallPolicy_basic(org, policyName, folderName string) string { - return fmt.Sprintf(` + return fmt.Sprintf(` resource "google_folder" "folder" { display_name = "%s" parent = "%s" + deletion_protection = false } resource "google_compute_firewall_policy" "default" { @@ -65,10 +67,11 @@ resource "google_compute_firewall_policy" "default" { } func testAccComputeFirewallPolicy_update(org, policyName, folderName string) string { - return fmt.Sprintf(` + return fmt.Sprintf(` resource "google_folder" "folder" { display_name = "%s" parent = "%s" + deletion_protection = false } resource "google_compute_firewall_policy" "default" { diff --git a/mmv1/third_party/terraform/services/compute/go/resource_compute_instance_from_machine_image_test.go.tmpl b/mmv1/third_party/terraform/services/compute/go/resource_compute_instance_from_machine_image_test.go.tmpl index 1ccd74953d44..d01ec9aa745a 100644 --- a/mmv1/third_party/terraform/services/compute/go/resource_compute_instance_from_machine_image_test.go.tmpl +++ b/mmv1/third_party/terraform/services/compute/go/resource_compute_instance_from_machine_image_test.go.tmpl @@ -598,6 +598,7 @@ resource "google_project" "project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "service" { diff --git a/mmv1/third_party/terraform/services/compute/go/resource_compute_instance_template_test.go.tmpl b/mmv1/third_party/terraform/services/compute/go/resource_compute_instance_template_test.go.tmpl index e29c131cb3b4..ac553ff83357 100644 --- a/mmv1/third_party/terraform/services/compute/go/resource_compute_instance_template_test.go.tmpl +++ b/mmv1/third_party/terraform/services/compute/go/resource_compute_instance_template_test.go.tmpl @@ -2853,6 +2853,7 @@ resource "google_project" "host_project" { project_id = "%s-host" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host_project" { @@ -2869,6 +2870,7 @@ resource "google_project" "service_project" { project_id = "%s-service" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "service_project" { diff --git a/mmv1/third_party/terraform/services/compute/go/resource_compute_instance_test.go.tmpl b/mmv1/third_party/terraform/services/compute/go/resource_compute_instance_test.go.tmpl index 4f729fbb74b5..7308ff48735d 100644 --- a/mmv1/third_party/terraform/services/compute/go/resource_compute_instance_test.go.tmpl +++ b/mmv1/third_party/terraform/services/compute/go/resource_compute_instance_test.go.tmpl @@ -6619,6 +6619,7 @@ resource "google_project" "host_project" { project_id = "%s-host" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host_project" { @@ -6635,6 +6636,7 @@ resource "google_project" "service_project" { project_id = "%s-service" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "service_project" { diff --git a/mmv1/third_party/terraform/services/compute/go/resource_compute_organization_security_policy_rule_test.go.tmpl b/mmv1/third_party/terraform/services/compute/go/resource_compute_organization_security_policy_rule_test.go.tmpl index e6f4ac117299..d9fcd19dbbf8 100644 --- a/mmv1/third_party/terraform/services/compute/go/resource_compute_organization_security_policy_rule_test.go.tmpl +++ b/mmv1/third_party/terraform/services/compute/go/resource_compute_organization_security_policy_rule_test.go.tmpl @@ -47,6 +47,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" { @@ -81,6 +82,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/mmv1/third_party/terraform/services/compute/go/resource_compute_region_instance_template_test.go.tmpl b/mmv1/third_party/terraform/services/compute/go/resource_compute_region_instance_template_test.go.tmpl index 21fbab93d494..d22cdd5968b0 100644 --- a/mmv1/third_party/terraform/services/compute/go/resource_compute_region_instance_template_test.go.tmpl +++ b/mmv1/third_party/terraform/services/compute/go/resource_compute_region_instance_template_test.go.tmpl @@ -2356,6 +2356,7 @@ resource "google_project" "host_project" { project_id = "%s-host" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host_project" { @@ -2372,6 +2373,7 @@ resource "google_project" "service_project" { project_id = "%s-service" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "service_project" { diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_address_test.go b/mmv1/third_party/terraform/services/compute/resource_compute_address_test.go index e9865fdce86a..dfcf8c609102 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_address_test.go +++ b/mmv1/third_party/terraform/services/compute/resource_compute_address_test.go @@ -524,6 +524,10 @@ func TestAccComputeAddress_withAttributionRemoved(t *testing.T) { func testAccComputeAddress_networkTier_withLabels(i string) string { return fmt.Sprintf(` +provider "google" { + add_terraform_attribution_label = false +} + resource "google_compute_address" "foobar" { name = "tf-test-address-%s" network_tier = "STANDARD" @@ -538,6 +542,10 @@ resource "google_compute_address" "foobar" { func testAccComputeAddress_networkTier_withLabelsUpdate(i string) string { return fmt.Sprintf(` +provider "google" { + add_terraform_attribution_label = false +} + resource "google_compute_address" "foobar" { name = "tf-test-address-%s" network_tier = "STANDARD" @@ -556,6 +564,7 @@ provider "google" { default_labels = { default_key1 = "default_value1" } + add_terraform_attribution_label = false } resource "google_compute_address" "foobar" { @@ -576,6 +585,7 @@ provider "google" { default_labels = { default_key1 = "default_value1" } + add_terraform_attribution_label = false } resource "google_compute_address" "foobar" { @@ -598,6 +608,7 @@ provider "google" { default_key1 = "default_value1" env = "foo" } + add_terraform_attribution_label = false } resource "google_compute_address" "foobar" { @@ -748,6 +759,10 @@ resource "google_compute_address" "internal_with_subnet_and_address" { func testAccComputeAddress_networkTier(i string) string { return fmt.Sprintf(` +provider "google" { + add_terraform_attribution_label = false +} + resource "google_compute_address" "foobar" { name = "tf-test-address-%s" network_tier = "STANDARD" diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_backend_service_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_backend_service_test.go.erb index cf3bba5192ed..488e2df1f5b2 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_backend_service_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_backend_service_test.go.erb @@ -125,23 +125,23 @@ func TestAccComputeBackendService_withBackendAndIAP(t *testing.T) { CheckDestroy: testAccCheckComputeBackendServiceDestroyProducer(t), Steps: []resource.TestStep{ { - Config: testAccComputeBackendService_withBackendAndIAP( + Config: testAccComputeBackendService_withBackend( serviceName, igName, itName, checkName, 10), }, { ResourceName: "google_compute_backend_service.lipsum", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"}, }, { - Config: testAccComputeBackendService_withBackend( + Config: testAccComputeBackendService_withBackendAndIAP( serviceName, igName, itName, checkName, 10), }, { ResourceName: "google_compute_backend_service.lipsum", ImportState: true, ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"}, }, }, }) @@ -1328,6 +1328,7 @@ resource "google_compute_backend_service" "lipsum" { } iap { + enabled = true oauth2_client_id = "test" oauth2_client_secret = "test" } diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_firewall_policy_association_test.go b/mmv1/third_party/terraform/services/compute/resource_compute_firewall_policy_association_test.go index 820991e5ca17..12e8f78881a7 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_firewall_policy_association_test.go +++ b/mmv1/third_party/terraform/services/compute/resource_compute_firewall_policy_association_test.go @@ -40,11 +40,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/mmv1/third_party/terraform/services/compute/resource_compute_firewall_policy_rule_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_firewall_policy_rule_test.go.erb index 44c240551ccf..30e24a27a9d1 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_firewall_policy_rule_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_firewall_policy_rule_test.go.erb @@ -153,6 +153,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" { @@ -202,6 +203,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" { @@ -277,6 +279,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" { @@ -342,6 +345,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" { @@ -417,6 +421,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" { @@ -468,6 +473,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" { @@ -540,6 +546,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" { @@ -633,6 +640,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/mmv1/third_party/terraform/services/compute/resource_compute_firewall_policy_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_firewall_policy_test.go.erb index 49a7697eb998..4d1e67a0de86 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_firewall_policy_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_firewall_policy_test.go.erb @@ -55,6 +55,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" { @@ -70,6 +71,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/mmv1/third_party/terraform/services/compute/resource_compute_instance.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_instance.go.erb index ba636c3cf430..68f77eaeb302 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_instance.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_instance.go.erb @@ -668,7 +668,6 @@ func ResourceComputeInstance() *schema.Resource { Optional: true, Computed: true, ForceNew: true, - ConfigMode: schema.SchemaConfigModeAttr, Description: `List of the type and count of accelerator cards attached to the instance.`, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_machine_image.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_machine_image.go.erb index 0461a98a51f6..97f87139ccfa 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_machine_image.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_machine_image.go.erb @@ -47,17 +47,6 @@ func computeInstanceFromMachineImageSchema() map[string]*schema.Schema { s[field].Optional = true } - // schema.SchemaConfigModeAttr allows these fields to be removed in Terraform 0.12. - // Passing field_name = [] in this mode differentiates between an intentionally empty - // block vs an ignored computed block. - nic := s["network_interface"].Elem.(*schema.Resource) - nic.Schema["alias_ip_range"].ConfigMode = schema.SchemaConfigModeAttr - nic.Schema["access_config"].ConfigMode = schema.SchemaConfigModeAttr - - for _, field := range []string{"attached_disk", "guest_accelerator", "service_account", "scratch_disk"} { - s[field].ConfigMode = schema.SchemaConfigModeAttr - } - recurseOnSchema(s, func(field *schema.Schema) { // We don't want to accidentally use default values to override the instance // machine image, so remove defaults. diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_machine_image_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_machine_image_test.go.erb index e47376ecddc1..95a089a3154c 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_machine_image_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_machine_image_test.go.erb @@ -954,6 +954,7 @@ resource "google_project" "project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "service" { diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_template.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_template.go.erb index fc61dd0c02c5..272e9f9fc73a 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_template.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_template.go.erb @@ -51,17 +51,6 @@ func computeInstanceFromTemplateSchema() map[string]*schema.Schema { s[field].Optional = true } - // schema.SchemaConfigModeAttr allows these fields to be removed in Terraform 0.12. - // Passing field_name = [] in this mode differentiates between an intentionally empty - // block vs an ignored computed block. - nic := s["network_interface"].Elem.(*schema.Resource) - nic.Schema["alias_ip_range"].ConfigMode = schema.SchemaConfigModeAttr - nic.Schema["access_config"].ConfigMode = schema.SchemaConfigModeAttr - - for _, field := range []string{"attached_disk", "guest_accelerator", "service_account", "scratch_disk"} { - s[field].ConfigMode = schema.SchemaConfigModeAttr - } - // Remove deprecated/removed fields that are never d.Set. We can't // programmatically remove all of them, because some of them still have d.Set // calls. diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_template_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_template_test.go.erb index d3960a97af7f..b9748a2a7702 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_template_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_instance_from_template_test.go.erb @@ -378,49 +378,6 @@ func TestAccComputeInstanceFromTemplate_overrideScheduling(t *testing.T) { }) } -func TestAccComputeInstanceFromTemplate_012_removableFields(t *testing.T) { - t.Parallel() - - var instance compute.Instance - instanceName := fmt.Sprintf("tf-test-%s", acctest.RandString(t, 10)) - templateName := fmt.Sprintf("tf-test-%s", acctest.RandString(t, 10)) - resourceName := "google_compute_instance_from_template.inst" - - // First config is a basic instance from template, second tests the empty list syntax - config1 := testAccComputeInstanceFromTemplate_012_removableFieldsTpl(templateName) + - testAccComputeInstanceFromTemplate_012_removableFields1(instanceName) - config2 := testAccComputeInstanceFromTemplate_012_removableFieldsTpl(templateName) + - testAccComputeInstanceFromTemplate_012_removableFields2(instanceName) - - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - CheckDestroy: testAccCheckComputeInstanceFromTemplateDestroyProducer(t), - Steps: []resource.TestStep{ - { - Config: config1, - Check: resource.ComposeTestCheckFunc( - testAccCheckComputeInstanceExists(t, resourceName, &instance), - - resource.TestCheckResourceAttr(resourceName, "service_account.#", "1"), - resource.TestCheckResourceAttr(resourceName, "service_account.0.scopes.#", "3"), - ), - }, - { - Config: config2, - Check: resource.ComposeTestCheckFunc( - testAccCheckComputeInstanceExists(t, resourceName, &instance), - - // Check that fields were able to be removed - resource.TestCheckResourceAttr(resourceName, "scratch_disk.#", "0"), - resource.TestCheckResourceAttr(resourceName, "attached_disk.#", "0"), - resource.TestCheckResourceAttr(resourceName, "network_interface.0.alias_ip_range.#", "0"), - ), - }, - }, - }) -} - func TestAccComputeInstanceFromTemplate_overrideMetadataDotStartupScript(t *testing.T) { var instance compute.Instance instanceName := fmt.Sprintf("tf-test-%s", acctest.RandString(t, 10)) @@ -1496,84 +1453,6 @@ resource "google_compute_instance_from_template" "inst" { `, templateDisk, template, instance) } -func testAccComputeInstanceFromTemplate_012_removableFieldsTpl(template string) string { - - return fmt.Sprintf(` -data "google_compute_image" "my_image" { - family = "debian-11" - project = "debian-cloud" -} - -resource "google_compute_instance_template" "foobar" { - name = "%s" - machine_type = "e2-medium" - - disk { - source_image = data.google_compute_image.my_image.self_link - auto_delete = true - disk_size_gb = 20 - boot = true - } - - network_interface { - network = "default" - } - - metadata = { - foo = "bar" - } - - service_account { - scopes = ["userinfo-email", "compute-ro", "storage-ro"] - } - - can_ip_forward = true -} -`, template) -} - -func testAccComputeInstanceFromTemplate_012_removableFields1(instance string) string { - return fmt.Sprintf(` -resource "google_compute_instance_from_template" "inst" { - name = "%s" - zone = "us-central1-a" - - allow_stopping_for_update = true - - source_instance_template = google_compute_instance_template.foobar.self_link -} -`, instance) -} - -func testAccComputeInstanceFromTemplate_012_removableFields2(instance string) string { - return fmt.Sprintf(` -resource "google_compute_instance_from_template" "inst" { - name = "%s" - zone = "us-central1-a" - - allow_stopping_for_update = true - - source_instance_template = google_compute_instance_template.foobar.self_link - - // Overrides - network_interface { - alias_ip_range = [] - } - - service_account = [] - - scratch_disk = [] - - attached_disk = [] - - timeouts { - create = "10m" - update = "10m" - } -} -`, instance) -} - func testAccComputeInstanceFromTemplate_overrideMetadataDotStartupScript(instance, template string) string { return fmt.Sprintf(` data "google_compute_image" "my_image" { diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_instance_template.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_instance_template.go.erb index 0d6130de59aa..7a1e49dc87e7 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_instance_template.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_instance_template.go.erb @@ -96,14 +96,14 @@ func ResourceComputeInstanceTemplate() *schema.Resource { Optional: true, Computed: true, ForceNew: true, - Description: `Creates a unique name beginning with the specified prefix. Conflicts with name.`, + Description: `Creates a unique name beginning with the specified prefix. Conflicts with name. Max length is 54 characters. Prefixes with lengths longer than 37 characters will use a shortened UUID that will be more prone to collisions.`, ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { // https://cloud.google.com/compute/docs/reference/latest/instanceTemplates#resource - // uuid is 26 characters, limit the prefix to 37. + // shortened uuid is 9 characters, limit the prefix to 55. value := v.(string) - if len(value) > 37 { + if len(value) > 54 { errors = append(errors, fmt.Errorf( - "%q cannot be longer than 37 characters, name is limited to 63", k)) + "%q cannot be longer than 54 characters, name is limited to 63", k)) } return }, @@ -1434,7 +1434,12 @@ func resourceComputeInstanceTemplateCreate(d *schema.ResourceData, meta interfac if v, ok := d.GetOk("name"); ok { itName = v.(string) } else if v, ok := d.GetOk("name_prefix"); ok { - itName = id.PrefixedUniqueId(v.(string)) + prefix := v.(string) + if len(prefix) > 37 { + itName = tpgresource.ReducedPrefixedUniqueId(prefix) + } else { + itName = id.PrefixedUniqueId(prefix) + } } else { itName = id.UniqueId() } diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_instance_template_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_instance_template_test.go.erb index fc3ad9bd05ac..f84d7330e8c3 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_instance_template_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_instance_template_test.go.erb @@ -875,6 +875,45 @@ func TestAccComputeInstanceTemplate_invalidDiskType(t *testing.T) { }) } +func TestAccComputeInstanceTemplate_withNamePrefix(t *testing.T) { + t.Parallel() + + // 8 + 46 = 54 which is the valid max + normalPrefix := "tf-test-" + fmt.Sprintf("%046s", "") + reducedSuffixPrefix := "tf-test-" + fmt.Sprintf("%029s", "") + invalidPrefix := "tf-test-" + fmt.Sprintf("%047s", "") + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + Steps: []resource.TestStep{ + { + Config: testAccComputeInstanceTemplate_withNamePrefix(normalPrefix), + }, + { + ResourceName: "google_compute_instance_template.foobar", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"name_prefix"}, + }, + { + Config: testAccComputeInstanceTemplate_withNamePrefix(invalidPrefix), + PlanOnly: true, + ExpectError: regexp.MustCompile("cannot be longer than 54 characters"), + }, + { + Config: testAccComputeInstanceTemplate_withNamePrefix(reducedSuffixPrefix), + }, + { + ResourceName: "google_compute_instance_template.foobar", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"name_prefix"}, + }, + }, + }) +} + func TestAccComputeInstanceTemplate_withScratchDisk(t *testing.T) { t.Parallel() @@ -2609,6 +2648,28 @@ resource "google_compute_instance_template" "foobar" { `, suffix, suffix) } +func testAccComputeInstanceTemplate_withNamePrefix(prefix string) string { + return fmt.Sprintf(` +data "google_compute_image" "my_image" { + family = "debian-12" + project = "debian-cloud" +} +resource "google_compute_instance_template" "foobar" { + name_prefix = "%s" + machine_type = "n1-standard-1" // can't be e2 because of local-ssd + can_ip_forward = false + disk { + source_image = data.google_compute_image.my_image.name + auto_delete = true + boot = true + } + network_interface { + network = "default" + } +} +`, prefix) +} + func testAccComputeInstanceTemplate_with375GbScratchDisk(suffix string) string { return fmt.Sprintf(` data "google_compute_image" "my_image" { @@ -2863,6 +2924,7 @@ resource "google_project" "host_project" { project_id = "%s-host" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host_project" { @@ -2879,6 +2941,7 @@ resource "google_project" "service_project" { project_id = "%s-service" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "service_project" { diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_instance_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_instance_test.go.erb index a788a5166e3a..db5ed73eee12 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_instance_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_instance_test.go.erb @@ -1741,20 +1741,6 @@ func TestAccComputeInstance_guestAcceleratorSkip(t *testing.T) { testAccCheckComputeInstanceLacksGuestAccelerator(&instance), ), }, - // Recreate with guest_accelerator = [] - { - Config: testAccComputeInstance_guestAcceleratorEmptyBlock(instanceName), - Check: resource.ComposeTestCheckFunc( - testAccCheckComputeInstanceExists(t, "google_compute_instance.foobar", &instance), - testAccCheckComputeInstanceLacksGuestAccelerator(&instance), - ), - }, - // Check that count = 0 is the same as empty block [] - { - Config: testAccComputeInstance_guestAccelerator(instanceName, 0), - ExpectNonEmptyPlan: false, - PlanOnly: true, - }, }, }) @@ -6782,6 +6768,7 @@ resource "google_project" "host_project" { project_id = "%s-host" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host_project" { @@ -6798,6 +6785,7 @@ resource "google_project" "service_project" { project_id = "%s-service" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "service_project" { @@ -7152,38 +7140,6 @@ resource "google_compute_instance" "foobar" { `, instance, count) } -func testAccComputeInstance_guestAcceleratorEmptyBlock(instance string) string { - return fmt.Sprintf(` -data "google_compute_image" "my_image" { - family = "debian-11" - project = "debian-cloud" -} - -resource "google_compute_instance" "foobar" { - name = "%s" - machine_type = "n1-standard-1" // can't be e2 because of guest_accelerator - zone = "us-east1-d" - - boot_disk { - initialize_params { - image = data.google_compute_image.my_image.self_link - } - } - - network_interface { - network = "default" - } - - scheduling { - # Instances with guest accelerators do not support live migration. - on_host_maintenance = "TERMINATE" - } - - guest_accelerator = [] -} -`, instance) -} - func testAccComputeInstance_minCpuPlatform(instance string) string { return fmt.Sprintf(` data "google_compute_image" "my_image" { diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_organization_security_policy_rule_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_organization_security_policy_rule_test.go.erb index 4159475464f1..d0c2e2e56c1c 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_organization_security_policy_rule_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_organization_security_policy_rule_test.go.erb @@ -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/mmv1/third_party/terraform/services/compute/resource_compute_project_cloud_armor_tier_test.go b/mmv1/third_party/terraform/services/compute/resource_compute_project_cloud_armor_tier_test.go index 096c179f8f46..cd0142ef5549 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_project_cloud_armor_tier_test.go +++ b/mmv1/third_party/terraform/services/compute/resource_compute_project_cloud_armor_tier_test.go @@ -82,6 +82,7 @@ resource "google_project" "project" { name = "%{projectID}" org_id = "%{org}" billing_account = "%{billingId}" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { @@ -104,6 +105,7 @@ resource "google_project" "project" { name = "%{projectID}" org_id = "%{org}" billing_account = "%{billingId}" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_project_default_network_tier_test.go b/mmv1/third_party/terraform/services/compute/resource_compute_project_default_network_tier_test.go index 39bf09aa41ca..5553dd2331b3 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_project_default_network_tier_test.go +++ b/mmv1/third_party/terraform/services/compute/resource_compute_project_default_network_tier_test.go @@ -71,6 +71,7 @@ resource "google_project" "project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { @@ -93,6 +94,7 @@ resource "google_project" "project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_project_metadata_test.go b/mmv1/third_party/terraform/services/compute/resource_compute_project_metadata_test.go index 45f001271bb0..d594781c541d 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_project_metadata_test.go +++ b/mmv1/third_party/terraform/services/compute/resource_compute_project_metadata_test.go @@ -129,6 +129,7 @@ resource "google_project" "project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { @@ -154,6 +155,7 @@ resource "google_project" "project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { @@ -179,6 +181,7 @@ resource "google_project" "project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { @@ -205,6 +208,7 @@ resource "google_project" "project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_region_backend_service_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_region_backend_service_test.go.erb index a89e692a2437..56d0d8c0b0e4 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_region_backend_service_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_region_backend_service_test.go.erb @@ -263,22 +263,22 @@ func TestAccComputeRegionBackendService_withBackendAndIAP(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), CheckDestroy: testAccCheckComputeRegionBackendServiceDestroyProducer(t), Steps: []resource.TestStep{ - { - Config: testAccComputeRegionBackendService_ilbBasicwithIAP(backendName, checkName), + { + Config: testAccComputeRegionBackendService_ilbBasic(backendName, checkName), }, { ResourceName: "google_compute_region_backend_service.foobar", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"}, }, { - Config: testAccComputeRegionBackendService_ilbBasic(backendName, checkName), + Config: testAccComputeRegionBackendService_ilbBasicwithIAP(backendName, checkName), }, { ResourceName: "google_compute_region_backend_service.foobar", ImportState: true, ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"}, }, }, }) @@ -590,7 +590,8 @@ resource "google_compute_region_backend_service" "foobar" { health_checks = [google_compute_health_check.zero.self_link] region = "us-central1" - protocol = "%s" + protocol = "%s" + connection_draining_timeout_sec = 0 failover_policy { # Disable connection drain on failover cannot be set when the protocol is UDP drop_traffic_if_unhealthy = "%s" @@ -616,7 +617,8 @@ resource "google_compute_region_backend_service" "foobar" { health_checks = [google_compute_health_check.zero.self_link] region = "us-central1" - protocol = "%s" + protocol = "%s" + connection_draining_timeout_sec = 0 failover_policy { # Disable connection drain on failover cannot be set when the protocol is UDP drop_traffic_if_unhealthy = "%s" @@ -704,6 +706,7 @@ resource "google_compute_region_backend_service" "lipsum" { backend { group = google_compute_instance_group_manager.foobar.instance_group + balancing_mode = "CONNECTION" <% unless version.nil? || version == 'ga' -%> failover = true } @@ -773,6 +776,7 @@ resource "google_compute_region_backend_service" "lipsum" { backend { group = google_compute_instance_group_manager.foobar.instance_group + balancing_mode = "CONNECTION" <% unless version.nil? || version == 'ga' -%> failover = true } @@ -875,6 +879,7 @@ resource "google_compute_region_backend_service" "lipsum" { backend { group = google_compute_instance_group_manager.foobar.instance_group capacity_scaler = 1.0 + balancing_mode = "CONNECTION" } health_checks = [google_compute_health_check.default.self_link] @@ -1043,6 +1048,7 @@ resource "google_compute_region_backend_service" "foobar" { } iap { + enabled = true oauth2_client_id = "test" oauth2_client_secret = "test" } diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template.go.erb index d2d11b8554cf..2e7c9ebdfb4e 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template.go.erb @@ -77,11 +77,11 @@ func ResourceComputeRegionInstanceTemplate() *schema.Resource { Description: `Creates a unique name beginning with the specified prefix. Conflicts with name.`, ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { // https://cloud.google.com/compute/docs/reference/latest/instanceTemplates#resource - // uuid is 26 characters, limit the prefix to 37. + // uuid is 9 characters, limit the prefix to 54. value := v.(string) - if len(value) > 37 { + if len(value) > 54 { errors = append(errors, fmt.Errorf( - "%q cannot be longer than 37 characters, name is limited to 63", k)) + "%q cannot be longer than 54 characters, name is limited to 63", k)) } return }, @@ -1144,7 +1144,12 @@ func resourceComputeRegionInstanceTemplateCreate(d *schema.ResourceData, meta in if v, ok := d.GetOk("name"); ok { itName = v.(string) } else if v, ok := d.GetOk("name_prefix"); ok { - itName = id.PrefixedUniqueId(v.(string)) + prefix := v.(string) + if len(prefix) > 37 { + itName = tpgresource.ReducedPrefixedUniqueId(prefix) + } else { + itName = id.PrefixedUniqueId(prefix) + } } else { itName = id.UniqueId() } diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template_test.go.erb index 7a1cd1c5eed9..7674b32c2d3e 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_region_instance_template_test.go.erb @@ -2366,6 +2366,7 @@ resource "google_project" "host_project" { project_id = "%s-host" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host_project" { @@ -2382,6 +2383,7 @@ resource "google_project" "service_project" { project_id = "%s-service" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "service_project" { diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_shared_reservation_update_test.go b/mmv1/third_party/terraform/services/compute/resource_compute_shared_reservation_update_test.go index a5f3f21bfb92..52b836733dd1 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_shared_reservation_update_test.go +++ b/mmv1/third_party/terraform/services/compute/resource_compute_shared_reservation_update_test.go @@ -61,6 +61,7 @@ resource "google_project" "owner_project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } @@ -75,6 +76,7 @@ resource "google_project" "guest_project" { name = "tf-test-2%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project" "guest_project_second" { @@ -82,6 +84,7 @@ resource "google_project" "guest_project_second" { name = "tf-test-3%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project" "guest_project_third" { @@ -89,6 +92,7 @@ resource "google_project" "guest_project_third" { name = "tf-test-4%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_organization_policy" "shared_reservation_org_policy" { @@ -150,6 +154,7 @@ resource "google_project" "owner_project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { @@ -163,6 +168,7 @@ resource "google_project" "guest_project" { name = "tf-test-2%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project" "guest_project_second" { @@ -170,6 +176,7 @@ resource "google_project" "guest_project_second" { name = "tf-test-3%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project" "guest_project_third" { @@ -177,6 +184,7 @@ resource "google_project" "guest_project_third" { name = "tf-test-4%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_organization_policy" "shared_reservation_org_policy" { diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_shared_vpc_test.go b/mmv1/third_party/terraform/services/compute/resource_compute_shared_vpc_test.go index 5b38a6b70156..6880d447814a 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_shared_vpc_test.go +++ b/mmv1/third_party/terraform/services/compute/resource_compute_shared_vpc_test.go @@ -117,6 +117,7 @@ resource "google_project" "host" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project" "service" { @@ -124,6 +125,7 @@ resource "google_project" "service" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host" { @@ -159,6 +161,7 @@ resource "google_project" "host" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project" "service" { @@ -166,6 +169,7 @@ resource "google_project" "service" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host" { @@ -187,6 +191,7 @@ resource "google_project" "host" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project" "service" { @@ -194,6 +199,7 @@ resource "google_project" "service" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host" { @@ -230,6 +236,7 @@ resource "google_project" "host" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project" "service" { @@ -237,6 +244,7 @@ resource "google_project" "service" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host" { diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_subnetwork_test.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_subnetwork_test.go.erb index bd8c28a00e56..1514c42cda73 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_subnetwork_test.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_subnetwork_test.go.erb @@ -188,14 +188,6 @@ func TestAccComputeSubnetwork_secondaryIpRanges(t *testing.T) { testAccCheckComputeSubnetworkHasSecondaryIpRange(&subnetwork, "tf-test-secondary-range-update2", "192.168.11.0/24"), ), }, - { - Config: testAccComputeSubnetwork_secondaryIpRanges_update4(cnName, subnetworkName), - Check: resource.ComposeTestCheckFunc( - testAccCheckComputeSubnetworkExists(t, "google_compute_subnetwork.network-with-private-secondary-ip-ranges", &subnetwork), - testAccCheckComputeSubnetworkHasNotSecondaryIpRange(&subnetwork, "tf-test-secondary-range-update1", "192.168.10.0/24"), - testAccCheckComputeSubnetworkHasNotSecondaryIpRange(&subnetwork, "tf-test-secondary-range-update2", "192.168.11.0/24"), - ), - }, { Config: testAccComputeSubnetwork_secondaryIpRanges_update1(cnName, subnetworkName), Check: resource.ComposeTestCheckFunc( @@ -244,12 +236,6 @@ func TestAccComputeSubnetwork_secondaryIpRanges_sendEmpty(t *testing.T) { testAccCheckComputeSubnetworkHasNotSecondaryIpRange(&subnetwork, "tf-test-secondary-range-update1", "192.168.10.0/24"), ), }, - // Check that empty block secondary_ip_range = [] is not different - { - Config: testAccComputeSubnetwork_sendEmpty_emptyBlock(cnName, subnetworkName, "true"), - PlanOnly: true, - ExpectNonEmptyPlan: false, - }, // Apply two secondary_ip_range { Config: testAccComputeSubnetwork_sendEmpty_double(cnName, subnetworkName, "true"), @@ -282,14 +268,6 @@ func TestAccComputeSubnetwork_secondaryIpRanges_sendEmpty(t *testing.T) { PlanOnly: true, ExpectNonEmptyPlan: false, }, - // Remove with empty block [] - { - Config: testAccComputeSubnetwork_sendEmpty_emptyBlock(cnName, subnetworkName, "true"), - Check: resource.ComposeTestCheckFunc( - testAccCheckComputeSubnetworkExists(t, "google_compute_subnetwork.network-with-private-secondary-ip-ranges", &subnetwork), - testAccCheckComputeSubnetworkHasNotSecondaryIpRange(&subnetwork, "tf-test-secondary-range-update1", "192.168.10.0/24"), - ), - }, }, }) } @@ -691,23 +669,6 @@ resource "google_compute_subnetwork" "network-with-private-secondary-ip-ranges" `, cnName, subnetworkName) } -func testAccComputeSubnetwork_secondaryIpRanges_update4(cnName, subnetworkName string) string { - return fmt.Sprintf(` -resource "google_compute_network" "custom-test" { - name = "%s" - auto_create_subnetworks = false -} - -resource "google_compute_subnetwork" "network-with-private-secondary-ip-ranges" { - name = "%s" - ip_cidr_range = "10.2.0.0/16" - region = "us-central1" - network = google_compute_network.custom-test.self_link - secondary_ip_range = [] -} -`, cnName, subnetworkName) -} - func testAccComputeSubnetwork_sendEmpty_removed(cnName, subnetworkName, sendEmpty string) string { return fmt.Sprintf(` resource "google_compute_network" "custom-test" { @@ -725,24 +686,6 @@ resource "google_compute_subnetwork" "network-with-private-secondary-ip-ranges" `, cnName, subnetworkName, sendEmpty) } -func testAccComputeSubnetwork_sendEmpty_emptyBlock(cnName, subnetworkName, sendEmpty string) string { - return fmt.Sprintf(` -resource "google_compute_network" "custom-test" { - name = "%s" - auto_create_subnetworks = false -} - -resource "google_compute_subnetwork" "network-with-private-secondary-ip-ranges" { - name = "%s" - ip_cidr_range = "10.2.0.0/16" - region = "us-central1" - network = google_compute_network.custom-test.self_link - secondary_ip_range = [] - send_secondary_ip_range_if_empty = "%s" -} -`, cnName, subnetworkName, sendEmpty) -} - func testAccComputeSubnetwork_sendEmpty_single(cnName, subnetworkName, sendEmpty string) string { return fmt.Sprintf(` resource "google_compute_network" "custom-test" { diff --git a/mmv1/third_party/terraform/services/compute/resource_usage_export_bucket_test.go b/mmv1/third_party/terraform/services/compute/resource_usage_export_bucket_test.go index fd4feabe6858..0d0e48cce00f 100644 --- a/mmv1/third_party/terraform/services/compute/resource_usage_export_bucket_test.go +++ b/mmv1/third_party/terraform/services/compute/resource_usage_export_bucket_test.go @@ -39,6 +39,7 @@ resource "google_project" "base" { name = "Export Bucket Base" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "service" { diff --git a/mmv1/third_party/terraform/services/container/data_source_google_container_cluster.go b/mmv1/third_party/terraform/services/container/data_source_google_container_cluster.go index d40ff3240c70..5e943b511094 100644 --- a/mmv1/third_party/terraform/services/container/data_source_google_container_cluster.go +++ b/mmv1/third_party/terraform/services/container/data_source_google_container_cluster.go @@ -47,6 +47,15 @@ func datasourceContainerClusterRead(d *schema.ResourceData, meta interface{}) er return err } + // Sets the "resource_labels" field and "terraform_labels" with the value of the field "effective_labels". + effectiveLabels := d.Get("effective_labels") + if err := d.Set("resource_labels", effectiveLabels); err != nil { + return fmt.Errorf("Error setting labels in data source: %s", err) + } + if err := d.Set("terraform_labels", effectiveLabels); err != nil { + return fmt.Errorf("Error setting terraform_labels in data source: %s", err) + } + if d.Id() == "" { return fmt.Errorf("%s not found", id) } diff --git a/mmv1/third_party/terraform/services/container/data_source_google_container_cluster_test.go b/mmv1/third_party/terraform/services/container/data_source_google_container_cluster_test.go index ee53e5b6cbfe..1a11eebfd502 100644 --- a/mmv1/third_party/terraform/services/container/data_source_google_container_cluster_test.go +++ b/mmv1/third_party/terraform/services/container/data_source_google_container_cluster_test.go @@ -60,6 +60,7 @@ func TestAccContainerClusterDatasource_regional(t *testing.T) { "enable_tpu": {}, "pod_security_policy_config.#": {}, "deletion_protection": {}, + "resource_labels": {}, }, ), ), @@ -96,7 +97,9 @@ resource "google_container_cluster" "kubes" { deletion_protection = false network = "%s" subnetwork = "%s" - + resource_labels = { + created-by = "terraform" + } } data "google_container_cluster" "kubes" { diff --git a/mmv1/third_party/terraform/services/container/go/resource_container_cluster_test.go.tmpl b/mmv1/third_party/terraform/services/container/go/resource_container_cluster_test.go.tmpl index 5618186781d8..96689f613c78 100644 --- a/mmv1/third_party/terraform/services/container/go/resource_container_cluster_test.go.tmpl +++ b/mmv1/third_party/terraform/services/container/go/resource_container_cluster_test.go.tmpl @@ -148,7 +148,7 @@ func TestAccContainerCluster_misc(t *testing.T) { ResourceName: "google_container_cluster.primary", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"remove_default_node_pool", "deletion_protection"}, + ImportStateVerifyIgnore: []string{"remove_default_node_pool", "deletion_protection", "resource_labels", "terraform_labels"}, }, { Config: testAccContainerCluster_misc_update(clusterName, networkName, subnetworkName), @@ -157,7 +157,7 @@ func TestAccContainerCluster_misc(t *testing.T) { ResourceName: "google_container_cluster.primary", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"remove_default_node_pool", "deletion_protection"}, + ImportStateVerifyIgnore: []string{"remove_default_node_pool", "deletion_protection", "resource_labels", "terraform_labels"}, }, }, }) @@ -8469,6 +8469,7 @@ resource "google_project" "host_project" { project_id = "%s-host" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host_project" { @@ -8485,6 +8486,7 @@ resource "google_project" "service_project" { project_id = "%s-service" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "service_project" { diff --git a/mmv1/third_party/terraform/services/container/node_config.go.erb b/mmv1/third_party/terraform/services/container/node_config.go.erb index 45c732d0fa41..2f4fb60e1849 100644 --- a/mmv1/third_party/terraform/services/container/node_config.go.erb +++ b/mmv1/third_party/terraform/services/container/node_config.go.erb @@ -139,9 +139,6 @@ func schemaNodeConfig() *schema.Schema { Optional: true, Computed: true, ForceNew: true, - // Legacy config mode allows removing GPU's from an existing resource - // See https://www.terraform.io/docs/configuration/attr-as-blocks.html - ConfigMode: schema.SchemaConfigModeAttr, Description: `List of the type and count of accelerator cards attached to the instance.`, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -164,7 +161,6 @@ func schemaNodeConfig() *schema.Schema { Optional: true, Computed: true, ForceNew: true, - ConfigMode: schema.SchemaConfigModeAttr, Description: `Configuration for auto installation of GPU driver.`, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -189,7 +185,6 @@ func schemaNodeConfig() *schema.Schema { MaxItems: 1, Optional: true, ForceNew: true, - ConfigMode: schema.SchemaConfigModeAttr, Description: `Configuration for GPU sharing.`, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ diff --git a/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb b/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb index 83e02b5eea0f..e54568ee7f45 100644 --- a/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb @@ -218,6 +218,7 @@ func ResourceContainerCluster() *schema.Resource { containerClusterSurgeSettingsCustomizeDiff, containerClusterEnableK8sBetaApisCustomizeDiff, containerClusterNodeVersionCustomizeDiff, + tpgresource.SetDiffForLabelsWithCustomizedName("resource_labels"), ), Timeouts: &schema.ResourceTimeout{ @@ -1290,20 +1291,9 @@ func ResourceContainerCluster() *schema.Resource { Description: `Whether or not the advanced datapath metrics are enabled.`, }, "enable_relay": { - Type: schema.TypeBool, - Optional: true, - Description: `Whether or not Relay is enabled.`, - Default: false, - ConflictsWith: []string{"monitoring_config.0.advanced_datapath_observability_config.0.relay_mode"}, - }, - "relay_mode": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Deprecated: "Deprecated in favor of enable_relay field. Remove this attribute's configuration as this field will be removed in the next major release and enable_relay will become a required field.", - Description: `Mode used to make Relay available.`, - ValidateFunc: validation.StringInSlice([]string{"DISABLED", "INTERNAL_VPC_LB", "EXTERNAL_LB"}, false), - ConflictsWith: []string{"monitoring_config.0.advanced_datapath_observability_config.0.enable_relay"}, + Type: schema.TypeBool, + Required: true, + Description: `Whether or not Relay is enabled.`, }, }, }, @@ -1822,7 +1812,22 @@ func ResourceContainerCluster() *schema.Resource { Type: schema.TypeMap, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, - Description: `The GCE resource labels (a map of key/value pairs) to be applied to the cluster.`, + Description: `The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + + **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource.`, + }, + "terraform_labels": { + Type: schema.TypeMap, + Computed: true, + Description: `The combination of labels configured directly on the resource and default labels configured on the provider.`, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "effective_labels": { + Type: schema.TypeMap, + Computed: true, + Description: `All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.`, + Elem: &schema.Schema{Type: schema.TypeString}, }, "label_fingerprint": { @@ -2239,12 +2244,6 @@ func ResourceContainerCluster() *schema.Resource { // One quirk with this approach is that configs with mixed count=0 and count>0 accelerator blocks will // show a confusing diff if one of there are config changes that result in a legitimate diff as the count=0 // blocks will not be in state. -// -// This could also be modelled by setting `guest_accelerator = []` in the config. However since the -// previous syntax requires that schema.SchemaConfigModeAttr is set on the field it is advisable that -// we have a work around for removing guest accelerators. Also Terraform 0.11 cannot use dynamic blocks -// so this isn't a solution for module authors who want to dynamically omit guest accelerators -// See https://github.com/hashicorp/terraform-provider-google/issues/3786 func resourceNodeConfigEmptyGuestAccelerator(_ context.Context, diff *schema.ResourceDiff, meta interface{}) error { old, new := diff.GetChange("node_config.0.guest_accelerator") oList := old.([]interface{}) @@ -2388,7 +2387,7 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er MasterAuth: expandMasterAuth(d.Get("master_auth")), NotificationConfig: expandNotificationConfig(d.Get("notification_config")), ConfidentialNodes: expandConfidentialNodes(d.Get("confidential_nodes")), - ResourceLabels: tpgresource.ExpandStringMap(d, "resource_labels"), + ResourceLabels: tpgresource.ExpandStringMap(d, "effective_labels"), NodePoolAutoConfig: expandNodePoolAutoConfig(d.Get("node_pool_auto_config")), <% unless version == 'ga' -%> ProtectConfig: expandProtectConfig(d.Get("protect_config")), @@ -3006,8 +3005,14 @@ func resourceContainerClusterRead(d *schema.ResourceData, meta interface{}) erro } <% end -%> - if err := d.Set("resource_labels", cluster.ResourceLabels); err != nil { - return fmt.Errorf("Error setting resource_labels: %s", err) + if err := tpgresource.SetLabels(cluster.ResourceLabels, d, "resource_labels"); err != nil { + return fmt.Errorf("Error setting labels: %s", err) + } + if err := tpgresource.SetLabels(cluster.ResourceLabels, d, "terraform_labels"); err != nil { + return fmt.Errorf("Error setting terraform_labels: %s", err) + } + if err := d.Set("effective_labels", cluster.ResourceLabels); err != nil { + return fmt.Errorf("Error setting effective_labels: %s", err) } if err := d.Set("label_fingerprint", cluster.LabelFingerprint); err != nil { return fmt.Errorf("Error setting label_fingerprint: %s", err) @@ -4099,8 +4104,8 @@ func resourceContainerClusterUpdate(d *schema.ResourceData, meta interface{}) er log.Printf("[INFO] GKE cluster %s monitoring config has been updated", d.Id()) } - if d.HasChange("resource_labels") { - resourceLabels := d.Get("resource_labels").(map[string]interface{}) + if d.HasChange("effective_labels") { + resourceLabels := d.Get("effective_labels").(map[string]interface{}) labelFingerprint := d.Get("label_fingerprint").(string) req := &container.SetLabelsRequest{ ResourceLabels: tpgresource.ConvertStringMap(resourceLabels), @@ -5588,21 +5593,10 @@ func expandMonitoringConfig(configured interface{}) *container.MonitoringConfig if v, ok := config["advanced_datapath_observability_config"]; ok && len(v.([]interface{})) > 0 { advanced_datapath_observability_config := v.([]interface{})[0].(map[string]interface{}) - mc.AdvancedDatapathObservabilityConfig = &container.AdvancedDatapathObservabilityConfig{ EnableMetrics: advanced_datapath_observability_config["enable_metrics"].(bool), - } - - enable_relay := advanced_datapath_observability_config["enable_relay"].(bool) - relay_mode := advanced_datapath_observability_config["relay_mode"].(string) - if enable_relay { - mc.AdvancedDatapathObservabilityConfig.EnableRelay = enable_relay - } else if relay_mode == "INTERNAL_VPC_LB" || relay_mode == "EXTERNAL_LB" { - mc.AdvancedDatapathObservabilityConfig.RelayMode = relay_mode - } else { - mc.AdvancedDatapathObservabilityConfig.EnableRelay = enable_relay - mc.AdvancedDatapathObservabilityConfig.RelayMode = "DISABLED" - mc.AdvancedDatapathObservabilityConfig.ForceSendFields = []string{"EnableRelay"} + EnableRelay: advanced_datapath_observability_config["enable_relay"].(bool), + ForceSendFields: []string{"EnableRelay"}, } } @@ -6497,29 +6491,10 @@ func flattenAdvancedDatapathObservabilityConfig(c *container.AdvancedDatapathObs return nil } - if c.EnableRelay { - return []map[string]interface{}{ - { - "enable_metrics": c.EnableMetrics, - "enable_relay": c.EnableRelay, - }, - } - } - - if c.RelayMode == "INTERNAL_VPC_LB" || c.RelayMode == "EXTERNAL_LB" { - return []map[string]interface{}{ - { - "enable_metrics": c.EnableMetrics, - "relay_mode": c.RelayMode, - }, - } - } - return []map[string]interface{}{ { "enable_metrics": c.EnableMetrics, - "enable_relay": false, - "relay_mode": "DISABLED", + "enable_relay": c.EnableRelay, }, } } diff --git a/mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.erb b/mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.erb index dc54b69d3ec1..7f8197de14f2 100644 --- a/mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.erb +++ b/mmv1/third_party/terraform/services/container/resource_container_cluster_test.go.erb @@ -149,7 +149,7 @@ func TestAccContainerCluster_misc(t *testing.T) { ResourceName: "google_container_cluster.primary", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"remove_default_node_pool", "deletion_protection"}, + ImportStateVerifyIgnore: []string{"remove_default_node_pool", "deletion_protection", "resource_labels", "terraform_labels"}, }, { Config: testAccContainerCluster_misc_update(clusterName, networkName, subnetworkName), @@ -158,7 +158,7 @@ func TestAccContainerCluster_misc(t *testing.T) { ResourceName: "google_container_cluster.primary", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"remove_default_node_pool", "deletion_protection"}, + ImportStateVerifyIgnore: []string{"remove_default_node_pool", "deletion_protection", "resource_labels", "terraform_labels"}, }, }, }) @@ -3426,24 +3426,6 @@ func TestAccContainerCluster_withMonitoringConfigAdvancedDatapathObservabilityCo ImportStateVerify: true, ImportStateVerifyIgnore: []string{"min_master_version", "deletion_protection"}, }, - { - Config: testAccContainerCluster_withMonitoringConfigAdvancedDatapathObservabilityConfigEnabledOld(clusterName), - }, - { - ResourceName: "google_container_cluster.primary", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"min_master_version", "deletion_protection"}, - }, - { - Config: testAccContainerCluster_withMonitoringConfigAdvancedDatapathObservabilityConfigDisabledOld(clusterName), - }, - { - ResourceName: "google_container_cluster.primary", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"min_master_version", "deletion_protection"}, - }, }, }) } @@ -8584,6 +8566,7 @@ resource "google_project" "host_project" { project_id = "%s-host" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host_project" { @@ -8600,6 +8583,7 @@ resource "google_project" "service_project" { project_id = "%s-service" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "service_project" { @@ -9724,56 +9708,6 @@ resource "google_container_cluster" "primary" { `, name, name) } -func testAccContainerCluster_withMonitoringConfigAdvancedDatapathObservabilityConfigEnabledOld(name string) string { - return fmt.Sprintf(` -resource "google_compute_network" "container_network" { - name = "%s-nw" - auto_create_subnetworks = false -} - -resource "google_compute_subnetwork" "container_subnetwork" { - name = google_compute_network.container_network.name - network = google_compute_network.container_network.name - ip_cidr_range = "10.0.36.0/24" - region = "us-central1" - private_ip_google_access = true - - secondary_ip_range { - range_name = "services-range" - ip_cidr_range = "192.168.1.0/24" - } - - secondary_ip_range { - range_name = "pod-ranges" - ip_cidr_range = "192.168.64.0/22" - } -} - -resource "google_container_cluster" "primary" { - name = "%s" - location = "us-central1-a" - initial_node_count = 1 - datapath_provider = "ADVANCED_DATAPATH" - - network = google_compute_network.container_network.name - subnetwork = google_compute_subnetwork.container_subnetwork.name - ip_allocation_policy { - cluster_secondary_range_name = google_compute_subnetwork.container_subnetwork.secondary_ip_range[0].range_name - services_secondary_range_name = google_compute_subnetwork.container_subnetwork.secondary_ip_range[1].range_name - } - - monitoring_config { - enable_components = [] - advanced_datapath_observability_config { - enable_metrics = true - relay_mode = "INTERNAL_VPC_LB" - } - } - deletion_protection = false -} -`, name, name) -} - func testAccContainerCluster_withMonitoringConfigAdvancedDatapathObservabilityConfigDisabled(name string) string { return fmt.Sprintf(` resource "google_compute_network" "container_network" { @@ -9824,56 +9758,6 @@ resource "google_container_cluster" "primary" { `, name, name) } -func testAccContainerCluster_withMonitoringConfigAdvancedDatapathObservabilityConfigDisabledOld(name string) string { - return fmt.Sprintf(` -resource "google_compute_network" "container_network" { - name = "%s-nw" - auto_create_subnetworks = false -} - -resource "google_compute_subnetwork" "container_subnetwork" { - name = google_compute_network.container_network.name - network = google_compute_network.container_network.name - ip_cidr_range = "10.0.36.0/24" - region = "us-central1" - private_ip_google_access = true - - secondary_ip_range { - range_name = "services-range" - ip_cidr_range = "192.168.1.0/24" - } - - secondary_ip_range { - range_name = "pod-ranges" - ip_cidr_range = "192.168.64.0/22" - } -} - -resource "google_container_cluster" "primary" { - name = "%s" - location = "us-central1-a" - initial_node_count = 1 - datapath_provider = "ADVANCED_DATAPATH" - - network = google_compute_network.container_network.name - subnetwork = google_compute_subnetwork.container_subnetwork.name - ip_allocation_policy { - cluster_secondary_range_name = google_compute_subnetwork.container_subnetwork.secondary_ip_range[0].range_name - services_secondary_range_name = google_compute_subnetwork.container_subnetwork.secondary_ip_range[1].range_name - } - - monitoring_config { - enable_components = [] - advanced_datapath_observability_config { - enable_metrics = false - relay_mode = "DISABLED" - } - } - deletion_protection = false -} -`, name, name) -} - func testAccContainerCluster_withSoleTenantGroup(name, networkName, subnetworkName string) string { return fmt.Sprintf(` resource "google_compute_node_template" "soletenant-tmpl" { @@ -10934,6 +10818,7 @@ resource "google_container_cluster" "with_autopilot" { } func TestAccContainerCluster_privateRegistry(t *testing.T) { + acctest.SkipIfVcr(t) t.Parallel() clusterName := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10)) @@ -11214,3 +11099,158 @@ resource "google_container_cluster" "primary" { } `, secretID, clusterName, networkName, subnetworkName) } + +func TestAccContainerCluster_withProviderDefaultLabels(t *testing.T) { + // The test failed if VCR testing is enabled, because the cached provider config is used. + // With the cached provider config, any changes in the provider default labels will not be applied. + acctest.SkipIfVcr(t) + t.Parallel() + + clusterName := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10)) + networkName := acctest.BootstrapSharedTestNetwork(t, "gke-cluster") + subnetworkName := acctest.BootstrapSubnet(t, "gke-cluster", networkName) + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + CheckDestroy: testAccCheckContainerClusterDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccContainerCluster_withProviderDefaultLabels(clusterName, networkName, subnetworkName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("google_container_cluster.primary", "resource_labels.%", "1"), + resource.TestCheckResourceAttr("google_container_cluster.primary", "resource_labels.created-by", "terraform"), + + resource.TestCheckResourceAttr("google_container_cluster.primary", "terraform_labels.%", "2"), + resource.TestCheckResourceAttr("google_container_cluster.primary", "terraform_labels.default_key1", "default_value1"), + resource.TestCheckResourceAttr("google_container_cluster.primary", "terraform_labels.created-by", "terraform"), + + resource.TestCheckResourceAttr("google_container_cluster.primary", "effective_labels.%", "2"), + ), + }, + { + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"remove_default_node_pool", "deletion_protection", "resource_labels", "terraform_labels"}, + }, + { + Config: testAccContainerCluster_resourceLabelsOverridesProviderDefaultLabels(clusterName, networkName, subnetworkName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("google_container_cluster.primary", "resource_labels.%", "2"), + resource.TestCheckResourceAttr("google_container_cluster.primary", "resource_labels.created-by", "terraform"), + resource.TestCheckResourceAttr("google_container_cluster.primary", "terraform_labels.default_key1", "value1"), + + resource.TestCheckResourceAttr("google_container_cluster.primary", "terraform_labels.%", "2"), + resource.TestCheckResourceAttr("google_container_cluster.primary", "terraform_labels.default_key1", "value1"), + resource.TestCheckResourceAttr("google_container_cluster.primary", "terraform_labels.created-by", "terraform"), + + resource.TestCheckResourceAttr("google_container_cluster.primary", "effective_labels.%", "2"), + ), + }, + { + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"remove_default_node_pool", "deletion_protection", "resource_labels", "terraform_labels"}, + }, + { + Config: testAccContainerCluster_moveResourceLabelToProviderDefaultLabels(clusterName, networkName, subnetworkName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("google_container_cluster.primary", "resource_labels.%", "0"), + + resource.TestCheckResourceAttr("google_container_cluster.primary", "terraform_labels.%", "2"), + resource.TestCheckResourceAttr("google_container_cluster.primary", "terraform_labels.default_key1", "default_value1"), + resource.TestCheckResourceAttr("google_container_cluster.primary", "terraform_labels.created-by", "terraform"), + + resource.TestCheckResourceAttr("google_container_cluster.primary", "effective_labels.%", "2"), + ), + }, + { + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"remove_default_node_pool", "deletion_protection", "resource_labels", "terraform_labels"}, + }, + { + Config: testAccContainerCluster_basic(clusterName, networkName, subnetworkName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("google_container_cluster.primary", "resource_labels.%", "0"), + resource.TestCheckResourceAttr("google_container_cluster.primary", "terraform_labels.%", "0"), + resource.TestCheckResourceAttr("google_container_cluster.primary", "effective_labels.%", "0"), + ), + }, + { + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"remove_default_node_pool", "deletion_protection", "resource_labels", "terraform_labels"}, + }, + }, + }) +} + +func testAccContainerCluster_withProviderDefaultLabels(name, networkName, subnetworkName string) string { + return fmt.Sprintf(` +provider "google" { + default_labels = { + default_key1 = "default_value1" + } +} + +resource "google_container_cluster" "primary" { + name = "%s" + location = "us-central1-a" + initial_node_count = 1 + deletion_protection = false + network = "%s" + subnetwork = "%s" + resource_labels = { + created-by = "terraform" + } +} +`, name, networkName, subnetworkName) +} + +func testAccContainerCluster_resourceLabelsOverridesProviderDefaultLabels(name, networkName, subnetworkName string) string { + return fmt.Sprintf(` +provider "google" { + default_labels = { + default_key1 = "default_value1" + } +} + +resource "google_container_cluster" "primary" { + name = "%s" + location = "us-central1-a" + initial_node_count = 1 + deletion_protection = false + network = "%s" + subnetwork = "%s" + resource_labels = { + created-by = "terraform" + default_key1 = "value1" + } +} +`, name, networkName, subnetworkName) +} + +func testAccContainerCluster_moveResourceLabelToProviderDefaultLabels(name, networkName, subnetworkName string) string { + return fmt.Sprintf(` +provider "google" { + default_labels = { + default_key1 = "default_value1" + created-by = "terraform" + } +} + +resource "google_container_cluster" "primary" { + name = "%s" + location = "us-central1-a" + initial_node_count = 1 + deletion_protection = false + network = "%s" + subnetwork = "%s" +} +`, name, networkName, subnetworkName) +} diff --git a/mmv1/third_party/terraform/services/container/resource_container_node_pool_test.go.erb b/mmv1/third_party/terraform/services/container/resource_container_node_pool_test.go.erb index 38a709c5cdd2..7e0cc29f83a9 100644 --- a/mmv1/third_party/terraform/services/container/resource_container_node_pool_test.go.erb +++ b/mmv1/third_party/terraform/services/container/resource_container_node_pool_test.go.erb @@ -1293,45 +1293,6 @@ func TestAccContainerNodePool_regionalClusters(t *testing.T) { }) } -func TestAccContainerNodePool_012_ConfigModeAttr(t *testing.T) { - t.Parallel() - - cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10)) - np := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(t, 10)) - networkName := acctest.BootstrapSharedTestNetwork(t, "gke-cluster") - subnetworkName := acctest.BootstrapSubnet(t, "gke-cluster", networkName) - - acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), - CheckDestroy: testAccCheckContainerNodePoolDestroyProducer(t), - Steps: []resource.TestStep{ - { - Config: testAccContainerNodePool_012_ConfigModeAttr1(cluster, np, networkName, subnetworkName), - }, - { - ResourceName: "google_container_node_pool.np", - ImportState: true, - ImportStateVerify: true, - }, - { - Config: testAccContainerNodePool_012_ConfigModeAttr2(cluster, np, networkName, subnetworkName), - }, - { - ResourceName: "google_container_node_pool.np", - ImportState: true, - ImportStateVerify: true, - }, - { - // Test guest_accelerator.count = 0 is the same as guest_accelerator = [] - Config: testAccContainerNodePool_EmptyGuestAccelerator(cluster, np, networkName, subnetworkName), - ExpectNonEmptyPlan: false, - PlanOnly: true, - }, - }, - }) -} - func TestAccContainerNodePool_EmptyGuestAccelerator(t *testing.T) { t.Parallel() @@ -3759,59 +3720,6 @@ resource "google_container_node_pool" "np" { `, cluster, networkName, subnetworkName, np) } -func testAccContainerNodePool_012_ConfigModeAttr1(cluster, np, networkName, subnetworkName string) string { - return fmt.Sprintf(` -resource "google_container_cluster" "cluster" { - name = "%s" - location = "us-central1-f" - initial_node_count = 3 - deletion_protection = false - network = "%s" - subnetwork = "%s" -} - -resource "google_container_node_pool" "np" { - name = "%s" - location = "us-central1-f" - cluster = google_container_cluster.cluster.name - initial_node_count = 1 - - node_config { - guest_accelerator { - count = 1 - type = "nvidia-tesla-t4" - } - machine_type = "n1-highmem-4" - } -} -`, cluster, networkName, subnetworkName, np) -} - -func testAccContainerNodePool_012_ConfigModeAttr2(cluster, np, networkName, subnetworkName string) string { - return fmt.Sprintf(` -resource "google_container_cluster" "cluster" { - name = "%s" - location = "us-central1-f" - initial_node_count = 3 - deletion_protection = false - network = "%s" - subnetwork = "%s" -} - -resource "google_container_node_pool" "np" { - name = "%s" - location = "us-central1-f" - cluster = google_container_cluster.cluster.name - initial_node_count = 1 - - node_config { - guest_accelerator = [] - machine_type = "n1-highmem-4" - } -} -`, cluster, networkName, subnetworkName, np) -} - func testAccContainerNodePool_EmptyGuestAccelerator(cluster, np, networkName, subnetworkName string) string { return fmt.Sprintf(` resource "google_container_cluster" "cluster" { @@ -4881,6 +4789,7 @@ resource "google_container_node_pool" "np" { } func TestAccContainerNodePool_defaultDriverInstallation(t *testing.T) { + acctest.SkipIfVcr(t) t.Parallel() cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10)) diff --git a/mmv1/third_party/terraform/services/corebilling/resource_google_billing_project_info_test.go b/mmv1/third_party/terraform/services/corebilling/resource_google_billing_project_info_test.go index 240bb5453ce2..2b84140aa14d 100644 --- a/mmv1/third_party/terraform/services/corebilling/resource_google_billing_project_info_test.go +++ b/mmv1/third_party/terraform/services/corebilling/resource_google_billing_project_info_test.go @@ -59,6 +59,7 @@ resource "google_project" "project" { project_id = "%s" name = "%[1]s" org_id = "%s" + deletion_policy = "DELETE" lifecycle { ignore_changes = [billing_account] } diff --git a/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster.go b/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster.go index 0abed2ab6332..8535f48d4833 100644 --- a/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster.go +++ b/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster.go @@ -187,7 +187,8 @@ func ResourceDataprocCluster() *schema.Resource { CustomizeDiff: customdiff.All( tpgresource.DefaultProviderProject, - tpgresource.SetLabelsDiff, + // User labels are not supported in Dataproc Virtual Cluster + tpgresource.SetLabelsDiffWithoutAttributionLabel, ), SchemaVersion: 1, diff --git a/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_agent_test.go b/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_agent_test.go index b7f60b07a3f8..640d82c9e1e5 100644 --- a/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_agent_test.go +++ b/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_agent_test.go @@ -3,9 +3,9 @@ package dialogflow_test import ( "testing" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-google/google/acctest" "github.com/hashicorp/terraform-provider-google/google/envvar" - "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccDialogflowAgent_update(t *testing.T) { @@ -52,6 +52,7 @@ func testAccDialogflowAgent_full1(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { @@ -95,6 +96,7 @@ func testAccDialogflowAgent_full2(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { diff --git a/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_entity_type_test.go b/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_entity_type_test.go index 373894d57561..40339bd665f0 100644 --- a/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_entity_type_test.go +++ b/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_entity_type_test.go @@ -49,6 +49,7 @@ func testAccDialogflowEntityType_full1(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { @@ -100,6 +101,7 @@ func testAccDialogflowEntityType_full2(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { diff --git a/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_fulfillment_test.go b/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_fulfillment_test.go index 3d96bd347040..4cde09ca75e7 100644 --- a/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_fulfillment_test.go +++ b/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_fulfillment_test.go @@ -49,6 +49,7 @@ func testAccDialogflowFulfillment_basic(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { @@ -91,6 +92,7 @@ func testAccDialogflowEntityType_full(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { diff --git a/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_intent_test.go b/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_intent_test.go index f9d1339ab953..f4e4194ca4d4 100644 --- a/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_intent_test.go +++ b/mmv1/third_party/terraform/services/dialogflow/go/resource_dialogflow_intent_test.go @@ -74,6 +74,7 @@ func testAccDialogflowIntent_basic(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { @@ -115,6 +116,7 @@ func testAccDialogflowIntent_full1(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { @@ -165,6 +167,7 @@ func testAccDialogflowIntent_full2(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { diff --git a/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_agent_test.go.erb b/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_agent_test.go.erb index f6cbb50c55c1..4dde62a9509b 100644 --- a/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_agent_test.go.erb +++ b/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_agent_test.go.erb @@ -53,6 +53,7 @@ func testAccDialogflowAgent_full1(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { @@ -96,6 +97,7 @@ func testAccDialogflowAgent_full2(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { diff --git a/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_entity_type_test.go.erb b/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_entity_type_test.go.erb index 11075e4ebd06..d33bffd365aa 100644 --- a/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_entity_type_test.go.erb +++ b/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_entity_type_test.go.erb @@ -50,6 +50,7 @@ func testAccDialogflowEntityType_full1(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { @@ -101,6 +102,7 @@ func testAccDialogflowEntityType_full2(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { diff --git a/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_fulfillment_test.go.erb b/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_fulfillment_test.go.erb index 7107116736da..e4a5051ab6b5 100644 --- a/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_fulfillment_test.go.erb +++ b/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_fulfillment_test.go.erb @@ -50,6 +50,7 @@ func testAccDialogflowFulfillment_basic(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { @@ -92,6 +93,7 @@ func testAccDialogflowEntityType_full(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { diff --git a/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_intent_test.go.erb b/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_intent_test.go.erb index 417285949bf6..4a1832950168 100644 --- a/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_intent_test.go.erb +++ b/mmv1/third_party/terraform/services/dialogflow/resource_dialogflow_intent_test.go.erb @@ -75,6 +75,7 @@ func testAccDialogflowIntent_basic(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { @@ -116,6 +117,7 @@ func testAccDialogflowIntent_full1(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { @@ -166,6 +168,7 @@ func testAccDialogflowIntent_full2(context map[string]interface{}) string { project_id = "tf-test-dialogflow-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "agent_project" { diff --git a/mmv1/third_party/terraform/services/documentaiwarehouse/resource_document_ai_warehouse_document_schema_test.go b/mmv1/third_party/terraform/services/documentaiwarehouse/resource_document_ai_warehouse_document_schema_test.go index d84978da525b..e2521f2b5b33 100644 --- a/mmv1/third_party/terraform/services/documentaiwarehouse/resource_document_ai_warehouse_document_schema_test.go +++ b/mmv1/third_party/terraform/services/documentaiwarehouse/resource_document_ai_warehouse_document_schema_test.go @@ -126,6 +126,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "contentwarehouse" { @@ -159,6 +160,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_document_ai_warehouse_location" "loc" { @@ -201,6 +203,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_document_ai_warehouse_location" "loc" { @@ -242,6 +245,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_document_ai_warehouse_location" "loc" { @@ -283,6 +287,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_document_ai_warehouse_location" "loc" { @@ -341,6 +346,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_document_ai_warehouse_location" "loc" { @@ -406,6 +412,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_document_ai_warehouse_location" "loc" { @@ -454,6 +461,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_document_ai_warehouse_location" "loc" { @@ -495,6 +503,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_document_ai_warehouse_location" "loc" { @@ -536,6 +545,7 @@ resource "google_project" "project" { name = "tf-test-%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_document_ai_warehouse_location" "loc" { diff --git a/mmv1/third_party/terraform/services/firebase/go/resource_firebase_project_test.go.tmpl b/mmv1/third_party/terraform/services/firebase/go/resource_firebase_project_test.go.tmpl index a5f1b25fd928..ca3363783930 100644 --- a/mmv1/third_party/terraform/services/firebase/go/resource_firebase_project_test.go.tmpl +++ b/mmv1/third_party/terraform/services/firebase/go/resource_firebase_project_test.go.tmpl @@ -47,6 +47,7 @@ resource "google_project" "default" { project_id = "tf-test-my-project%{random_suffix}" name = "tf-test-my-project%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" labels = { "firebase" = "enabled" diff --git a/mmv1/third_party/terraform/services/firebase/go/resource_firebase_web_app_test.go.tmpl b/mmv1/third_party/terraform/services/firebase/go/resource_firebase_web_app_test.go.tmpl index 86b26599fa69..8106154a2bff 100644 --- a/mmv1/third_party/terraform/services/firebase/go/resource_firebase_web_app_test.go.tmpl +++ b/mmv1/third_party/terraform/services/firebase/go/resource_firebase_web_app_test.go.tmpl @@ -125,6 +125,7 @@ resource "google_project" "default" { project_id = "tf-test%{random_suffix}" name = "tf-test%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" labels = { "firebase" = "enabled" } diff --git a/mmv1/third_party/terraform/services/firebase/resource_firebase_project_test.go.erb b/mmv1/third_party/terraform/services/firebase/resource_firebase_project_test.go.erb index 9a53aff81f0b..2317b0380a4b 100644 --- a/mmv1/third_party/terraform/services/firebase/resource_firebase_project_test.go.erb +++ b/mmv1/third_party/terraform/services/firebase/resource_firebase_project_test.go.erb @@ -48,6 +48,7 @@ resource "google_project" "default" { project_id = "tf-test-my-project%{random_suffix}" name = "tf-test-my-project%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" labels = { "firebase" = "enabled" diff --git a/mmv1/third_party/terraform/services/firebase/resource_firebase_web_app_test.go.erb b/mmv1/third_party/terraform/services/firebase/resource_firebase_web_app_test.go.erb index 85f64ee8c37e..587528e46604 100644 --- a/mmv1/third_party/terraform/services/firebase/resource_firebase_web_app_test.go.erb +++ b/mmv1/third_party/terraform/services/firebase/resource_firebase_web_app_test.go.erb @@ -126,6 +126,7 @@ resource "google_project" "default" { project_id = "tf-test%{random_suffix}" name = "tf-test%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" labels = { "firebase" = "enabled" } diff --git a/mmv1/third_party/terraform/services/firebaseappcheck/go/resource_firebase_app_check_service_config_test.go.tmpl b/mmv1/third_party/terraform/services/firebaseappcheck/go/resource_firebase_app_check_service_config_test.go.tmpl index 764a76113cae..dfd7901eff82 100644 --- a/mmv1/third_party/terraform/services/firebaseappcheck/go/resource_firebase_app_check_service_config_test.go.tmpl +++ b/mmv1/third_party/terraform/services/firebaseappcheck/go/resource_firebase_app_check_service_config_test.go.tmpl @@ -67,6 +67,7 @@ resource "google_project" "default" { project_id = "tf-test-appcheck%{random_suffix}" name = "tf-test-appcheck%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" labels = { "firebase" = "enabled" } diff --git a/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_service_config_test.go.erb b/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_service_config_test.go.erb index 298c89c11f50..0839ab183c22 100644 --- a/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_service_config_test.go.erb +++ b/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_service_config_test.go.erb @@ -68,6 +68,7 @@ resource "google_project" "default" { project_id = "tf-test-appcheck%{random_suffix}" name = "tf-test-appcheck%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" labels = { "firebase" = "enabled" } diff --git a/mmv1/third_party/terraform/services/firestore/resource_firestore_document_test.go b/mmv1/third_party/terraform/services/firestore/resource_firestore_document_test.go index 4f3e61d95e63..e4d3914f984c 100644 --- a/mmv1/third_party/terraform/services/firestore/resource_firestore_document_test.go +++ b/mmv1/third_party/terraform/services/firestore/resource_firestore_document_test.go @@ -48,6 +48,7 @@ resource "google_project" "project" { project_id = "tf-test%s" name = "tf-test%s" org_id = "%s" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/third_party/terraform/services/firestore/resource_firestore_field_test.go b/mmv1/third_party/terraform/services/firestore/resource_firestore_field_test.go index b17f503c84ad..7543ea0043aa 100644 --- a/mmv1/third_party/terraform/services/firestore/resource_firestore_field_test.go +++ b/mmv1/third_party/terraform/services/firestore/resource_firestore_field_test.go @@ -78,6 +78,7 @@ resource "google_project" "project" { project_id = "tf-test%{random_suffix}" name = "tf-test%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" } resource "time_sleep" "wait_60_seconds" { diff --git a/mmv1/third_party/terraform/services/gkehub/go/resource_gke_hub_feature_membership_test.go.tmpl b/mmv1/third_party/terraform/services/gkehub/go/resource_gke_hub_feature_membership_test.go.tmpl index f3308d0f4f89..0efe16dc20f4 100644 --- a/mmv1/third_party/terraform/services/gkehub/go/resource_gke_hub_feature_membership_test.go.tmpl +++ b/mmv1/third_party/terraform/services/gkehub/go/resource_gke_hub_feature_membership_test.go.tmpl @@ -1344,6 +1344,7 @@ resource "google_project" "project" { project_id = "tf-test-gkehub%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "anthos" { diff --git a/mmv1/third_party/terraform/services/gkehub/resource_gke_hub_feature_membership_test.go.erb b/mmv1/third_party/terraform/services/gkehub/resource_gke_hub_feature_membership_test.go.erb index a15fa7090392..cd2cbecc37d0 100644 --- a/mmv1/third_party/terraform/services/gkehub/resource_gke_hub_feature_membership_test.go.erb +++ b/mmv1/third_party/terraform/services/gkehub/resource_gke_hub_feature_membership_test.go.erb @@ -1347,6 +1347,7 @@ resource "google_project" "project" { project_id = "tf-test-gkehub%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "anthos" { diff --git a/mmv1/third_party/terraform/services/gkehub2/go/iam_gke_hub_feature_test.go b/mmv1/third_party/terraform/services/gkehub2/go/iam_gke_hub_feature_test.go index 0d85b9b38d83..48eb09f11440 100644 --- a/mmv1/third_party/terraform/services/gkehub2/go/iam_gke_hub_feature_test.go +++ b/mmv1/third_party/terraform/services/gkehub2/go/iam_gke_hub_feature_test.go @@ -128,6 +128,7 @@ resource "google_project" "project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "mcsd" { project = google_project.project.project_id @@ -164,6 +165,7 @@ resource "google_project" "project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "mcsd" { project = google_project.project.project_id @@ -213,6 +215,7 @@ resource "google_project" "project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "mcsd" { project = google_project.project.project_id @@ -250,6 +253,7 @@ resource "google_project" "project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "mcsd" { project = google_project.project.project_id @@ -286,6 +290,7 @@ resource "google_project" "project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "mcsd" { project = google_project.project.project_id diff --git a/mmv1/third_party/terraform/services/gkehub2/go/resource_gke_hub_feature_test.go.tmpl b/mmv1/third_party/terraform/services/gkehub2/go/resource_gke_hub_feature_test.go.tmpl index 32afc2869eb2..cb2517c469f4 100644 --- a/mmv1/third_party/terraform/services/gkehub2/go/resource_gke_hub_feature_test.go.tmpl +++ b/mmv1/third_party/terraform/services/gkehub2/go/resource_gke_hub_feature_test.go.tmpl @@ -148,6 +148,7 @@ resource "google_project" "project" { org_id = "%{org_id}" billing_account = "%{billing_account}" provider = google-beta + deletion_policy = "DELETE" } resource "google_project_service" "mesh" { @@ -901,6 +902,7 @@ resource "google_project" "project" { project_id = "tf-test-gkehub%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "mesh" { @@ -956,6 +958,7 @@ resource "google_project" "project_2" { project_id = "tf-test-gkehub%{random_suffix}-2" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "compute_2" { diff --git a/mmv1/third_party/terraform/services/gkehub2/go/resource_gke_hub_fleet_test.go.tmpl b/mmv1/third_party/terraform/services/gkehub2/go/resource_gke_hub_fleet_test.go.tmpl index 4ccbfabfa3e5..7fb8d5170a94 100644 --- a/mmv1/third_party/terraform/services/gkehub2/go/resource_gke_hub_fleet_test.go.tmpl +++ b/mmv1/third_party/terraform/services/gkehub2/go/resource_gke_hub_fleet_test.go.tmpl @@ -118,6 +118,7 @@ resource "google_project" "project" { project_id = "tf-test-gkehub%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "gkehub" { diff --git a/mmv1/third_party/terraform/services/gkehub2/iam_gke_hub_feature_test.go.erb b/mmv1/third_party/terraform/services/gkehub2/iam_gke_hub_feature_test.go.erb index 852db173bfa0..1df8bc08690b 100644 --- a/mmv1/third_party/terraform/services/gkehub2/iam_gke_hub_feature_test.go.erb +++ b/mmv1/third_party/terraform/services/gkehub2/iam_gke_hub_feature_test.go.erb @@ -129,6 +129,7 @@ resource "google_project" "project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "mcsd" { project = google_project.project.project_id @@ -165,6 +166,7 @@ resource "google_project" "project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "mcsd" { project = google_project.project.project_id @@ -214,6 +216,7 @@ resource "google_project" "project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "mcsd" { project = google_project.project.project_id @@ -251,6 +254,7 @@ resource "google_project" "project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "mcsd" { project = google_project.project.project_id @@ -287,6 +291,7 @@ resource "google_project" "project" { project_id = "%{project_id}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "mcsd" { project = google_project.project.project_id diff --git a/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_feature_test.go.erb b/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_feature_test.go.erb index 2b3979fb2126..15e61cb7bd47 100644 --- a/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_feature_test.go.erb +++ b/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_feature_test.go.erb @@ -149,6 +149,7 @@ resource "google_project" "project" { org_id = "%{org_id}" billing_account = "%{billing_account}" provider = google-beta + deletion_policy = "DELETE" } resource "google_project_service" "mesh" { @@ -985,6 +986,7 @@ resource "google_project" "project" { project_id = "tf-test-gkehub%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "mesh" { @@ -1040,6 +1042,7 @@ resource "google_project" "project_2" { project_id = "tf-test-gkehub%{random_suffix}-2" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "compute_2" { diff --git a/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_fleet_test.go.erb b/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_fleet_test.go.erb index e41d8f8ce17d..b7f823017e3f 100755 --- a/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_fleet_test.go.erb +++ b/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_fleet_test.go.erb @@ -119,6 +119,7 @@ resource "google_project" "project" { project_id = "tf-test-gkehub%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "gkehub" { diff --git a/mmv1/third_party/terraform/services/iam2/go/resource_iam_deny_policy_test.go b/mmv1/third_party/terraform/services/iam2/go/resource_iam_deny_policy_test.go index 6bf0e6d54ba8..3725784c4660 100644 --- a/mmv1/third_party/terraform/services/iam2/go/resource_iam_deny_policy_test.go +++ b/mmv1/third_party/terraform/services/iam2/go/resource_iam_deny_policy_test.go @@ -76,7 +76,7 @@ func TestAccIAM2DenyPolicy_iamDenyPolicyFolderParent(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"name", "parent"}, }, - { + { Config: testAccIAM2DenyPolicy_iamDenyPolicyFolderUpdate(context), }, { @@ -96,6 +96,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_iam_deny_policy" "example" { @@ -142,6 +143,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_iam_deny_policy" "example" { @@ -193,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) } @@ -215,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/mmv1/third_party/terraform/services/iam2/resource_iam_access_boundary_policy_test.go b/mmv1/third_party/terraform/services/iam2/resource_iam_access_boundary_policy_test.go index c6c302303e6b..916dbf0ca439 100644 --- a/mmv1/third_party/terraform/services/iam2/resource_iam_access_boundary_policy_test.go +++ b/mmv1/third_party/terraform/services/iam2/resource_iam_access_boundary_policy_test.go @@ -75,6 +75,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_access_context_manager_access_level" "test-access" { @@ -129,6 +130,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_access_context_manager_access_level" "test-access" { diff --git a/mmv1/third_party/terraform/services/iam2/resource_iam_deny_policy_test.go.erb b/mmv1/third_party/terraform/services/iam2/resource_iam_deny_policy_test.go.erb index db090a8cee0b..921c454c7166 100644 --- a/mmv1/third_party/terraform/services/iam2/resource_iam_deny_policy_test.go.erb +++ b/mmv1/third_party/terraform/services/iam2/resource_iam_deny_policy_test.go.erb @@ -97,6 +97,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_iam_deny_policy" "example" { @@ -143,6 +144,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_iam_deny_policy" "example" { @@ -194,6 +196,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) } @@ -216,6 +219,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/mmv1/third_party/terraform/services/iap/data_source_iap_client_test.go b/mmv1/third_party/terraform/services/iap/data_source_iap_client_test.go index d1d8d2019c64..0442f018d845 100644 --- a/mmv1/third_party/terraform/services/iap/data_source_iap_client_test.go +++ b/mmv1/third_party/terraform/services/iap/data_source_iap_client_test.go @@ -43,6 +43,7 @@ resource "google_project" "project" { project_id = "tf-test%{random_suffix}" name = "tf-test%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" } resource "google_project_service" "project_service" { diff --git a/mmv1/third_party/terraform/services/iap/resource_iap_brand_test.go b/mmv1/third_party/terraform/services/iap/resource_iap_brand_test.go index cada2c783e32..a9fc2d73eea1 100644 --- a/mmv1/third_party/terraform/services/iap/resource_iap_brand_test.go +++ b/mmv1/third_party/terraform/services/iap/resource_iap_brand_test.go @@ -40,6 +40,7 @@ resource "google_project" "project" { project_id = "tf-test%{random_suffix}" name = "tf-test%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" } resource "google_project_service" "project_service" { diff --git a/mmv1/third_party/terraform/services/identityplatform/resource_identity_platform_config_test.go b/mmv1/third_party/terraform/services/identityplatform/resource_identity_platform_config_test.go index f17719ca72ef..3b7ddf95bffe 100644 --- a/mmv1/third_party/terraform/services/identityplatform/resource_identity_platform_config_test.go +++ b/mmv1/third_party/terraform/services/identityplatform/resource_identity_platform_config_test.go @@ -54,6 +54,7 @@ resource "google_project" "basic" { name = "tf-test-my-project%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_acct}" + deletion_policy = "DELETE" labels = { firebase = "enabled" } @@ -132,6 +133,7 @@ resource "google_project" "basic" { name = "tf-test-my-project%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_acct}" + deletion_policy = "DELETE" labels = { firebase = "enabled" } diff --git a/mmv1/third_party/terraform/services/integrationconnectors/resource_integration_connectors_managed_zone_test.go b/mmv1/third_party/terraform/services/integrationconnectors/resource_integration_connectors_managed_zone_test.go index dbdeb07868e8..0dd089a68647 100644 --- a/mmv1/third_party/terraform/services/integrationconnectors/resource_integration_connectors_managed_zone_test.go +++ b/mmv1/third_party/terraform/services/integrationconnectors/resource_integration_connectors_managed_zone_test.go @@ -53,6 +53,7 @@ resource "google_project" "target_project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_iam_member" "dns_peer_binding" { @@ -115,6 +116,7 @@ resource "google_project" "target_project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_iam_member" "dns_peer_binding" { diff --git a/mmv1/third_party/terraform/services/integrations/resource_integrations_auth_config_test.go b/mmv1/third_party/terraform/services/integrations/resource_integrations_auth_config_test.go index 387935e5751e..e6cf21ec0bde 100644 --- a/mmv1/third_party/terraform/services/integrations/resource_integrations_auth_config_test.go +++ b/mmv1/third_party/terraform/services/integrations/resource_integrations_auth_config_test.go @@ -46,7 +46,7 @@ func testAccIntegrationsAuthConfig_full(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_integrations_client" "client" { location = "southamerica-west1" - provision_gmek = true + create_sample_integrations = true } resource "google_integrations_auth_config" "update_example" { @@ -72,7 +72,7 @@ func testAccIntegrationsAuthConfig_update(context map[string]interface{}) string return acctest.Nprintf(` resource "google_integrations_client" "client" { location = "southamerica-west1" - provision_gmek = true + create_sample_integrations = true } resource "google_integrations_auth_config" "update_example" { diff --git a/mmv1/third_party/terraform/services/kms/data_source_google_kms_secret_asymmetric_test.go.erb b/mmv1/third_party/terraform/services/kms/data_source_google_kms_secret_asymmetric_test.go.erb index fec62d1eb443..7b51456cbeda 100644 --- a/mmv1/third_party/terraform/services/kms/data_source_google_kms_secret_asymmetric_test.go.erb +++ b/mmv1/third_party/terraform/services/kms/data_source_google_kms_secret_asymmetric_test.go.erb @@ -128,6 +128,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { diff --git a/mmv1/third_party/terraform/services/kms/go/data_source_google_kms_secret_asymmetric_test.go.tmpl b/mmv1/third_party/terraform/services/kms/go/data_source_google_kms_secret_asymmetric_test.go.tmpl index a9141acc64c2..7eb1400649ef 100644 --- a/mmv1/third_party/terraform/services/kms/go/data_source_google_kms_secret_asymmetric_test.go.tmpl +++ b/mmv1/third_party/terraform/services/kms/go/data_source_google_kms_secret_asymmetric_test.go.tmpl @@ -127,6 +127,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { diff --git a/mmv1/third_party/terraform/services/kms/go/iam_kms_crypto_key_test.go.tmpl b/mmv1/third_party/terraform/services/kms/go/iam_kms_crypto_key_test.go.tmpl index b31446773c88..fd76fe6db428 100644 --- a/mmv1/third_party/terraform/services/kms/go/iam_kms_crypto_key_test.go.tmpl +++ b/mmv1/third_party/terraform/services/kms/go/iam_kms_crypto_key_test.go.tmpl @@ -369,6 +369,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -413,6 +414,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -467,6 +469,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -517,6 +520,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -562,6 +566,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -612,6 +617,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -667,6 +673,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { diff --git a/mmv1/third_party/terraform/services/kms/go/iam_kms_key_ring_test.go.tmpl b/mmv1/third_party/terraform/services/kms/go/iam_kms_key_ring_test.go.tmpl index ce234d262722..7f0d609c63f1 100644 --- a/mmv1/third_party/terraform/services/kms/go/iam_kms_key_ring_test.go.tmpl +++ b/mmv1/third_party/terraform/services/kms/go/iam_kms_key_ring_test.go.tmpl @@ -282,6 +282,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -321,6 +322,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -370,6 +372,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -415,6 +418,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -455,6 +459,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -500,6 +505,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -547,6 +553,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { diff --git a/mmv1/third_party/terraform/services/kms/iam_kms_crypto_key_test.go.erb b/mmv1/third_party/terraform/services/kms/iam_kms_crypto_key_test.go.erb index 3129c52301c7..0afa1af185ac 100644 --- a/mmv1/third_party/terraform/services/kms/iam_kms_crypto_key_test.go.erb +++ b/mmv1/third_party/terraform/services/kms/iam_kms_crypto_key_test.go.erb @@ -370,6 +370,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -414,6 +415,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -468,6 +470,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -518,6 +521,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -563,6 +567,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -613,6 +618,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -668,6 +674,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { diff --git a/mmv1/third_party/terraform/services/kms/iam_kms_key_ring_test.go.erb b/mmv1/third_party/terraform/services/kms/iam_kms_key_ring_test.go.erb index 00b836b67488..19eb5d77f374 100644 --- a/mmv1/third_party/terraform/services/kms/iam_kms_key_ring_test.go.erb +++ b/mmv1/third_party/terraform/services/kms/iam_kms_key_ring_test.go.erb @@ -283,6 +283,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -322,6 +323,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -371,6 +373,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -416,6 +419,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -456,6 +460,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -501,6 +506,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { @@ -548,6 +554,7 @@ resource "google_project" "test_project" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "kms" { diff --git a/mmv1/third_party/terraform/services/kms/resource_kms_crypto_key_test.go.erb b/mmv1/third_party/terraform/services/kms/resource_kms_crypto_key_test.go.erb index 4af4569dcdf4..f1b7a60eee3d 100644 --- a/mmv1/third_party/terraform/services/kms/resource_kms_crypto_key_test.go.erb +++ b/mmv1/third_party/terraform/services/kms/resource_kms_crypto_key_test.go.erb @@ -676,6 +676,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -706,6 +707,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -734,6 +736,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -761,6 +764,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -793,6 +797,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -842,6 +847,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -875,6 +881,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -912,6 +919,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -944,6 +952,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -978,6 +987,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -1016,6 +1026,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -1046,6 +1057,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -1080,6 +1092,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -1118,6 +1131,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -1156,6 +1170,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { diff --git a/mmv1/third_party/terraform/services/kms/resource_kms_key_ring_test.go b/mmv1/third_party/terraform/services/kms/resource_kms_key_ring_test.go index 053b10d7e6dc..35f3b31e7a33 100644 --- a/mmv1/third_party/terraform/services/kms/resource_kms_key_ring_test.go +++ b/mmv1/third_party/terraform/services/kms/resource_kms_key_ring_test.go @@ -62,6 +62,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -84,6 +85,7 @@ resource "google_project" "acceptance" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { diff --git a/mmv1/third_party/terraform/services/logging/data_source_google_logging_folder_settings_test.go b/mmv1/third_party/terraform/services/logging/data_source_google_logging_folder_settings_test.go index d56c11e3ceaa..96443cbc4c69 100644 --- a/mmv1/third_party/terraform/services/logging/data_source_google_logging_folder_settings_test.go +++ b/mmv1/third_party/terraform/services/logging/data_source_google_logging_folder_settings_test.go @@ -37,6 +37,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/mmv1/third_party/terraform/services/logging/data_source_google_logging_project_cmek_settings_test.go b/mmv1/third_party/terraform/services/logging/data_source_google_logging_project_cmek_settings_test.go index ddf6f770a40e..96a2d98a4cc7 100644 --- a/mmv1/third_party/terraform/services/logging/data_source_google_logging_project_cmek_settings_test.go +++ b/mmv1/third_party/terraform/services/logging/data_source_google_logging_project_cmek_settings_test.go @@ -44,6 +44,7 @@ resource "google_project" "default" { name = "%{project_name}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "logging_service" { diff --git a/mmv1/third_party/terraform/services/logging/data_source_google_logging_project_settings_test.go b/mmv1/third_party/terraform/services/logging/data_source_google_logging_project_settings_test.go index c962da0de36b..dc41e8468a77 100644 --- a/mmv1/third_party/terraform/services/logging/data_source_google_logging_project_settings_test.go +++ b/mmv1/third_party/terraform/services/logging/data_source_google_logging_project_settings_test.go @@ -40,6 +40,7 @@ func testAccLoggingProjectSettings_datasource(context map[string]interface{}) st name = "%{project_name}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "logging_service" { diff --git a/mmv1/third_party/terraform/services/logging/resource_logging_bucket_config_test.go b/mmv1/third_party/terraform/services/logging/resource_logging_bucket_config_test.go index 753e8333ff4c..b5e88111e424 100644 --- a/mmv1/third_party/terraform/services/logging/resource_logging_bucket_config_test.go +++ b/mmv1/third_party/terraform/services/logging/resource_logging_bucket_config_test.go @@ -256,6 +256,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" { @@ -275,6 +276,7 @@ resource "google_project" "default" { name = "%{project_name}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_logging_project_bucket_config" "basic" { @@ -294,6 +296,7 @@ resource "google_project" "default" { name = "%{project_name}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } // time_sleep would allow for permissions to be granted before creating log bucket @@ -323,6 +326,7 @@ resource "google_project" "default" { name = "%{project_name}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_logging_project_bucket_config" "fixed_locked" { @@ -349,6 +353,7 @@ resource "google_project" "default" { name = "%{project_name}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "logging_service" { @@ -503,6 +508,7 @@ func getLoggingBucketConfigs(context map[string]interface{}) map[string]string { name = "%{project_name}" org_id = "%{org_id}" billing_account = "%{billing_account_name}" + deletion_policy = "DELETE" } resource "google_logging_project_bucket_config" "basic" { @@ -621,6 +627,7 @@ resource "google_project" "default" { name = "%{project_name}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_logging_project_bucket_config" "basic" { diff --git a/mmv1/third_party/terraform/services/logging/resource_logging_folder_exclusion_test.go b/mmv1/third_party/terraform/services/logging/resource_logging_folder_exclusion_test.go index 34af9a5cfaf4..51a8a35058d5 100644 --- a/mmv1/third_party/terraform/services/logging/resource_logging_folder_exclusion_test.go +++ b/mmv1/third_party/terraform/services/logging/resource_logging_folder_exclusion_test.go @@ -237,6 +237,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) } @@ -253,6 +254,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) } @@ -262,6 +264,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/mmv1/third_party/terraform/services/logging/resource_logging_folder_settings_test.go b/mmv1/third_party/terraform/services/logging/resource_logging_folder_settings_test.go index 39128f267562..2acc95492791 100644 --- a/mmv1/third_party/terraform/services/logging/resource_logging_folder_settings_test.go +++ b/mmv1/third_party/terraform/services/logging/resource_logging_folder_settings_test.go @@ -58,6 +58,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" { @@ -81,6 +82,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/mmv1/third_party/terraform/services/logging/resource_logging_folder_sink_test.go b/mmv1/third_party/terraform/services/logging/resource_logging_folder_sink_test.go index 72e20a264f0d..1c82b4f80abf 100644 --- a/mmv1/third_party/terraform/services/logging/resource_logging_folder_sink_test.go +++ b/mmv1/third_party/terraform/services/logging/resource_logging_folder_sink_test.go @@ -400,6 +400,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) } @@ -423,6 +424,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) } @@ -446,6 +448,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) } @@ -466,8 +469,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) } @@ -489,6 +493,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) } @@ -519,6 +524,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) } @@ -545,6 +551,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) } @@ -566,6 +573,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) } @@ -583,6 +591,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/mmv1/third_party/terraform/services/logging/resource_logging_project_sink_test.go b/mmv1/third_party/terraform/services/logging/resource_logging_project_sink_test.go index b6482366c698..cb3274ce5a70 100644 --- a/mmv1/third_party/terraform/services/logging/resource_logging_project_sink_test.go +++ b/mmv1/third_party/terraform/services/logging/resource_logging_project_sink_test.go @@ -376,7 +376,8 @@ resource "google_project" "project" { project_id = "%s" name = "%s" org_id = "%s" - billing_account = "%s" + billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "logging_service" { @@ -517,6 +518,7 @@ resource "google_project" "destination-project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_logging_project_bucket_config" "destination-bucket" { @@ -579,6 +581,7 @@ resource "google_project" "destination-project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_logging_project_bucket_config" "destination-bucket" { diff --git a/mmv1/third_party/terraform/services/monitoring/resource_monitoring_monitored_project_test.go b/mmv1/third_party/terraform/services/monitoring/resource_monitoring_monitored_project_test.go index 1b216489bf18..15f9d8183d54 100644 --- a/mmv1/third_party/terraform/services/monitoring/resource_monitoring_monitored_project_test.go +++ b/mmv1/third_party/terraform/services/monitoring/resource_monitoring_monitored_project_test.go @@ -76,6 +76,7 @@ resource "google_project" "basic" { project_id = "tf-test-m-id%{random_suffix}" name = "tf-test-m-id%{random_suffix}-display" org_id = "%{org_id}" + deletion_policy = "DELETE" } `, context) } @@ -91,6 +92,7 @@ resource "google_project" "basic" { project_id = "tf-test-m-id%{random_suffix}" name = "tf-test-m-id%{random_suffix}-display" org_id = "%{org_id}" + deletion_policy = "DELETE" } `, context) } diff --git a/mmv1/third_party/terraform/services/networksecurity/resource_network_security_client_tls_policy_test.go.erb b/mmv1/third_party/terraform/services/networksecurity/resource_network_security_client_tls_policy_test.go.erb index 3d2c080bc1c2..cf3799f5460a 100644 --- a/mmv1/third_party/terraform/services/networksecurity/resource_network_security_client_tls_policy_test.go.erb +++ b/mmv1/third_party/terraform/services/networksecurity/resource_network_security_client_tls_policy_test.go.erb @@ -11,6 +11,7 @@ import ( ) func TestAccNetworkSecurityClientTlsPolicy_update(t *testing.T) { + acctest.SkipIfVcr(t) t.Parallel() clientTlsPolicyName := fmt.Sprintf("tf-test-client-tls-policy-%s", acctest.RandString(t, 10)) diff --git a/mmv1/third_party/terraform/services/orgpolicy/resource_org_policy_policy_test.go b/mmv1/third_party/terraform/services/orgpolicy/resource_org_policy_policy_test.go index adfa8d105ef5..f4cb03f24fde 100644 --- a/mmv1/third_party/terraform/services/orgpolicy/resource_org_policy_policy_test.go +++ b/mmv1/third_party/terraform/services/orgpolicy/resource_org_policy_policy_test.go @@ -184,6 +184,7 @@ resource "google_project" "basic" { project_id = "tf-test-id%{random_suffix}" name = "tf-test-id%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" } @@ -208,6 +209,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 } @@ -245,6 +247,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 } @@ -336,6 +339,7 @@ resource "google_project" "basic" { project_id = "tf-test-id%{random_suffix}" name = "tf-test-id%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" } @@ -373,6 +377,7 @@ resource "google_project" "basic" { project_id = "tf-test-id%{random_suffix}" name = "tf-test-id%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" } diff --git a/mmv1/third_party/terraform/services/oslogin/resource_os_login_ssh_public_key_test.go b/mmv1/third_party/terraform/services/oslogin/resource_os_login_ssh_public_key_test.go index c57b782b47ba..b83dd0628ebd 100644 --- a/mmv1/third_party/terraform/services/oslogin/resource_os_login_ssh_public_key_test.go +++ b/mmv1/third_party/terraform/services/oslogin/resource_os_login_ssh_public_key_test.go @@ -47,6 +47,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "compute" { project = google_project.project.project_id diff --git a/mmv1/third_party/terraform/services/pubsub/resource_pubsub_topic_test.go b/mmv1/third_party/terraform/services/pubsub/resource_pubsub_topic_test.go index b779cda9a5bb..9cce95d53b27 100644 --- a/mmv1/third_party/terraform/services/pubsub/resource_pubsub_topic_test.go +++ b/mmv1/third_party/terraform/services/pubsub/resource_pubsub_topic_test.go @@ -93,6 +93,9 @@ func TestAccPubsubTopic_schema(t *testing.T) { { Config: testAccPubsubTopic_updateWithNewSchema(topic, schema2), }, + { + Config: testAccPubsubTopic_updateWithNewSchema(topic, ""), + }, { ResourceName: "google_pubsub_topic.bar", ImportStateId: topic, @@ -228,7 +231,8 @@ resource "google_pubsub_topic" "bar" { } func testAccPubsubTopic_updateWithNewSchema(topic, schema string) string { - return fmt.Sprintf(` + if schema != "" { + return fmt.Sprintf(` resource "google_pubsub_schema" "foo" { name = "%s" type = "PROTOCOL_BUFFER" @@ -243,6 +247,13 @@ resource "google_pubsub_topic" "bar" { } } `, schema, topic) + } else { + return fmt.Sprintf(` + resource "google_pubsub_topic" "bar" { + name = "%s" + } + `, topic) + } } func testAccPubsubTopic_updateWithKinesisIngestionSettings(topic string) string { diff --git a/mmv1/third_party/terraform/services/redis/resource_redis_cluster_test.go.erb b/mmv1/third_party/terraform/services/redis/resource_redis_cluster_test.go.erb index effc5eb88419..682d806d5448 100644 --- a/mmv1/third_party/terraform/services/redis/resource_redis_cluster_test.go.erb +++ b/mmv1/third_party/terraform/services/redis/resource_redis_cluster_test.go.erb @@ -12,6 +12,7 @@ import ( ) func TestAccRedisCluster_createClusterWithNodeType(t *testing.T) { + t.Parallel() name := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) @@ -23,7 +24,7 @@ func TestAccRedisCluster_createClusterWithNodeType(t *testing.T) { Steps: []resource.TestStep{ { // create cluster with replica count 1 - Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 3, preventDestroy: true, nodeType: "REDIS_STANDARD_SMALL", zoneDistributionMode: "MULTI_ZONE"}), + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 3, deletionProtectionEnabled: true, nodeType: "REDIS_STANDARD_SMALL", zoneDistributionMode: "MULTI_ZONE"}), }, { ResourceName: "google_redis_cluster.test", @@ -33,7 +34,7 @@ func TestAccRedisCluster_createClusterWithNodeType(t *testing.T) { }, { // clean up the resource - Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, nodeType: "REDIS_STANDARD_SMALL", zoneDistributionMode: "MULTI_ZONE"}), + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 3, deletionProtectionEnabled: false, nodeType: "REDIS_STANDARD_SMALL", zoneDistributionMode: "MULTI_ZONE"}), }, }, }) @@ -53,7 +54,7 @@ func TestAccRedisCluster_createClusterWithZoneDistribution(t *testing.T) { Steps: []resource.TestStep{ { // create cluster with replica count 1 - Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, zoneDistributionMode: "SINGLE_ZONE", zone: "us-central1-b"}), + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 0, shardCount: 3, deletionProtectionEnabled: false, zoneDistributionMode: "SINGLE_ZONE", zone: "us-central1-b"}), }, { ResourceName: "google_redis_cluster.test", @@ -63,7 +64,7 @@ func TestAccRedisCluster_createClusterWithZoneDistribution(t *testing.T) { }, { // clean up the resource - Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, zoneDistributionMode: "SINGLE_ZONE", zone: "us-central1-b"}), + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 0, shardCount: 3, deletionProtectionEnabled: false, zoneDistributionMode: "SINGLE_ZONE", zone: "us-central1-b"}), }, }, }) @@ -82,7 +83,7 @@ func TestAccRedisCluster_updateReplicaCount(t *testing.T) { Steps: []resource.TestStep{ { // create cluster with replica count 1 - Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE"}), + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 3, deletionProtectionEnabled: true, zoneDistributionMode: "MULTI_ZONE"}), }, { ResourceName: "google_redis_cluster.test", @@ -92,7 +93,7 @@ func TestAccRedisCluster_updateReplicaCount(t *testing.T) { }, { // update replica count to 2 - Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 2, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE"}), + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 2, shardCount: 3, deletionProtectionEnabled: true, zoneDistributionMode: "MULTI_ZONE"}), }, { ResourceName: "google_redis_cluster.test", @@ -100,13 +101,9 @@ func TestAccRedisCluster_updateReplicaCount(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"psc_configs"}, }, - { - // clean up the resource - Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE"}), - }, { // update replica count to 0 - Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE"}), + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 0, shardCount: 3, deletionProtectionEnabled: true, zoneDistributionMode: "MULTI_ZONE"}), }, { ResourceName: "google_redis_cluster.test", @@ -116,7 +113,7 @@ func TestAccRedisCluster_updateReplicaCount(t *testing.T) { }, { // clean up the resource - Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 0, shardCount: 3, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE"}), + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 0, shardCount: 3, deletionProtectionEnabled: false, zoneDistributionMode: "MULTI_ZONE"}), }, }, }) @@ -135,7 +132,7 @@ func TestAccRedisCluster_updateShardCount(t *testing.T) { Steps: []resource.TestStep{ { // create cluster with shard count 3 - Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 3, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE"}), + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 3, deletionProtectionEnabled: true, zoneDistributionMode: "MULTI_ZONE"}), }, { ResourceName: "google_redis_cluster.test", @@ -145,7 +142,7 @@ func TestAccRedisCluster_updateShardCount(t *testing.T) { }, { // update shard count to 5 - Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 5, preventDestroy: true, zoneDistributionMode: "MULTI_ZONE"}), + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 5, deletionProtectionEnabled: true, zoneDistributionMode: "MULTI_ZONE"}), }, { ResourceName: "google_redis_cluster.test", @@ -155,7 +152,7 @@ func TestAccRedisCluster_updateShardCount(t *testing.T) { }, { // clean up the resource - Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 5, preventDestroy: false, zoneDistributionMode: "MULTI_ZONE"}), + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 5, deletionProtectionEnabled: false, zoneDistributionMode: "MULTI_ZONE"}), }, }, }) @@ -214,11 +211,51 @@ func TestAccRedisCluster_updateRedisConfigs(t *testing.T) { }) } +// Validate that deletion protection enabled/disabled cluster is created updated +func TestAccRedisCluster_createUpdateDeletionProtection(t *testing.T) { + t.Parallel() + + name := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + CheckDestroy: testAccCheckRedisClusterDestroyProducer(t), + Steps: []resource.TestStep{ + { + // create cluster with deletion protection set to false + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 0, shardCount: 3, deletionProtectionEnabled: false, zoneDistributionMode: "MULTI_ZONE"}), + }, + { + ResourceName: "google_redis_cluster.test", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"psc_configs"}, + }, + { + // update deletion protection to true + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 0, shardCount: 3, deletionProtectionEnabled: true, zoneDistributionMode: "MULTI_ZONE"}), + }, + { + ResourceName: "google_redis_cluster.test", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"psc_configs"}, + }, + { + // update deletion protection to false and delete the cluster + Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 0, shardCount: 3, deletionProtectionEnabled: false, zoneDistributionMode: "MULTI_ZONE"}), + }, + + }, + }) +} + type ClusterParams struct { name string replicaCount int shardCount int - preventDestroy bool + deletionProtectionEnabled bool nodeType string redisConfigs map[string]string zoneDistributionMode string @@ -226,13 +263,6 @@ type ClusterParams struct { } func createOrUpdateRedisCluster(params *ClusterParams) string { - lifecycleBlock := "" - if params.preventDestroy { - lifecycleBlock = ` - lifecycle { - prevent_destroy = true - }` - } var strBuilder strings.Builder for key, value := range params.redisConfigs { strBuilder.WriteString(fmt.Sprintf("%s = \"%s\"\n", key, value)) @@ -255,6 +285,7 @@ resource "google_redis_cluster" "test" { replica_count = %d shard_count = %d node_type = "%s" + deletion_protection_enabled = %v region = "us-central1" psc_configs { network = google_compute_network.producer_net.id @@ -264,9 +295,8 @@ resource "google_redis_cluster" "test" { } %s depends_on = [ - google_network_connectivity_service_connection_policy.default - ] - %s + google_network_connectivity_service_connection_policy.default + ] } resource "google_network_connectivity_service_connection_policy" "default" { @@ -294,7 +324,7 @@ resource "google_compute_network" "producer_net" { name = "%s" auto_create_subnetworks = false } -`, params.name, params.replicaCount, params.shardCount, params.nodeType, strBuilder.String(), zoneDistributionConfigBlock, lifecycleBlock, params.name, params.name, params.name) +`, params.name, params.replicaCount, params.shardCount, params.nodeType, params.deletionProtectionEnabled, strBuilder.String(), zoneDistributionConfigBlock, params.name, params.name, params.name) } <% end -%> diff --git a/mmv1/third_party/terraform/services/resourcemanager/data_source_google_active_folder_test.go b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_active_folder_test.go index 91f7ad0dcc24..3a65b6587f70 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/data_source_google_active_folder_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_active_folder_test.go @@ -128,6 +128,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" { @@ -142,6 +143,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/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folder.go b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folder.go index fb95137a83cc..f644f61c84c9 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folder.go +++ b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folder.go @@ -50,6 +50,10 @@ func DataSourceGoogleFolder() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "deletion_protection": { + Type: schema.TypeBool, + Computed: true, + }, }, } } @@ -71,6 +75,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/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folder_organization_policy_test.go b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folder_organization_policy_test.go index 81361f7ec30e..998a0664879b 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folder_organization_policy_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folder_organization_policy_test.go @@ -33,6 +33,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/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folder_test.go b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folder_test.go index d4501b2eded6..79ae8c9da658 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folder_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folder_test.go @@ -123,6 +123,7 @@ func testAccCheckGoogleFolder_byFullNameConfig(parent string, displayName string resource "google_folder" "foobar" { parent = "%s" display_name = "%s" + deletion_protection = false } data "google_folder" "folder" { @@ -136,6 +137,7 @@ func testAccCheckGoogleFolder_byShortNameConfig(parent string, displayName strin resource "google_folder" "foobar" { parent = "%s" display_name = "%s" + deletion_protection = false } data "google_folder" "folder" { @@ -149,6 +151,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/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folders_test.go b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folders_test.go index ae106939dbca..88e59cccd32f 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folders_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_folders_test.go @@ -40,6 +40,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/mmv1/third_party/terraform/services/resourcemanager/data_source_google_project_service_test.go b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_project_service_test.go index 47736d5ba86d..600e08064826 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/data_source_google_project_service_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_project_service_test.go @@ -36,6 +36,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "foo" { diff --git a/mmv1/third_party/terraform/services/resourcemanager/data_source_google_project_test.go b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_project_test.go index ff21d0ae1f7b..4840c2bdbf53 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/data_source_google_project_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/data_source_google_project_test.go @@ -42,6 +42,7 @@ resource "google_project" "project" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" labels = { my-label = "my-label-value" } diff --git a/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_iam_binding_test.go b/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_iam_binding_test.go index 9bf777f00060..c0a89bace550 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_iam_binding_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_iam_binding_test.go @@ -3,9 +3,10 @@ package resourcemanager_test import ( "fmt" "regexp" + "testing" + "github.com/hashicorp/terraform-provider-google/google/acctest" "github.com/hashicorp/terraform-provider-google/google/envvar" - "testing" "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) @@ -266,7 +267,7 @@ func TestAccProjectIamBinding_invalidMembers(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), Steps: []resource.TestStep{ { - Config: testAccProjectAssociateBindingBasic(pid, org, role, "admin@hashicorptest.com"), + Config: testAccProjectAssociateBindingBasic(pid, org, role, "admin@hashicorptest.com"), ExpectError: regexp.MustCompile("invalid value for members\\.0 \\(IAM members must have one of the values outlined here: https://cloud.google.com/billing/docs/reference/rest/v1/Policy#Binding\\)"), }, { @@ -282,6 +283,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "acceptance" { @@ -298,6 +300,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "acceptance" { @@ -320,6 +323,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "acceptance" { @@ -336,6 +340,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "acceptance" { @@ -352,6 +357,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "acceptance" { @@ -368,6 +374,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "acceptance" { diff --git a/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_iam_member_test.go b/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_iam_member_test.go index e201bb1207c9..019e75c5029c 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_iam_member_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_iam_member_test.go @@ -3,9 +3,10 @@ package resourcemanager_test import ( "fmt" "regexp" + "testing" + "github.com/hashicorp/terraform-provider-google/google/acctest" "github.com/hashicorp/terraform-provider-google/google/envvar" - "testing" "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) @@ -182,7 +183,7 @@ func TestAccProjectIamMember_invalidMembers(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), Steps: []resource.TestStep{ { - Config: testAccProjectAssociateMemberBasic(pid, org, role, "admin@hashicorptest.com"), + Config: testAccProjectAssociateMemberBasic(pid, org, role, "admin@hashicorptest.com"), ExpectError: regexp.MustCompile("invalid value for member \\(IAM members must have one of the values outlined here: https://cloud.google.com/billing/docs/reference/rest/v1/Policy#Binding\\)"), }, { @@ -198,6 +199,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_member" "acceptance" { @@ -214,6 +216,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_member" "acceptance" { @@ -236,6 +239,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_member" "acceptance" { diff --git a/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_iam_policy_test.go b/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_iam_policy_test.go index e70c0136e6b0..9b923080d453 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_iam_policy_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_iam_policy_test.go @@ -55,7 +55,7 @@ func TestAccProjectIamPolicy_emptyMembers(t *testing.T) { org := envvar.GetTestOrgFromEnv(t) pid := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, + PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), Steps: []resource.TestStep{ { @@ -72,7 +72,7 @@ func TestAccProjectIamPolicy_expanded(t *testing.T) { org := envvar.GetTestOrgFromEnv(t) pid := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, + PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), Steps: []resource.TestStep{ { @@ -92,7 +92,7 @@ func TestAccProjectIamPolicy_basicAuditConfig(t *testing.T) { org := envvar.GetTestOrgFromEnv(t) pid := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, + PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), Steps: []resource.TestStep{ // Create a new project @@ -122,7 +122,7 @@ func TestAccProjectIamPolicy_expandedAuditConfig(t *testing.T) { org := envvar.GetTestOrgFromEnv(t) pid := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, + PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), Steps: []resource.TestStep{ { @@ -141,7 +141,7 @@ func TestAccProjectIamPolicy_withCondition(t *testing.T) { org := envvar.GetTestOrgFromEnv(t) pid := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) acctest.VcrTest(t, resource.TestCase{ - PreCheck: func() { acctest.AccTestPreCheck(t) }, + PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), Steps: []resource.TestStep{ // Create a new project @@ -176,7 +176,7 @@ func TestAccProjectIamPolicy_invalidMembers(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), Steps: []resource.TestStep{ { - Config: testAccProjectAssociatePolicyBasic(pid, org, "admin@hashicorptest.com"), + Config: testAccProjectAssociatePolicyBasic(pid, org, "admin@hashicorptest.com"), ExpectError: regexp.MustCompile("invalid value for bindings\\.1\\.members\\.0 \\(IAM members must have one of the values outlined here: https://cloud.google.com/billing/docs/reference/rest/v1/Policy#Binding\\)"), }, { @@ -264,6 +264,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_policy" "acceptance" { @@ -299,6 +300,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_policy" "acceptance" { @@ -352,6 +354,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } `, pid, pid, org) } @@ -362,6 +365,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_policy" "acceptance" { @@ -384,6 +388,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_policy" "acceptance" { @@ -415,6 +420,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_policy" "acceptance" { @@ -468,6 +474,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_policy" "acceptance" { diff --git a/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_service_test.go.tmpl b/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_service_test.go.tmpl index fd656babf6ce..57d13174696f 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_service_test.go.tmpl +++ b/mmv1/third_party/terraform/services/resourcemanager/go/resource_google_project_service_test.go.tmpl @@ -256,6 +256,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "test" { @@ -277,6 +278,7 @@ resource "google_project" "acceptance" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "test" { @@ -299,6 +301,7 @@ resource "google_project" "acceptance" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "test" { @@ -314,6 +317,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "test" { @@ -336,6 +340,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } // by passing through locals, we break the dependency chain @@ -366,6 +371,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "test" { @@ -384,6 +390,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "test" { diff --git a/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder.go b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder.go index 84688819328c..653da5651bc9 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder.go @@ -65,6 +65,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, } @@ -136,7 +142,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) } @@ -166,6 +177,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) @@ -222,6 +246,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/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_audit_config_test.go b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_audit_config_test.go index 1236dda5d310..30358b6b0a59 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_audit_config_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_audit_config_test.go @@ -277,6 +277,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" { @@ -298,6 +299,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" { @@ -327,6 +329,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" { @@ -348,6 +351,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" { @@ -375,6 +379,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" { @@ -392,6 +397,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/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_binding_test.go b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_binding_test.go index 0bf14757725a..947d48010f30 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_binding_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_binding_test.go @@ -293,6 +293,7 @@ func testAccFolderIamBasic(org, fname string) string { resource "google_folder" "acceptance" { parent = "organizations/%s" display_name = "%s" + deletion_protection = false } `, org, fname) } @@ -302,6 +303,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" { @@ -317,6 +319,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" { @@ -338,6 +341,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" { @@ -353,6 +357,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/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_member_test.go b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_member_test.go index a331a29b908d..c9f305e81f2a 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_member_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_member_test.go @@ -127,6 +127,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" { @@ -142,6 +143,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/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_policy_test.go b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_policy_test.go index 813180660a46..23e713b85ab7 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_policy_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_iam_policy_test.go @@ -109,6 +109,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" { @@ -134,6 +135,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" { @@ -160,6 +162,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/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_organization_policy_test.go b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_organization_policy_test.go index aea0240c779a..d9e85b03060f 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_organization_policy_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_organization_policy_test.go @@ -310,6 +310,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" { @@ -329,6 +330,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" { @@ -349,6 +351,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" { @@ -369,6 +372,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" { @@ -392,6 +396,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/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_test.go b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_test.go index 120229adcf16..75f1a08ca995 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_folder_test.go @@ -42,9 +42,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"}, }, }, }) @@ -153,6 +154,7 @@ func testAccFolder_basic(folder, parent string) string { resource "google_folder" "folder1" { display_name = "%s" parent = "%s" + deletion_protection = false } `, folder, parent) } @@ -162,11 +164,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/mmv1/third_party/terraform/services/resourcemanager/resource_google_project.go b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project.go index 5d6b3b1ec90d..ca151fe79b6d 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project.go @@ -67,17 +67,10 @@ func ResourceGoogleProject() *schema.Resource { ValidateFunc: verify.ValidateProjectID(), Description: `The project ID. Changing this forces a new project to be created.`, }, - "skip_delete": { - Type: schema.TypeBool, - Deprecated: `skip_delete is deprecated and will be removed in 6.0.0. Please use deletion_policy instead. A skip_delete value of false can be changed to a deletion_policy value of DELETE and a skip_delete value of true to a deletion_policy value of ABANDON for equivalent behavior.`, - Optional: true, - Computed: true, - Description: `If true, the Terraform resource can be deleted without deleting the Project via the Google API.`, - }, "deletion_policy": { Type: schema.TypeString, Optional: true, - Default: "DELETE", + Default: "PREVENT", Description: `The deletion policy for the Project. Setting PREVENT will protect the project against any destroy actions caused by a terraform apply or terraform destroy. Setting ABANDON allows the resource to be abandoned rather than deleted. Possible values are: "PREVENT", "ABANDON", "DELETE"`, ValidateFunc: validation.StringInSlice([]string{"PREVENT", "ABANDON", "DELETE"}, false), @@ -316,7 +309,7 @@ func resourceGoogleProjectRead(d *schema.ResourceData, meta interface{}) error { } // Explicitly set client-side fields to default values if unset if _, ok := d.GetOkExists("deletion_policy"); !ok { - if err := d.Set("deletion_policy", "DELETE"); err != nil { + if err := d.Set("deletion_policy", "PREVENT"); err != nil { return fmt.Errorf("Error setting deletion_policy: %s", err) } } @@ -514,7 +507,7 @@ func resourceGoogleProjectDelete(d *schema.ResourceData, meta interface{}) error return err } deletionPolicy := d.Get("deletion_policy").(string) - // Only delete projects if skip_delete isn't set + if deletionPolicy == "PREVENT" { return fmt.Errorf("Cannot destroy project as deletion_policy is set to PREVENT.") } else if deletionPolicy == "ABANDON" { @@ -523,19 +516,16 @@ func resourceGoogleProjectDelete(d *schema.ResourceData, meta interface{}) error return nil } else { // Only delete projects if deletion_policy isn't PREVENT or ABANDON - // Only delete projects if skip_delete isn't set - if !d.Get("skip_delete").(bool) { - parts := strings.Split(d.Id(), "/") - pid := parts[len(parts)-1] - if err := transport_tpg.Retry(transport_tpg.RetryOptions{ - RetryFunc: func() error { - _, delErr := config.NewResourceManagerClient(userAgent).Projects.Delete(pid).Do() - return delErr - }, - Timeout: d.Timeout(schema.TimeoutDelete), - }); err != nil { - return transport_tpg.HandleNotFoundError(err, d, fmt.Sprintf("Project %s", pid)) - } + parts := strings.Split(d.Id(), "/") + pid := parts[len(parts)-1] + if err := transport_tpg.Retry(transport_tpg.RetryOptions{ + RetryFunc: func() error { + _, delErr := config.NewResourceManagerClient(userAgent).Projects.Delete(pid).Do() + return delErr + }, + Timeout: d.Timeout(schema.TimeoutDelete), + }); err != nil { + return transport_tpg.HandleNotFoundError(err, d, fmt.Sprintf("Project %s", pid)) } } d.SetId("") diff --git a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_default_service_accounts_test.go b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_default_service_accounts_test.go index e1136dfe96a2..acb8cd5407ca 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_default_service_accounts_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_default_service_accounts_test.go @@ -46,6 +46,7 @@ resource "google_project" "acceptance" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_default_service_accounts" "acceptance" { @@ -177,6 +178,7 @@ resource "google_project" "acceptance" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { diff --git a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_audit_config_test.go b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_audit_config_test.go index 0dca2fdbfaff..5b8dd41cf342 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_audit_config_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_audit_config_test.go @@ -307,6 +307,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_audit_config" "acceptance" { @@ -329,6 +330,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_audit_config" "acceptance" { @@ -359,6 +361,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_audit_config" "acceptance" { @@ -381,6 +384,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_audit_config" "acceptance" { @@ -409,6 +413,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_audit_config" "acceptance" { @@ -427,6 +432,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_audit_config" "acceptance" { diff --git a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_binding_test.go.erb b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_binding_test.go.erb index 6d1eba93d359..4e4e801c6eb3 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_binding_test.go.erb +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_binding_test.go.erb @@ -283,6 +283,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "acceptance" { @@ -299,6 +300,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "acceptance" { @@ -321,6 +323,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "acceptance" { @@ -337,6 +340,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "acceptance" { @@ -353,6 +357,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "acceptance" { @@ -369,6 +374,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "acceptance" { diff --git a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_member_remove_test.go b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_member_remove_test.go index 06086dacfbc0..3798b54fe940 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_member_remove_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_member_remove_test.go @@ -94,6 +94,7 @@ resource "google_project" "project" { project_id = "tf-test-%s" name = "tf-test-%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "bar" { @@ -122,6 +123,7 @@ resource "google_project" "project" { project_id = "tf-test-%s" name = "tf-test-%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "bar" { @@ -150,6 +152,7 @@ resource "google_project" "project" { project_id = "tf-test-%s" name = "tf-test-%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "bar" { @@ -178,6 +181,7 @@ resource "google_project" "project" { project_id = "tf-test-%s" name = "tf-test-%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "bar" { @@ -206,6 +210,7 @@ resource "google_project" "project" { project_id = "tf-test-%s" name = "tf-test-%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "bar" { @@ -240,6 +245,7 @@ resource "google_project" "project" { project_id = "tf-test-%s" name = "tf-test-%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_binding" "bar" { diff --git a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_member_test.go.erb b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_member_test.go.erb index d2bcdd026033..54ac175e8693 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_member_test.go.erb +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_member_test.go.erb @@ -199,6 +199,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_member" "acceptance" { @@ -215,6 +216,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_member" "acceptance" { @@ -237,6 +239,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_member" "acceptance" { diff --git a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_policy_test.go.erb b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_policy_test.go.erb index fe37c521628f..187cfc7bec72 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_policy_test.go.erb +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_iam_policy_test.go.erb @@ -265,6 +265,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_policy" "acceptance" { @@ -300,6 +301,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_policy" "acceptance" { @@ -353,6 +355,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } `, pid, pid, org) } @@ -363,6 +366,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_policy" "acceptance" { @@ -385,6 +389,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_policy" "acceptance" { @@ -416,6 +421,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_policy" "acceptance" { @@ -469,6 +475,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_iam_policy" "acceptance" { diff --git a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_service_test.go.erb b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_service_test.go.erb index a19f4245e514..b564bd4b050e 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_service_test.go.erb +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_service_test.go.erb @@ -257,6 +257,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "test" { @@ -278,6 +279,7 @@ resource "google_project" "acceptance" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "test" { @@ -300,6 +302,7 @@ resource "google_project" "acceptance" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "test" { @@ -315,6 +318,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "test" { @@ -337,6 +341,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } // by passing through locals, we break the dependency chain @@ -367,6 +372,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "test" { @@ -386,6 +392,7 @@ resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "test" { diff --git a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_test.go b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_test.go index a0fdca40d7da..e32f0db67e2c 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_google_project_test.go @@ -60,7 +60,7 @@ func TestAccProject_create(t *testing.T) { Steps: []resource.TestStep{ // This step creates a new project { - Config: testAccProject_create(pid, org), + Config: testAccProject(pid, org), Check: resource.ComposeTestCheckFunc( testAccCheckGoogleProjectExists("google_project.acceptance", pid), ), @@ -96,7 +96,7 @@ func TestAccProject_billing(t *testing.T) { ResourceName: "google_project.acceptance", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"skip_delete", "deletion_policy"}, + ImportStateVerifyIgnore: []string{"deletion_policy"}, }, // Update to a different billing account { @@ -107,7 +107,7 @@ func TestAccProject_billing(t *testing.T) { }, // Unlink the billing account { - Config: testAccProject_create(pid, org), + Config: testAccProject(pid, org), Check: resource.ComposeTestCheckFunc( testAccCheckGoogleProjectHasBillingAccount(t, "google_project.acceptance", pid, ""), ), @@ -137,7 +137,7 @@ func TestAccProject_labels(t *testing.T) { ResourceName: "google_project.acceptance", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"skip_delete", "labels", "terraform_labels", "deletion_policy"}, + ImportStateVerifyIgnore: []string{"deletion_policy", "labels", "terraform_labels"}, }, // update project with labels { @@ -149,7 +149,7 @@ func TestAccProject_labels(t *testing.T) { }, // update project delete labels { - Config: testAccProject_create(pid, org), + Config: testAccProject(pid, org), Check: resource.ComposeTestCheckFunc( testAccCheckGoogleProjectExists("google_project.acceptance", pid), testAccCheckGoogleProjectHasNoLabels(t, "google_project.acceptance", pid), @@ -210,7 +210,7 @@ func TestAccProject_migrateParent(t *testing.T) { ResourceName: "google_project.acceptance", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"skip_delete", "deletion_policy"}, + ImportStateVerifyIgnore: []string{"deletion_policy"}, }, { Config: testAccProject_migrateParentOrg(pid, folderDisplayName, org), @@ -219,7 +219,7 @@ func TestAccProject_migrateParent(t *testing.T) { ResourceName: "google_project.acceptance", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"skip_delete", "deletion_policy"}, + ImportStateVerifyIgnore: []string{"deletion_policy"}, }, { Config: testAccProject_migrateParentFolder(pid, folderDisplayName, org), @@ -228,7 +228,7 @@ func TestAccProject_migrateParent(t *testing.T) { ResourceName: "google_project.acceptance", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"skip_delete", "deletion_policy"}, + ImportStateVerifyIgnore: []string{"deletion_policy"}, }, }, }) @@ -367,7 +367,7 @@ func TestAccProject_noAllowDestroy(t *testing.T) { ResourceName: "google_project.acceptance", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"skip_delete", "deletion_policy"}, + ImportStateVerifyIgnore: []string{"deletion_policy"}, }, { Config: testAccProject_noAllowDestroy(pid, org), @@ -375,7 +375,7 @@ func TestAccProject_noAllowDestroy(t *testing.T) { ExpectError: regexp.MustCompile("deletion_policy"), }, { - Config: testAccProject_create(pid, org), + Config: testAccProject(pid, org), }, }, }) @@ -415,10 +415,22 @@ func testAccProject_createWithoutOrg(pid string) string { resource "google_project" "acceptance" { project_id = "%s" name = "%s" + deletion_policy = "DELETE" } `, pid, pid) } +func testAccProject(pid, org string) string { + return fmt.Sprintf(` +resource "google_project" "acceptance" { + project_id = "%s" + name = "%s" + org_id = "%s" + deletion_policy = "DELETE" +} +`, pid, pid, org) +} + func testAccProject_noAllowDestroy(pid, org string) string { return fmt.Sprintf(` resource "google_project" "acceptance" { @@ -448,16 +460,22 @@ resource "google_project" "acceptance" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } `, pid, pid, org, billing) } func testAccProject_labels(pid, org string, labels map[string]string) string { r := fmt.Sprintf(` +provider "google" { + add_terraform_attribution_label = false +} + resource "google_project" "acceptance" { project_id = "%s" name = "%s" org_id = "%s" + deletion_policy = "DELETE" labels = {`, pid, pid, org) l := "" @@ -476,6 +494,7 @@ resource "google_project" "acceptance" { name = "%s" org_id = "%s" billing_account = "%s" # requires billing to enable compute API + deletion_policy = "DELETE" auto_create_network = false } `, pid, pid, org, billing) @@ -486,6 +505,7 @@ func testAccProject_parentFolder(pid, folderName, org string) string { resource "google_project" "acceptance" { project_id = "%s" name = "%s" + deletion_policy = "DELETE" folder_id = google_folder.folder1.id } @@ -493,6 +513,7 @@ resource "google_project" "acceptance" { resource "google_folder" "folder1" { display_name = "%s" parent = "organizations/%s" + deletion_protection = false } `, pid, pid, folderName, org) } @@ -502,6 +523,7 @@ func testAccProject_migrateParentFolder(pid, folderName, org string) string { resource "google_project" "acceptance" { project_id = "%s" name = "%s" + deletion_policy = "DELETE" folder_id = google_folder.folder1.id } @@ -509,6 +531,7 @@ resource "google_project" "acceptance" { resource "google_folder" "folder1" { display_name = "%s" parent = "organizations/%s" + deletion_protection = false } `, pid, pid, folderName, org) } @@ -518,6 +541,7 @@ func testAccProject_migrateParentOrg(pid, folderName, org string) string { resource "google_project" "acceptance" { project_id = "%s" name = "%s" + deletion_policy = "DELETE" org_id = "%s" } @@ -525,6 +549,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/mmv1/third_party/terraform/services/resourcemanager/resource_resourcemanager_lien_test.go b/mmv1/third_party/terraform/services/resourcemanager/resource_resourcemanager_lien_test.go index 850b43bf3824..0161a7bbe89b 100644 --- a/mmv1/third_party/terraform/services/resourcemanager/resource_resourcemanager_lien_test.go +++ b/mmv1/third_party/terraform/services/resourcemanager/resource_resourcemanager_lien_test.go @@ -100,6 +100,7 @@ resource "google_project" "project" { project_id = "%s" name = "some test project" org_id = "%s" + deletion_policy = "DELETE" } resource "google_resource_manager_lien" "lien" { diff --git a/mmv1/third_party/terraform/services/secretmanager/data_source_secret_manager_secrets_test.go b/mmv1/third_party/terraform/services/secretmanager/data_source_secret_manager_secrets_test.go index 792e9bb41875..afe3300036eb 100644 --- a/mmv1/third_party/terraform/services/secretmanager/data_source_secret_manager_secrets_test.go +++ b/mmv1/third_party/terraform/services/secretmanager/data_source_secret_manager_secrets_test.go @@ -30,8 +30,11 @@ func TestAccDataSourceSecretManagerSecrets_basic(t *testing.T) { "data.google_secret_manager_secrets.foo", "google_secret_manager_secret.foo", map[string]struct{}{ - "id": {}, - "project": {}, + "id": {}, + "project": {}, + "effective_labels": {}, + "labels": {}, + "terraform_labels": {}, }, ), ), @@ -42,6 +45,10 @@ func TestAccDataSourceSecretManagerSecrets_basic(t *testing.T) { func testAccDataSourceSecretManagerSecrets_basic(context map[string]interface{}) string { return acctest.Nprintf(` +provider "google" { + add_terraform_attribution_label = false +} + resource "google_secret_manager_secret" "foo" { secret_id = "tf-test-secret-%{random_suffix}" @@ -82,8 +89,11 @@ func TestAccDataSourceSecretManagerSecrets_filter(t *testing.T) { "google_secret_manager_secret.foo", "google_secret_manager_secret.bar", map[string]struct{}{ - "id": {}, - "project": {}, + "id": {}, + "project": {}, + "effective_labels": {}, + "labels": {}, + "terraform_labels": {}, }, ), ), @@ -94,6 +104,10 @@ func TestAccDataSourceSecretManagerSecrets_filter(t *testing.T) { func testAccDataSourceSecretManagerSecrets_filter(context map[string]interface{}) string { return acctest.Nprintf(` +provider "google" { + add_terraform_attribution_label = false +} + resource "google_secret_manager_secret" "foo" { secret_id = "tf-test-secret-%{random_suffix}" diff --git a/mmv1/third_party/terraform/services/securitycenter/resource_scc_folder_custom_module_test.go b/mmv1/third_party/terraform/services/securitycenter/resource_scc_folder_custom_module_test.go index 11fd9d647aa2..08675ede43b2 100644 --- a/mmv1/third_party/terraform/services/securitycenter/resource_scc_folder_custom_module_test.go +++ b/mmv1/third_party/terraform/services/securitycenter/resource_scc_folder_custom_module_test.go @@ -70,6 +70,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" { @@ -107,6 +108,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" { @@ -149,6 +151,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/mmv1/third_party/terraform/services/securitycentermanagement/resource_scc_management_folder_security_health_analytics_custom_module_test.go b/mmv1/third_party/terraform/services/securitycentermanagement/resource_scc_management_folder_security_health_analytics_custom_module_test.go index 6dd5dd4a491e..297c0c297d6b 100644 --- a/mmv1/third_party/terraform/services/securitycentermanagement/resource_scc_management_folder_security_health_analytics_custom_module_test.go +++ b/mmv1/third_party/terraform/services/securitycentermanagement/resource_scc_management_folder_security_health_analytics_custom_module_test.go @@ -70,6 +70,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" { @@ -108,6 +109,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" { @@ -151,6 +153,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/mmv1/third_party/terraform/services/securitycenterv2/resource_scc_v2_folder_mute_config_test.go b/mmv1/third_party/terraform/services/securitycenterv2/resource_scc_v2_folder_mute_config_test.go index 6c57d31202ff..bea5fe413f36 100644 --- a/mmv1/third_party/terraform/services/securitycenterv2/resource_scc_v2_folder_mute_config_test.go +++ b/mmv1/third_party/terraform/services/securitycenterv2/resource_scc_v2_folder_mute_config_test.go @@ -55,6 +55,7 @@ func testAccSecurityCenterV2FolderMuteConfig_basic(context map[string]interface{ 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" { @@ -81,6 +82,7 @@ func testAccSecurityCenterV2FolderMuteConfig_update(context map[string]interface resource "google_folder" "folder" { parent = "organizations/%{org_id}" display_name = "tf-test-folder-name%{random_suffix}" + deletion_protection = false } resource "google_scc_v2_folder_mute_config" "default" { diff --git a/mmv1/third_party/terraform/services/servicenetworking/data_source_google_service_networking_peered_dns_domain_test.go b/mmv1/third_party/terraform/services/servicenetworking/data_source_google_service_networking_peered_dns_domain_test.go index ef1849b31545..395602ae144c 100644 --- a/mmv1/third_party/terraform/services/servicenetworking/data_source_google_service_networking_peered_dns_domain_test.go +++ b/mmv1/third_party/terraform/services/servicenetworking/data_source_google_service_networking_peered_dns_domain_test.go @@ -45,6 +45,7 @@ resource "google_project" "host" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host-compute" { diff --git a/mmv1/third_party/terraform/services/servicenetworking/resource_google_service_networking_peered_dns_domain_test.go b/mmv1/third_party/terraform/services/servicenetworking/resource_google_service_networking_peered_dns_domain_test.go index d7ba99d3a270..89489a47f8c2 100644 --- a/mmv1/third_party/terraform/services/servicenetworking/resource_google_service_networking_peered_dns_domain_test.go +++ b/mmv1/third_party/terraform/services/servicenetworking/resource_google_service_networking_peered_dns_domain_test.go @@ -36,6 +36,7 @@ resource "google_project" "host" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "host-compute" { diff --git a/mmv1/third_party/terraform/services/servicenetworking/resource_service_networking_connection_test.go b/mmv1/third_party/terraform/services/servicenetworking/resource_service_networking_connection_test.go index a91dd1643c12..20340de72a0d 100644 --- a/mmv1/third_party/terraform/services/servicenetworking/resource_service_networking_connection_test.go +++ b/mmv1/third_party/terraform/services/servicenetworking/resource_service_networking_connection_test.go @@ -186,6 +186,7 @@ resource "google_project" "project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "servicenetworking" { @@ -223,6 +224,7 @@ resource "google_project" "project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "servicenetworking" { @@ -278,6 +280,7 @@ resource "google_project" "project" { name = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_project_service" "servicenetworking" { diff --git a/mmv1/third_party/terraform/services/serviceusage/go/resource_service_usage_consumer_quota_override_test.go.tmpl b/mmv1/third_party/terraform/services/serviceusage/go/resource_service_usage_consumer_quota_override_test.go.tmpl index 22a7d1e9f0bc..7b5f732b3fc6 100644 --- a/mmv1/third_party/terraform/services/serviceusage/go/resource_service_usage_consumer_quota_override_test.go.tmpl +++ b/mmv1/third_party/terraform/services/serviceusage/go/resource_service_usage_consumer_quota_override_test.go.tmpl @@ -39,6 +39,7 @@ resource "google_project" "my_project" { name = "tf-test-project" project_id = "quota%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" } resource "google_service_usage_consumer_quota_override" "override" { diff --git a/mmv1/third_party/terraform/services/serviceusage/resource_service_usage_consumer_quota_override_test.go.erb b/mmv1/third_party/terraform/services/serviceusage/resource_service_usage_consumer_quota_override_test.go.erb index 9ee901f4a6c2..d621f922ee8b 100644 --- a/mmv1/third_party/terraform/services/serviceusage/resource_service_usage_consumer_quota_override_test.go.erb +++ b/mmv1/third_party/terraform/services/serviceusage/resource_service_usage_consumer_quota_override_test.go.erb @@ -40,6 +40,7 @@ resource "google_project" "my_project" { name = "tf-test-project" project_id = "quota%{random_suffix}" org_id = "%{org_id}" + deletion_policy = "DELETE" } resource "google_service_usage_consumer_quota_override" "override" { diff --git a/mmv1/third_party/terraform/services/sql/go/resource_sql_database_instance.go b/mmv1/third_party/terraform/services/sql/go/resource_sql_database_instance.go index 96af8245f06a..ff653c3dc739 100644 --- a/mmv1/third_party/terraform/services/sql/go/resource_sql_database_instance.go +++ b/mmv1/third_party/terraform/services/sql/go/resource_sql_database_instance.go @@ -74,7 +74,6 @@ var ( ipConfigurationKeys = []string{ "settings.0.ip_configuration.0.authorized_networks", "settings.0.ip_configuration.0.ipv4_enabled", - "settings.0.ip_configuration.0.require_ssl", "settings.0.ip_configuration.0.private_network", "settings.0.ip_configuration.0.allocated_ip_range", "settings.0.ip_configuration.0.enable_private_path_for_google_cloud_services", @@ -441,13 +440,6 @@ is set to true. Defaults to ZONAL.`, AtLeastOneOf: ipConfigurationKeys, Description: `Whether this Cloud SQL instance should be assigned a public IPV4 address. At least ipv4_enabled must be enabled or a private_network must be configured.`, }, - "require_ssl": { - Type: schema.TypeBool, - Optional: true, - AtLeastOneOf: ipConfigurationKeys, - Description: `Whether SSL connections over IP are enforced or not. To change this field, also set the corresponding value in ssl_mode if it has been set too.`, - Deprecated: "`require_ssl` will be fully deprecated in a future major release. For now, please use `ssl_mode` with a compatible `require_ssl` value instead.", - }, "private_network": { Type: schema.TypeString, Optional: true, @@ -1391,7 +1383,8 @@ func expandIpConfiguration(configured []interface{}, databaseVersion string) *sq _ipConfiguration := configured[0].(map[string]interface{}) - forceSendFields := []string{"Ipv4Enabled", "RequireSsl"} + forceSendFields := []string{"Ipv4Enabled"} + nullFields := []string{"RequireSsl"} if !strings.HasPrefix(databaseVersion, "SQLSERVER") { forceSendFields = append(forceSendFields, "EnablePrivatePathForGoogleCloudServices") @@ -1399,12 +1392,12 @@ func expandIpConfiguration(configured []interface{}, databaseVersion string) *sq return &sqladmin.IpConfiguration{ Ipv4Enabled: _ipConfiguration["ipv4_enabled"].(bool), - RequireSsl: _ipConfiguration["require_ssl"].(bool), PrivateNetwork: _ipConfiguration["private_network"].(string), AllocatedIpRange: _ipConfiguration["allocated_ip_range"].(string), AuthorizedNetworks: expandAuthorizedNetworks(_ipConfiguration["authorized_networks"].(*schema.Set).List()), EnablePrivatePathForGoogleCloudServices: _ipConfiguration["enable_private_path_for_google_cloud_services"].(bool), ForceSendFields: forceSendFields, + NullFields: nullFields, PscConfig: expandPscConfig(_ipConfiguration["psc_config"].(*schema.Set).List()), SslMode: _ipConfiguration["ssl_mode"].(string), } @@ -2243,11 +2236,11 @@ func flattenDatabaseFlags(databaseFlags []*sqladmin.DatabaseFlags) []map[string] func flattenIpConfiguration(ipConfiguration *sqladmin.IpConfiguration, d *schema.ResourceData) interface{} { data := map[string]interface{}{ - "ipv4_enabled": ipConfiguration.Ipv4Enabled, - "private_network": ipConfiguration.PrivateNetwork, - "allocated_ip_range": ipConfiguration.AllocatedIpRange, - "require_ssl": ipConfiguration.RequireSsl, + "ipv4_enabled": ipConfiguration.Ipv4Enabled, + "private_network": ipConfiguration.PrivateNetwork, + "allocated_ip_range": ipConfiguration.AllocatedIpRange, "enable_private_path_for_google_cloud_services": ipConfiguration.EnablePrivatePathForGoogleCloudServices, + "ssl_mode": ipConfiguration.SslMode, } if ipConfiguration.AuthorizedNetworks != nil { @@ -2258,11 +2251,6 @@ func flattenIpConfiguration(ipConfiguration *sqladmin.IpConfiguration, d *schema data["psc_config"] = flattenPscConfigs(ipConfiguration.PscConfig) } - // We store the ssl_mode value only if the customer already uses `ssl_mode`. - if _, ok := d.GetOk("settings.0.ip_configuration.0.ssl_mode"); ok { - data["ssl_mode"] = ipConfiguration.SslMode - } - return []map[string]interface{}{data} } diff --git a/mmv1/third_party/terraform/services/sql/resource_sql_database_instance.go.erb b/mmv1/third_party/terraform/services/sql/resource_sql_database_instance.go.erb index 40d5807d7602..ffd790b1f933 100644 --- a/mmv1/third_party/terraform/services/sql/resource_sql_database_instance.go.erb +++ b/mmv1/third_party/terraform/services/sql/resource_sql_database_instance.go.erb @@ -75,7 +75,6 @@ var ( ipConfigurationKeys = []string{ "settings.0.ip_configuration.0.authorized_networks", "settings.0.ip_configuration.0.ipv4_enabled", - "settings.0.ip_configuration.0.require_ssl", "settings.0.ip_configuration.0.private_network", "settings.0.ip_configuration.0.allocated_ip_range", "settings.0.ip_configuration.0.enable_private_path_for_google_cloud_services", @@ -1401,7 +1400,8 @@ func expandIpConfiguration(configured []interface{}, databaseVersion string) *sq _ipConfiguration := configured[0].(map[string]interface{}) - forceSendFields := []string{"Ipv4Enabled", "RequireSsl"} + forceSendFields := []string{"Ipv4Enabled"} + nullFields := []string{"RequireSsl"} if !strings.HasPrefix(databaseVersion, "SQLSERVER") { forceSendFields = append(forceSendFields, "EnablePrivatePathForGoogleCloudServices") @@ -1409,12 +1409,12 @@ func expandIpConfiguration(configured []interface{}, databaseVersion string) *sq return &sqladmin.IpConfiguration{ Ipv4Enabled: _ipConfiguration["ipv4_enabled"].(bool), - RequireSsl: _ipConfiguration["require_ssl"].(bool), PrivateNetwork: _ipConfiguration["private_network"].(string), AllocatedIpRange: _ipConfiguration["allocated_ip_range"].(string), AuthorizedNetworks: expandAuthorizedNetworks(_ipConfiguration["authorized_networks"].(*schema.Set).List()), EnablePrivatePathForGoogleCloudServices: _ipConfiguration["enable_private_path_for_google_cloud_services"].(bool), ForceSendFields: forceSendFields, + NullFields: nullFields, PscConfig: expandPscConfig(_ipConfiguration["psc_config"].(*schema.Set).List()), SslMode: _ipConfiguration["ssl_mode"].(string), ServerCaMode: _ipConfiguration["server_ca_mode"].(string), @@ -2254,11 +2254,11 @@ func flattenDatabaseFlags(databaseFlags []*sqladmin.DatabaseFlags) []map[string] func flattenIpConfiguration(ipConfiguration *sqladmin.IpConfiguration, d *schema.ResourceData) interface{} { data := map[string]interface{}{ - "ipv4_enabled": ipConfiguration.Ipv4Enabled, - "private_network": ipConfiguration.PrivateNetwork, - "allocated_ip_range": ipConfiguration.AllocatedIpRange, - "require_ssl": ipConfiguration.RequireSsl, + "ipv4_enabled": ipConfiguration.Ipv4Enabled, + "private_network": ipConfiguration.PrivateNetwork, + "allocated_ip_range": ipConfiguration.AllocatedIpRange, "enable_private_path_for_google_cloud_services": ipConfiguration.EnablePrivatePathForGoogleCloudServices, + "ssl_mode": ipConfiguration.SslMode, "server_ca_mode": ipConfiguration.ServerCaMode, } diff --git a/mmv1/third_party/terraform/services/sql/resource_sql_database_instance_test.go b/mmv1/third_party/terraform/services/sql/resource_sql_database_instance_test.go index 6190b3a1bb26..71ee6758c746 100644 --- a/mmv1/third_party/terraform/services/sql/resource_sql_database_instance_test.go +++ b/mmv1/third_party/terraform/services/sql/resource_sql_database_instance_test.go @@ -2376,9 +2376,8 @@ func TestAccSqlDatabaseInstance_updateSslOptionsForPostgreSQL(t *testing.T) { // We don't do ImportStateVerify for the ssl_mode because of the implementation. The ssl_mode is expected to be discarded if the local state doesn't have it. Steps: []resource.TestStep{ { - Config: testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName, databaseVersion, false, "ALLOW_UNENCRYPTED_AND_ENCRYPTED"), + Config: testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName, databaseVersion, "ALLOW_UNENCRYPTED_AND_ENCRYPTED"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(resourceName, "settings.0.ip_configuration.0.require_ssl", "false"), resource.TestCheckResourceAttr(resourceName, "settings.0.ip_configuration.0.ssl_mode", "ALLOW_UNENCRYPTED_AND_ENCRYPTED"), ), }, @@ -2389,9 +2388,8 @@ func TestAccSqlDatabaseInstance_updateSslOptionsForPostgreSQL(t *testing.T) { ImportStateVerifyIgnore: []string{"deletion_protection", "settings.0.ip_configuration.0.ssl_mode"}, }, { - Config: testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName, databaseVersion, false, "ENCRYPTED_ONLY"), + Config: testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName, databaseVersion, "ENCRYPTED_ONLY"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(resourceName, "settings.0.ip_configuration.0.require_ssl", "false"), resource.TestCheckResourceAttr(resourceName, "settings.0.ip_configuration.0.ssl_mode", "ENCRYPTED_ONLY"), ), }, @@ -2402,9 +2400,8 @@ func TestAccSqlDatabaseInstance_updateSslOptionsForPostgreSQL(t *testing.T) { ImportStateVerifyIgnore: []string{"deletion_protection", "settings.0.ip_configuration.0.ssl_mode"}, }, { - Config: testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName, databaseVersion, true, "TRUSTED_CLIENT_CERTIFICATE_REQUIRED"), + Config: testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName, databaseVersion, "TRUSTED_CLIENT_CERTIFICATE_REQUIRED"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(resourceName, "settings.0.ip_configuration.0.require_ssl", "true"), resource.TestCheckResourceAttr(resourceName, "settings.0.ip_configuration.0.ssl_mode", "TRUSTED_CLIENT_CERTIFICATE_REQUIRED"), ), }, @@ -2415,9 +2412,8 @@ func TestAccSqlDatabaseInstance_updateSslOptionsForPostgreSQL(t *testing.T) { ImportStateVerifyIgnore: []string{"deletion_protection", "settings.0.ip_configuration.0.ssl_mode"}, }, { - Config: testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName, databaseVersion, false, "ALLOW_UNENCRYPTED_AND_ENCRYPTED"), + Config: testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName, databaseVersion, "ALLOW_UNENCRYPTED_AND_ENCRYPTED"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(resourceName, "settings.0.ip_configuration.0.require_ssl", "false"), resource.TestCheckResourceAttr(resourceName, "settings.0.ip_configuration.0.ssl_mode", "ALLOW_UNENCRYPTED_AND_ENCRYPTED"), ), }, @@ -2457,7 +2453,7 @@ func TestAccSqlDatabaseInstance_useInternalCaByDefault(t *testing.T) { }) } -func testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName string, databaseVersion string, requireSsl bool, sslMode string) string { +func testGoogleSqlDatabaseInstance_setSslOptionsForPostgreSQL(databaseName string, databaseVersion string, sslMode string) string { return fmt.Sprintf(` resource "google_sql_database_instance" "instance" { name = "%s" @@ -2468,11 +2464,10 @@ resource "google_sql_database_instance" "instance" { tier = "db-g1-small" ip_configuration { ipv4_enabled = true - require_ssl = %t ssl_mode = "%s" } } -}`, databaseName, databaseVersion, requireSsl, sslMode) +}`, databaseName, databaseVersion, sslMode) } func testAccSqlDatabaseInstance_sqlMysqlInstancePvpExample(context map[string]interface{}) string { @@ -2556,7 +2551,7 @@ resource "google_sql_database_instance" "instance" { collation = "Polish_CI_AS" ip_configuration { ipv4_enabled = true - require_ssl = true + ssl_mode = "ENCRYPTED_ONLY" } } } @@ -3035,6 +3030,7 @@ resource "google_project" "testproject" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_sql_database_instance" "instance" { @@ -3062,6 +3058,7 @@ resource "google_project" "testproject" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_sql_database_instance" "instance" { @@ -3095,6 +3092,7 @@ resource "google_project" "testproject" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_sql_database_instance" "instance" { @@ -3128,6 +3126,7 @@ resource "google_project" "testproject" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_sql_database_instance" "instance" { @@ -3162,6 +3161,7 @@ resource "google_project" "testproject" { project_id = "%s" org_id = "%s" billing_account = "%s" + deletion_policy = "DELETE" } resource "google_sql_database_instance" "instance" { diff --git a/mmv1/third_party/terraform/services/storage/data_source_google_storage_buckets_test.go b/mmv1/third_party/terraform/services/storage/data_source_google_storage_buckets_test.go index bf999a4ad9f1..24c48a851365 100644 --- a/mmv1/third_party/terraform/services/storage/data_source_google_storage_buckets_test.go +++ b/mmv1/third_party/terraform/services/storage/data_source_google_storage_buckets_test.go @@ -70,6 +70,7 @@ resource "google_project" "acceptance" { project_id = local.project_id org_id = local.organization billing_account = local.billing_account + deletion_policy = "DELETE" } resource "google_storage_bucket" "one" { diff --git a/mmv1/third_party/terraform/services/storage/go/resource_storage_bucket_test.go b/mmv1/third_party/terraform/services/storage/go/resource_storage_bucket_test.go index d6b7177ecdf2..83f48c3aeb56 100644 --- a/mmv1/third_party/terraform/services/storage/go/resource_storage_bucket_test.go +++ b/mmv1/third_party/terraform/services/storage/go/resource_storage_bucket_test.go @@ -133,7 +133,7 @@ func TestAccStorageBucket_AutoclassDiffSupress(t *testing.T) { ImportStateVerifyIgnore: []string{"force_destroy"}, }, { - Config: testAccStorageBucket_basicWithAutoclass(bucketName,false), + Config: testAccStorageBucket_basicWithAutoclass(bucketName, false), Check: resource.ComposeTestCheckFunc( testAccCheckStorageBucketExists( t, "google_storage_bucket.bucket", bucketName, &bucket), @@ -146,7 +146,7 @@ func TestAccStorageBucket_AutoclassDiffSupress(t *testing.T) { ImportStateVerifyIgnore: []string{"force_destroy"}, }, { - Config: testAccStorageBucket_basicWithAutoclass(bucketName,true), + Config: testAccStorageBucket_basicWithAutoclass(bucketName, true), Check: resource.ComposeTestCheckFunc( testAccCheckStorageBucketExists( t, "google_storage_bucket.bucket", bucketName, &bucket), @@ -346,7 +346,7 @@ func TestAccStorageBucket_dualLocation_rpo(t *testing.T) { ImportStateVerifyIgnore: []string{"force_destroy"}, }, { - Config: testAccStorageBucket_dualLocation_rpo(bucketName,"ASYNC_TURBO"), + Config: testAccStorageBucket_dualLocation_rpo(bucketName, "ASYNC_TURBO"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr( "google_storage_bucket.bucket", "rpo", "ASYNC_TURBO"), @@ -359,7 +359,7 @@ func TestAccStorageBucket_dualLocation_rpo(t *testing.T) { ImportStateVerifyIgnore: []string{"force_destroy"}, }, { - Config: testAccStorageBucket_dualLocation_rpo(bucketName,"DEFAULT"), + Config: testAccStorageBucket_dualLocation_rpo(bucketName, "DEFAULT"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr( "google_storage_bucket.bucket", "rpo", "DEFAULT"), @@ -399,7 +399,7 @@ func TestAccStorageBucket_multiLocation_rpo(t *testing.T) { ImportStateVerifyIgnore: []string{"force_destroy"}, }, { - Config: testAccStorageBucket_multiLocation_rpo(bucketName,"DEFAULT"), + Config: testAccStorageBucket_multiLocation_rpo(bucketName, "DEFAULT"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr( "google_storage_bucket.bucket", "rpo", "DEFAULT"), @@ -1513,7 +1513,7 @@ func TestAccStorageBucket_SoftDeletePolicy(t *testing.T) { ImportStateVerifyIgnore: []string{"force_destroy"}, }, { - Config: testAccStorageBucket_SoftDeletePolicy(bucketName,7776000), + Config: testAccStorageBucket_SoftDeletePolicy(bucketName, 7776000), Check: resource.ComposeTestCheckFunc( testAccCheckStorageBucketExists( t, "google_storage_bucket.bucket", bucketName, &bucket), @@ -1528,7 +1528,7 @@ func TestAccStorageBucket_SoftDeletePolicy(t *testing.T) { ImportStateVerifyIgnore: []string{"force_destroy"}, }, { - Config: testAccStorageBucket_SoftDeletePolicy(bucketName,0), + Config: testAccStorageBucket_SoftDeletePolicy(bucketName, 0), Check: resource.ComposeTestCheckFunc( testAccCheckStorageBucketExists( t, "google_storage_bucket.bucket", bucketName, &bucket), @@ -1804,7 +1804,7 @@ resource "google_storage_bucket" "bucket" { `, bucketName) } -func testAccStorageBucket_dualLocation_rpo(bucketName string,rpo string) string { +func testAccStorageBucket_dualLocation_rpo(bucketName string, rpo string) string { return fmt.Sprintf(` resource "google_storage_bucket" "bucket" { name = "%s" @@ -1815,10 +1815,10 @@ resource "google_storage_bucket" "bucket" { } rpo = "%s" } -`, bucketName,rpo) +`, bucketName, rpo) } -func testAccStorageBucket_multiLocation_rpo(bucketName string,rpo string) string { +func testAccStorageBucket_multiLocation_rpo(bucketName string, rpo string) string { return fmt.Sprintf(` resource "google_storage_bucket" "bucket" { name = "%s" @@ -1826,7 +1826,7 @@ resource "google_storage_bucket" "bucket" { force_destroy = true rpo = "%s" } -`, bucketName,rpo) +`, bucketName, rpo) } func testAccStorageBucket_customAttributes(bucketName string) string { @@ -2447,6 +2447,7 @@ resource "google_project" "acceptance" { project_id = "tf-test-%{random_suffix}" org_id = "%{organization}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { @@ -2548,7 +2549,7 @@ resource "google_storage_bucket" "bucket" { } func testAccStorageBucket_SoftDeletePolicy(bucketName string, duration int) string { - return fmt.Sprintf(` + return fmt.Sprintf(` resource "google_storage_bucket" "bucket" { name = "%s" location = "US" diff --git a/mmv1/third_party/terraform/services/storage/resource_storage_bucket.go.erb b/mmv1/third_party/terraform/services/storage/resource_storage_bucket.go.erb index a2701c1347ed..8df5c23a81c8 100644 --- a/mmv1/third_party/terraform/services/storage/resource_storage_bucket.go.erb +++ b/mmv1/third_party/terraform/services/storage/resource_storage_bucket.go.erb @@ -48,7 +48,7 @@ func ResourceStorageBucket() *schema.Resource { Read: schema.DefaultTimeout(4 * time.Minute), }, - SchemaVersion: 2, + SchemaVersion: 3, StateUpgraders: []schema.StateUpgrader{ { Type: resourceStorageBucketV0().CoreConfigSchema().ImpliedType(), @@ -60,6 +60,11 @@ func ResourceStorageBucket() *schema.Resource { Upgrade: ResourceStorageBucketStateUpgradeV1, Version: 1, }, + { + Type: resourceStorageBucketV2().CoreConfigSchema().ImpliedType(), + Upgrade: ResourceStorageBucketStateUpgradeV2, + Version: 2, + }, }, Schema: map[string]*schema.Schema{ @@ -232,12 +237,6 @@ func ResourceStorageBucket() *schema.Resource { Optional: true, Description: `Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition.`, }, - "no_age": { - Type: schema.TypeBool, - Deprecated: "`no_age` is deprecated and will be removed in a future major release. Use `send_age_if_zero` instead.", - Optional: true, - Description: `While set true, age value will be omitted.Required to set true when age is unset in the config file.`, - }, "with_state": { Type: schema.TypeString, Computed: true, @@ -271,7 +270,6 @@ func ResourceStorageBucket() *schema.Resource { "send_age_if_zero": { Type: schema.TypeBool, Optional: true, - Default: true, Description: `While set true, age value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to the age field. It can be used alone or together with age.`, }, "send_days_since_noncurrent_time_if_zero": { @@ -1412,14 +1410,12 @@ func flattenBucketLifecycleRuleCondition(index int, d *schema.ResourceData, cond // are already present otherwise setting them to individual default values. if v, ok := d.GetOk(fmt.Sprintf("lifecycle_rule.%d.condition",index)); ok{ state_condition := v.(*schema.Set).List()[0].(map[string]interface{}) - ruleCondition["no_age"] = state_condition["no_age"].(bool) ruleCondition["send_days_since_noncurrent_time_if_zero"] = state_condition["send_days_since_noncurrent_time_if_zero"].(bool) ruleCondition["send_days_since_custom_time_if_zero"] = state_condition["send_days_since_custom_time_if_zero"].(bool) ruleCondition["send_num_newer_versions_if_zero"] = state_condition["send_num_newer_versions_if_zero"].(bool) ruleCondition["send_age_if_zero"] = state_condition["send_age_if_zero"].(bool) } else { - ruleCondition["no_age"] = false - ruleCondition["send_age_if_zero"] = true + ruleCondition["send_age_if_zero"] = false ruleCondition["send_days_since_noncurrent_time_if_zero"] = false ruleCondition["send_days_since_custom_time_if_zero"] = false ruleCondition["send_num_newer_versions_if_zero"] = false @@ -1572,15 +1568,10 @@ func expandStorageBucketLifecycleRuleCondition(v interface{}) (*storage.BucketLi condition := conditions[0].(map[string]interface{}) transformed := &storage.BucketLifecycleRuleCondition{} - // Setting high precedence of no_age over age and send_age_if_zero. - // Only sets age value when no_age is not present or no_age is present and has false value - if v, ok := condition["no_age"]; !ok || !(v.(bool)) { - if v, ok := condition["age"]; ok { - age := int64(v.(int)) - u, ok := condition["send_age_if_zero"] - if age > 0 || (ok && u.(bool)) { - transformed.Age = &age - } + if v, ok := condition["age"]; ok { + age := int64(v.(int)) + if u, ok := condition["send_age_if_zero"]; age > 0 || (ok && u.(bool)) { + transformed.Age = &age } } @@ -1691,15 +1682,8 @@ func resourceGCSBucketLifecycleRuleConditionHash(v interface{}) int { var buf bytes.Buffer m := v.(map[string]interface{}) - if v, ok := m["no_age"]; ok && v.(bool){ - buf.WriteString(fmt.Sprintf("%t-", v.(bool))) - } else { - if v, ok := m["send_age_if_zero"]; ok { - buf.WriteString(fmt.Sprintf("%t-", v.(bool))) - } - if v, ok := m["age"]; ok { - buf.WriteString(fmt.Sprintf("%d-", v.(int))) - } + if v, ok := m["age"]; ok { + buf.WriteString(fmt.Sprintf("%d-", v.(int))) } if v, ok := m["days_since_custom_time"]; ok { @@ -1743,6 +1727,10 @@ func resourceGCSBucketLifecycleRuleConditionHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%d-", v.(int))) } + if v, ok := m["send_age_if_zero"]; ok { + buf.WriteString(fmt.Sprintf("%t-", v.(bool))) + } + if v, ok := m["send_days_since_noncurrent_time_if_zero"]; ok { buf.WriteString(fmt.Sprintf("%t-", v.(bool))) } @@ -1865,8 +1853,7 @@ func setStorageBucket(d *schema.ResourceData, config *transport_tpg.Config, res if err := d.Set("autoclass", flattenBucketAutoclass(res.Autoclass)); err != nil { return fmt.Errorf("Error setting autoclass: %s", err) } - // lifecycle_rule contains terraform only variable no_age. - // Passing config("d") to flattener function to set no_age separately. + // Passing config("d") to flattener function to set virtual fields separately. if err := d.Set("lifecycle_rule", flattenBucketLifecycle(d, res.Lifecycle)); err != nil { return fmt.Errorf("Error setting lifecycle_rule: %s", err) } diff --git a/mmv1/third_party/terraform/services/storage/resource_storage_bucket_600_migration.go b/mmv1/third_party/terraform/services/storage/resource_storage_bucket_600_migration.go index f01fd66a3ce8..39ff367d6f56 100644 --- a/mmv1/third_party/terraform/services/storage/resource_storage_bucket_600_migration.go +++ b/mmv1/third_party/terraform/services/storage/resource_storage_bucket_600_migration.go @@ -527,3 +527,530 @@ func ResourceStorageBucketStateUpgradeV1(_ context.Context, rawState map[string] log.Printf("[DEBUG] Attributes after migration: %#v", rawState) return rawState, nil } + +func resourceStorageBucketV2() *schema.Resource { + return &schema.Resource{ + StateUpgraders: []schema.StateUpgrader{ + { + Type: resourceStorageBucketV0().CoreConfigSchema().ImpliedType(), + Upgrade: ResourceStorageBucketStateUpgradeV0, + Version: 0, + }, + { + Type: resourceStorageBucketV1().CoreConfigSchema().ImpliedType(), + Upgrade: ResourceStorageBucketStateUpgradeV1, + Version: 1, + }, + }, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: `The name of the bucket.`, + ValidateFunc: verify.ValidateGCSName, + }, + + "encryption": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "default_kms_key_name": { + Type: schema.TypeString, + Required: true, + Description: `A Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. You must pay attention to whether the crypto key is available in the location that this bucket is created in. See the docs for more details.`, + }, + }, + }, + Description: `The bucket's encryption configuration.`, + }, + + "requester_pays": { + Type: schema.TypeBool, + Optional: true, + Description: `Enables Requester Pays on a storage bucket.`, + }, + + "force_destroy": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: `When deleting a bucket, this boolean option will delete all contained objects. If you try to delete a bucket that contains objects, Terraform will fail that run.`, + }, + + "labels": { + Type: schema.TypeMap, + ValidateFunc: labelKeyValidator, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: `A set of key/value label pairs to assign to the bucket.`, + }, + + "terraform_labels": { + Type: schema.TypeMap, + Computed: true, + Description: `The combination of labels configured directly on the resource and default labels configured on the provider.`, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + + "effective_labels": { + Type: schema.TypeMap, + Computed: true, + Description: `All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.`, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + + "location": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + StateFunc: func(s interface{}) string { + return strings.ToUpper(s.(string)) + }, + Description: `The Google Cloud Storage location`, + }, + + "project": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + Description: `The ID of the project in which the resource belongs. If it is not provided, the provider project is used.`, + }, + + "project_number": { + Type: schema.TypeInt, + Computed: true, + Description: `The project number of the project in which the resource belongs.`, + }, + + "self_link": { + Type: schema.TypeString, + Computed: true, + Description: `The URI of the created resource.`, + }, + + "url": { + Type: schema.TypeString, + Computed: true, + Description: `The base URL of the bucket, in the format gs://.`, + }, + + "storage_class": { + Type: schema.TypeString, + Optional: true, + Default: "STANDARD", + Description: `The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.`, + }, + + "lifecycle_rule": { + Type: schema.TypeList, + Optional: true, + MaxItems: 100, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "action": { + Type: schema.TypeSet, + Required: true, + MinItems: 1, + MaxItems: 1, + Set: resourceGCSBucketLifecycleRuleActionHash, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Required: true, + Description: `The type of the action of this Lifecycle Rule. Supported values include: Delete, SetStorageClass and AbortIncompleteMultipartUpload.`, + }, + "storage_class": { + Type: schema.TypeString, + Optional: true, + Description: `The target Storage Class of objects affected by this Lifecycle Rule. Supported values include: MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE.`, + }, + }, + }, + Description: `The Lifecycle Rule's action configuration. A single block of this type is supported.`, + }, + "condition": { + Type: schema.TypeSet, + Required: true, + MinItems: 1, + MaxItems: 1, + Set: resourceGCSBucketLifecycleRuleConditionHash, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "age": { + Type: schema.TypeInt, + Optional: true, + Description: `Minimum age of an object in days to satisfy this condition.`, + }, + "created_before": { + Type: schema.TypeString, + Optional: true, + Description: `Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition.`, + }, + "custom_time_before": { + Type: schema.TypeString, + Optional: true, + Description: `Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition.`, + }, + "days_since_custom_time": { + Type: schema.TypeInt, + Optional: true, + Description: `Number of days elapsed since the user-specified timestamp set on an object.`, + }, + "days_since_noncurrent_time": { + Type: schema.TypeInt, + Optional: true, + Description: `Number of days elapsed since the noncurrent timestamp of an object. This + condition is relevant only for versioned objects.`, + }, + "noncurrent_time_before": { + Type: schema.TypeString, + Optional: true, + Description: `Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition.`, + }, + "no_age": { + Type: schema.TypeBool, + Deprecated: "`no_age` is deprecated and will be removed in a future major release. Use `send_age_if_zero` instead.", + Optional: true, + Description: `While set true, age value will be omitted.Required to set true when age is unset in the config file.`, + }, + "with_state": { + Type: schema.TypeString, + Computed: true, + Optional: true, + ValidateFunc: validation.StringInSlice([]string{"LIVE", "ARCHIVED", "ANY", ""}, false), + Description: `Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include: "LIVE", "ARCHIVED", "ANY".`, + }, + "matches_storage_class": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: `Storage Class of objects to satisfy this condition. Supported values include: MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, DURABLE_REDUCED_AVAILABILITY.`, + }, + "num_newer_versions": { + Type: schema.TypeInt, + Optional: true, + Description: `Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.`, + }, + "matches_prefix": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: `One or more matching name prefixes to satisfy this condition.`, + }, + "matches_suffix": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: `One or more matching name suffixes to satisfy this condition.`, + }, + "send_age_if_zero": { + Type: schema.TypeBool, + Optional: true, + Default: true, + Description: `While set true, age value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to the age field. It can be used alone or together with age.`, + }, + "send_days_since_noncurrent_time_if_zero": { + Type: schema.TypeBool, + Optional: true, + Description: `While set true, days_since_noncurrent_time value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to the days_since_noncurrent_time field. It can be used alone or together with days_since_noncurrent_time.`, + }, + "send_days_since_custom_time_if_zero": { + Type: schema.TypeBool, + Optional: true, + Description: `While set true, days_since_custom_time value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to the days_since_custom_time field. It can be used alone or together with days_since_custom_time.`, + }, + "send_num_newer_versions_if_zero": { + Type: schema.TypeBool, + Optional: true, + Description: `While set true, num_newer_versions value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to the num_newer_versions field. It can be used alone or together with num_newer_versions.`, + }, + }, + }, + Description: `The Lifecycle Rule's condition configuration.`, + }, + }, + }, + Description: `The bucket's Lifecycle Rules configuration.`, + }, + + "enable_object_retention": { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + Description: `Enables each object in the bucket to have its own retention policy, which prevents deletion until stored for a specific length of time.`, + }, + + "versioning": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Required: true, + Description: `While set to true, versioning is fully enabled for this bucket.`, + }, + }, + }, + Description: `The bucket's Versioning configuration.`, + }, + + "autoclass": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Required: true, + Description: `While set to true, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern.`, + }, + "terminal_storage_class": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: `The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Supported values include: NEARLINE, ARCHIVE.`, + }, + }, + }, + Description: `The bucket's autoclass configuration.`, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + _, n := d.GetChange(strings.TrimSuffix(k, ".#")) + if !strings.HasSuffix(k, ".#") { + return false + } + var l []interface{} + if new == "1" && old == "0" { + l = n.([]interface{}) + contents, ok := l[0].(map[string]interface{}) + if !ok { + return false + } + if contents["enabled"] == false { + return true + } + } + if new == "0" && old == "1" { + n := d.Get(strings.TrimSuffix(k, ".#")) + l = n.([]interface{}) + contents := l[0].(map[string]interface{}) + if contents["enabled"] == false { + return true + } + } + return false + }, + }, + "website": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "main_page_suffix": { + Type: schema.TypeString, + Optional: true, + AtLeastOneOf: []string{"website.0.not_found_page", "website.0.main_page_suffix"}, + Description: `Behaves as the bucket's directory index where missing objects are treated as potential directories.`, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + return old != "" && new == "" + }, + }, + "not_found_page": { + Type: schema.TypeString, + Optional: true, + AtLeastOneOf: []string{"website.0.main_page_suffix", "website.0.not_found_page"}, + Description: `The custom object to return when a requested resource is not found.`, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + return old != "" && new == "" + }, + }, + }, + }, + Description: `Configuration if the bucket acts as a website.`, + }, + + "retention_policy": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "is_locked": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: `If set to true, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.`, + }, + "retention_period": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(1, math.MaxInt32), + Description: `The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 3,155,760,000 seconds.`, + }, + }, + }, + Description: `Configuration of the bucket's data retention policy for how long objects in the bucket should be retained.`, + }, + + "cors": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "origin": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Description: `The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".`, + }, + "method": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Description: `The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".`, + }, + "response_header": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Description: `The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.`, + }, + "max_age_seconds": { + Type: schema.TypeInt, + Optional: true, + Description: `The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.`, + }, + }, + }, + Description: `The bucket's Cross-Origin Resource Sharing (CORS) configuration.`, + }, + + "default_event_based_hold": { + Type: schema.TypeBool, + Optional: true, + Description: `Whether or not to automatically apply an eventBasedHold to new objects added to the bucket.`, + }, + + "logging": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "log_bucket": { + Type: schema.TypeString, + Required: true, + Description: `The bucket that will receive log objects.`, + }, + "log_object_prefix": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: `The object prefix for log objects. If it's not provided, by default Google Cloud Storage sets this to this bucket's name.`, + }, + }, + }, + Description: `The bucket's Access & Storage Logs configuration.`, + }, + "uniform_bucket_level_access": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: `Enables uniform bucket-level access on a bucket.`, + }, + "custom_placement_config": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "data_locations": { + Type: schema.TypeSet, + Required: true, + ForceNew: true, + MaxItems: 2, + MinItems: 2, + Elem: &schema.Schema{ + Type: schema.TypeString, + StateFunc: func(s interface{}) string { + return strings.ToUpper(s.(string)) + }, + }, + Description: `The list of individual regions that comprise a dual-region bucket. See the docs for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket.`, + }, + }, + }, + Description: `The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty.`, + }, + "rpo": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: `Specifies the RPO setting of bucket. If set 'ASYNC_TURBO', The Turbo Replication will be enabled for the dual-region bucket. Value 'DEFAULT' will set RPO setting to default. Turbo Replication is only for buckets in dual-regions.See the docs for more details.`, + }, + "public_access_prevention": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: `Prevents public access to a bucket.`, + }, + "soft_delete_policy": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + Description: `The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy`, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "retention_duration_seconds": { + Type: schema.TypeInt, + Default: 604800, + Optional: true, + Description: `The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800.`, + }, + "effective_time": { + Type: schema.TypeString, + Computed: true, + Description: `Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.`, + }, + }, + }, + }, + }, + UseJSONNumber: true, + } +} + +func ResourceStorageBucketStateUpgradeV2(_ context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { + log.Printf("[DEBUG] Attributes before migration: %#v", rawState) + if rawState["lifecycle_rule"] != nil { + rawRules := rawState["lifecycle_rule"].([]interface{}) + for i, r := range rawRules { + newRule := r.(map[string]interface{}) + if newRule["condition"] != nil { + newCondition := newRule["condition"].([]interface{})[0].(map[string]interface{}) + newCondition["send_age_if_zero"] = false + newRule["condition"].([]interface{})[0] = newCondition + } + rawState["lifecycle_rule"].([]interface{})[i] = newRule + } + } + log.Printf("[DEBUG] Attributes after migration: %#v", rawState) + return rawState, nil +} diff --git a/mmv1/third_party/terraform/services/storage/resource_storage_bucket_test.go.erb b/mmv1/third_party/terraform/services/storage/resource_storage_bucket_test.go.erb index d5deb1ec6fe0..34a56d019ad1 100644 --- a/mmv1/third_party/terraform/services/storage/resource_storage_bucket_test.go.erb +++ b/mmv1/third_party/terraform/services/storage/resource_storage_bucket_test.go.erb @@ -656,14 +656,13 @@ func TestAccStorageBucket_lifecycleRulesVirtualFields(t *testing.T) { ResourceName: "google_storage_bucket.bucket", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"force_destroy", "lifecycle_rule.1.condition.0.no_age", "lifecycle_rule.1.condition.0.send_days_since_noncurrent_time_if_zero", "lifecycle_rule.2.condition.0.send_days_since_noncurrent_time_if_zero", "lifecycle_rule.1.condition.0.send_days_since_custom_time_if_zero", "lifecycle_rule.2.condition.0.send_days_since_custom_time_if_zero", "lifecycle_rule.1.condition.0.send_num_newer_versions_if_zero", "lifecycle_rule.2.condition.0.send_num_newer_versions_if_zero", "lifecycle_rule.1.condition.0.send_age_if_zero"}, + ImportStateVerifyIgnore: []string{"force_destroy", "lifecycle_rule.1.condition.0.send_days_since_noncurrent_time_if_zero", "lifecycle_rule.2.condition.0.send_days_since_noncurrent_time_if_zero", "lifecycle_rule.1.condition.0.send_days_since_custom_time_if_zero", "lifecycle_rule.2.condition.0.send_days_since_custom_time_if_zero", "lifecycle_rule.1.condition.0.send_num_newer_versions_if_zero", "lifecycle_rule.2.condition.0.send_num_newer_versions_if_zero", "lifecycle_rule.1.condition.0.send_age_if_zero", "lifecycle_rule.2.condition.0.send_age_if_zero"}, }, { Config: testAccStorageBucket_customAttributes_withLifecycleVirtualFieldsUpdate2(bucketName), Check: resource.ComposeTestCheckFunc( testAccCheckStorageBucketExists( t, "google_storage_bucket.bucket", bucketName, &bucket), - testAccCheckStorageBucketLifecycleConditionNoAge(nil, &bucket, 1), testAccCheckStorageBucketLifecycleConditionNoAge(nil, &bucket, 2), ), }, @@ -671,7 +670,7 @@ func TestAccStorageBucket_lifecycleRulesVirtualFields(t *testing.T) { ResourceName: "google_storage_bucket.bucket", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"force_destroy", "lifecycle_rule.1.condition.0.no_age", "lifecycle_rule.0.condition.0.send_days_since_noncurrent_time_if_zero", "lifecycle_rule.0.condition.0.send_days_since_custom_time_if_zero", "lifecycle_rule.0.condition.0.send_num_newer_versions_if_zero", "lifecycle_rule.0.condition.0.send_age_if_zero", "lifecycle_rule.1.condition.0.send_age_if_zero", "lifecycle_rule.2.condition.0.send_age_if_zero"}, + ImportStateVerifyIgnore: []string{"force_destroy", "lifecycle_rule.0.condition.0.send_days_since_noncurrent_time_if_zero", "lifecycle_rule.0.condition.0.send_days_since_custom_time_if_zero", "lifecycle_rule.0.condition.0.send_num_newer_versions_if_zero", "lifecycle_rule.0.condition.0.send_age_if_zero", "lifecycle_rule.1.condition.0.send_age_if_zero", "lifecycle_rule.2.condition.0.send_age_if_zero"}, }, { Config: testAccStorageBucket_customAttributes_withLifecycle1(bucketName), @@ -1869,6 +1868,7 @@ resource "google_storage_bucket" "bucket" { type = "Delete" } condition { + send_age_if_zero = true age = 0 } } @@ -1916,7 +1916,6 @@ resource "google_storage_bucket" "bucket" { } condition { age = 10 - no_age = false days_since_noncurrent_time = 0 send_days_since_noncurrent_time_if_zero = false days_since_custom_time = 0 @@ -1930,7 +1929,6 @@ resource "google_storage_bucket" "bucket" { type = "Delete" } condition { - no_age = true days_since_noncurrent_time = 0 send_days_since_noncurrent_time_if_zero = true days_since_custom_time = 0 @@ -1944,6 +1942,7 @@ resource "google_storage_bucket" "bucket" { type = "Delete" } condition { + send_age_if_zero = true send_days_since_noncurrent_time_if_zero = true send_days_since_custom_time_if_zero = true send_num_newer_versions_if_zero = true @@ -1965,7 +1964,6 @@ resource "google_storage_bucket" "bucket" { } condition { age = 10 - no_age = false days_since_noncurrent_time = 0 send_days_since_noncurrent_time_if_zero = true days_since_custom_time = 0 @@ -1980,7 +1978,6 @@ resource "google_storage_bucket" "bucket" { } condition { age = 10 - no_age = true send_age_if_zero = false custom_time_before = "2022-09-01" days_since_noncurrent_time = 0 @@ -2448,6 +2445,7 @@ resource "google_project" "acceptance" { project_id = "tf-test-%{random_suffix}" org_id = "%{organization}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { diff --git a/mmv1/third_party/terraform/services/tags/resource_tags_test.go b/mmv1/third_party/terraform/services/tags/resource_tags_test.go index ec62dd61d55d..f883b401ed7e 100644 --- a/mmv1/third_party/terraform/services/tags/resource_tags_test.go +++ b/mmv1/third_party/terraform/services/tags/resource_tags_test.go @@ -378,6 +378,7 @@ resource "google_project" "project" { project_id = "%{project_id}" name = "%{project_id}" org_id = "%{org_id}" + deletion_policy = "DELETE" } resource "google_tags_tag_key" "key" { diff --git a/mmv1/third_party/terraform/services/vertexai/resource_vertex_ai_index_endpoint_test.go b/mmv1/third_party/terraform/services/vertexai/resource_vertex_ai_index_endpoint_test.go index 358e5c66a0ef..88c514efc684 100644 --- a/mmv1/third_party/terraform/services/vertexai/resource_vertex_ai_index_endpoint_test.go +++ b/mmv1/third_party/terraform/services/vertexai/resource_vertex_ai_index_endpoint_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccVertexAIIndexEndpoint_updated(t *testing.T) { + acctest.SkipIfVcr(t) t.Parallel() context := map[string]interface{}{ diff --git a/mmv1/third_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_peering_test.go b/mmv1/third_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_peering_test.go index fff3aafbfcc8..b96b3be603ab 100644 --- a/mmv1/third_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_peering_test.go +++ b/mmv1/third_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_peering_test.go @@ -42,6 +42,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "vmwareengine" { diff --git a/mmv1/third_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_policy_test.go b/mmv1/third_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_policy_test.go index df76f5d3527a..5bf2f8114544 100644 --- a/mmv1/third_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_policy_test.go +++ b/mmv1/third_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_policy_test.go @@ -43,6 +43,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "vmwareengine" { diff --git a/mmv1/third_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_test.go b/mmv1/third_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_test.go index f59315fab11d..efe047561ac0 100644 --- a/mmv1/third_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_test.go +++ b/mmv1/third_party/terraform/services/vmwareengine/data_source_google_vmwareengine_network_test.go @@ -42,6 +42,7 @@ resource "google_project" "project" { name = "tf-test%{random_suffix}" org_id = "%{org_id}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "vmwareengine" { diff --git a/mmv1/third_party/terraform/services/vmwareengine/resource_vmwareengine_network_test.go b/mmv1/third_party/terraform/services/vmwareengine/resource_vmwareengine_network_test.go index ac26ae332845..9f966662e8d1 100644 --- a/mmv1/third_party/terraform/services/vmwareengine/resource_vmwareengine_network_test.go +++ b/mmv1/third_party/terraform/services/vmwareengine/resource_vmwareengine_network_test.go @@ -65,6 +65,7 @@ resource "google_project" "acceptance" { project_id = "tf-test-%{random_suffix}" org_id = "%{organization}" billing_account = "%{billing_account}" + deletion_policy = "DELETE" } resource "google_project_service" "acceptance" { diff --git a/mmv1/third_party/terraform/services/vpcaccess/data_source_vpc_access_connector_test.go b/mmv1/third_party/terraform/services/vpcaccess/data_source_vpc_access_connector_test.go index 020d74b154cb..35cfe319cfd2 100644 --- a/mmv1/third_party/terraform/services/vpcaccess/data_source_vpc_access_connector_test.go +++ b/mmv1/third_party/terraform/services/vpcaccess/data_source_vpc_access_connector_test.go @@ -37,9 +37,11 @@ func testAccVPCAccessConnectorDatasourceConfig(suffix string) string { return fmt.Sprintf(` resource "google_vpc_access_connector" "connector" { name = "tf-test-%s" - ip_cidr_range = "10.8.0.32/28" - network = "default" - region = "us-central1" + ip_cidr_range = "10.8.0.32/28" + network = "default" + region = "us-central1" + min_throughput = 200 + max_throughput = 300 } data "google_vpc_access_connector" "connector" { diff --git a/mmv1/third_party/terraform/services/vpcaccess/resource_vpc_access_connector_test.go b/mmv1/third_party/terraform/services/vpcaccess/resource_vpc_access_connector_test.go index 4a5f07e86340..c7ce3ac9ca7c 100644 --- a/mmv1/third_party/terraform/services/vpcaccess/resource_vpc_access_connector_test.go +++ b/mmv1/third_party/terraform/services/vpcaccess/resource_vpc_access_connector_test.go @@ -1,6 +1,7 @@ package vpcaccess_test import ( + "regexp" "testing" "github.com/hashicorp/terraform-plugin-testing/helper/resource" @@ -31,6 +32,81 @@ func TestAccVPCAccessConnector_vpcAccessConnectorThroughput(t *testing.T) { }) } +func TestAccVPCAccessConnector_vpcAccessConnectorThroughput_combiningThroughputAndInstancesFields_conflict(t *testing.T) { + // Need to skip this test as the expected failure happens before the provider interacts with APIs + // In VCR mode this test fails due to lack of cassettes + acctest.SkipIfVcr(t) + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(t, 10), + } + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + CheckDestroy: testAccCheckVPCAccessConnectorDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccVPCAccessConnector_vpcAccessConnectorThroughput_bothThroughputAndInstances(context), + // When all 4 of min_instance/max_instance and min_throughput/max_throughput fields are sent to the API + // the API ignores the throughput field values. Instead the API returns values for min and max throughput + // based on the value of min and max instances. The mismatch with the config causes a permadiff. + // Due to this we make the fields conflict with each other. + ExpectError: regexp.MustCompile("conflicts with"), + }, + }, + }) +} + +func TestAccVPCAccessConnector_vpcAccessConnectorThroughput_usingThroughputOrInstancesLimits(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(t, 10), + } + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + CheckDestroy: testAccCheckVPCAccessConnectorDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccVPCAccessConnector_vpcAccessConnectorThroughput_justThroughputFields(context), + Check: resource.ComposeTestCheckFunc( + // These fields are set by the config in this test step + resource.TestCheckResourceAttr( + "google_vpc_access_connector.connector", "min_throughput", "400"), + resource.TestCheckResourceAttr( + "google_vpc_access_connector.connector", "max_throughput", "800"), + // These fields aren't set in the config; the API sets and returns values + // based on the thoughput values provided + resource.TestCheckResourceAttr( + "google_vpc_access_connector.connector", "min_instances", "4"), + resource.TestCheckResourceAttr( + "google_vpc_access_connector.connector", "max_instances", "8"), + ), + }, + { + Config: testAccVPCAccessConnector_vpcAccessConnectorThroughput_justInstanceFields(context), + Check: resource.ComposeTestCheckFunc( + // These fields are set by the config in this test step + resource.TestCheckResourceAttr( + "google_vpc_access_connector.connector", "min_instances", "5"), + resource.TestCheckResourceAttr( + "google_vpc_access_connector.connector", "max_instances", "7"), + // These fields aren't set in the config; the API sets and returns values + // based on the instance limit values provided + resource.TestCheckResourceAttr( + "google_vpc_access_connector.connector", "min_throughput", "500"), + resource.TestCheckResourceAttr( + "google_vpc_access_connector.connector", "max_throughput", "700"), + ), + }, + }, + }) +} + func testAccVPCAccessConnector_vpcAccessConnectorThroughput(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_vpc_access_connector" "connector" { @@ -57,3 +133,86 @@ resource "google_compute_network" "custom_test" { } `, context) } + +func testAccVPCAccessConnector_vpcAccessConnectorThroughput_bothThroughputAndInstances(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_vpc_access_connector" "connector" { + name = "tf-test-vpc-con%{random_suffix}" + subnet { + name = google_compute_subnetwork.custom_test.name + } + machine_type = "e2-standard-4" + min_instances = 2 + max_instances = 3 + min_throughput = 400 + max_throughput = 1000 + region = "us-central1" +} + +resource "google_compute_subnetwork" "custom_test" { + name = "tf-test-vpc-con%{random_suffix}" + ip_cidr_range = "10.2.0.0/28" + region = "us-central1" + network = google_compute_network.custom_test.id +} + +resource "google_compute_network" "custom_test" { + name = "tf-test-vpc-con%{random_suffix}" + auto_create_subnetworks = false +} +`, context) +} + +func testAccVPCAccessConnector_vpcAccessConnectorThroughput_justInstanceFields(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_vpc_access_connector" "connector" { + name = "tf-test-vpc-con%{random_suffix}" + subnet { + name = google_compute_subnetwork.custom_test.name + } + machine_type = "e2-standard-4" + min_instances = 5 + max_instances = 7 + region = "us-central1" +} + +resource "google_compute_subnetwork" "custom_test" { + name = "tf-test-vpc-con%{random_suffix}" + ip_cidr_range = "10.2.0.0/28" + region = "us-central1" + network = google_compute_network.custom_test.id +} + +resource "google_compute_network" "custom_test" { + name = "tf-test-vpc-con%{random_suffix}" + auto_create_subnetworks = false +} +`, context) +} + +func testAccVPCAccessConnector_vpcAccessConnectorThroughput_justThroughputFields(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_vpc_access_connector" "connector" { + name = "tf-test-vpc-con%{random_suffix}" + subnet { + name = google_compute_subnetwork.custom_test.name + } + machine_type = "e2-standard-4" + min_throughput = 400 + max_throughput = 800 + region = "us-central1" +} + +resource "google_compute_subnetwork" "custom_test" { + name = "tf-test-vpc-con%{random_suffix}" + ip_cidr_range = "10.2.0.0/28" + region = "us-central1" + network = google_compute_network.custom_test.id +} + +resource "google_compute_network" "custom_test" { + name = "tf-test-vpc-con%{random_suffix}" + auto_create_subnetworks = false +} +`, context) +} diff --git a/mmv1/third_party/terraform/tpgresource/labels.go b/mmv1/third_party/terraform/tpgresource/labels.go index 147508993e81..7db1a6305e66 100644 --- a/mmv1/third_party/terraform/tpgresource/labels.go +++ b/mmv1/third_party/terraform/tpgresource/labels.go @@ -55,8 +55,9 @@ func SetDataSourceLabels(d *schema.ResourceData) error { return nil } -func SetLabelsDiff(_ context.Context, d *schema.ResourceDiff, meta interface{}) error { - raw := d.Get("labels") +// Sets the values of terraform_labels and effective_labels fields when labels field is in root level +func setLabelsFields(labelsField string, d *schema.ResourceDiff, meta interface{}, skipAttribution bool) error { + raw := d.Get(labelsField) if raw == nil { return nil } @@ -71,7 +72,7 @@ func SetLabelsDiff(_ context.Context, d *schema.ResourceDiff, meta interface{}) // If "labels" field is computed, set "terraform_labels" and "effective_labels" to computed. // https://github.com/hashicorp/terraform-provider-google/issues/16217 - if !d.GetRawPlan().GetAttr("labels").IsWhollyKnown() { + if !d.GetRawPlan().GetAttr(labelsField).IsWhollyKnown() { if err := d.SetNewComputed("terraform_labels"); err != nil { return fmt.Errorf("error setting terraform_labels to computed: %w", err) } @@ -91,7 +92,7 @@ func SetLabelsDiff(_ context.Context, d *schema.ResourceDiff, meta interface{}) } // Append optional label indicating the resource was provisioned using Terraform - if config.AddTerraformAttributionLabel { + if !skipAttribution && config.AddTerraformAttributionLabel { if el, ok := d.Get("effective_labels").(map[string]any); ok { _, hasExistingLabel := el[transport_tpg.AttributionKey] if hasExistingLabel || @@ -131,6 +132,24 @@ func SetLabelsDiff(_ context.Context, d *schema.ResourceDiff, meta interface{}) return nil } +func SetLabelsDiffWithoutAttributionLabel(_ context.Context, d *schema.ResourceDiff, meta interface{}) error { + return setLabelsFields("labels", d, meta, true) +} + +// The CustomizeDiff func to set the values of terraform_labels and effective_labels fields +// when labels field is at the root level and named "labels". +func SetLabelsDiff(_ context.Context, d *schema.ResourceDiff, meta interface{}) error { + return setLabelsFields("labels", d, meta, false) +} + +// The CustomizeDiff func to set the values of terraform_labels and effective_labels fields +// when labels field is at the root level and has a diffent name (e.g. resource_labels) than "labels" +func SetDiffForLabelsWithCustomizedName(labelsField string) func(_ context.Context, d *schema.ResourceDiff, meta interface{}) error { + return func(_ context.Context, d *schema.ResourceDiff, meta interface{}) error { + return setLabelsFields(labelsField, d, meta, false) + } +} + func SetMetadataLabelsDiff(_ context.Context, d *schema.ResourceDiff, meta interface{}) error { l := d.Get("metadata").([]interface{}) if len(l) == 0 || l[0] == nil { diff --git a/mmv1/third_party/terraform/tpgresource/utils.go b/mmv1/third_party/terraform/tpgresource/utils.go index a86a88d98a0e..2f83608ad77f 100644 --- a/mmv1/third_party/terraform/tpgresource/utils.go +++ b/mmv1/third_party/terraform/tpgresource/utils.go @@ -22,6 +22,7 @@ import ( "github.com/hashicorp/go-cty/cty" fwDiags "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "golang.org/x/exp/maps" @@ -878,3 +879,16 @@ func DefaultProviderZone(_ context.Context, diff *schema.ResourceDiff, meta inte return nil } + +// id.UniqueId() returns a timestamp + incremental hash +// This function truncates the timestamp to provide a prefix + 9 using +// YYmmdd + last 3 digits of the incremental hash +func ReducedPrefixedUniqueId(prefix string) string { + // uniqueID is timestamp + 8 digit counter (YYYYmmddHHMMSSssss + 12345678) + uniqueId := id.PrefixedUniqueId("") + // last three digits of the counter (678) + counter := uniqueId[len(uniqueId)-3:] + // YYmmdd of date + date := uniqueId[2:8] + return prefix + date + counter +} diff --git a/mmv1/third_party/terraform/website/docs/d/vpc_access_connector.html.markdown b/mmv1/third_party/terraform/website/docs/d/vpc_access_connector.html.markdown index b107af9a6a55..a44818a7a137 100644 --- a/mmv1/third_party/terraform/website/docs/d/vpc_access_connector.html.markdown +++ b/mmv1/third_party/terraform/website/docs/d/vpc_access_connector.html.markdown @@ -26,6 +26,8 @@ resource "google_vpc_access_connector" "connector" { ip_cidr_range = "10.8.0.0/28" network = "default" region = "us-central1" + min_instances = 2 + max_instances = 3 } ``` diff --git a/mmv1/third_party/terraform/website/docs/guides/provider_reference.html.markdown b/mmv1/third_party/terraform/website/docs/guides/provider_reference.html.markdown index 8b03ef435035..9adb671d0aeb 100644 --- a/mmv1/third_party/terraform/website/docs/guides/provider_reference.html.markdown +++ b/mmv1/third_party/terraform/website/docs/guides/provider_reference.html.markdown @@ -277,8 +277,9 @@ automatically to resources, and will be returned in the `terraform_labels` and `effective_labels` fields. This makes it possible to distinguish Terraform resources when using other tools like Cloud Console or gcloud. -The default value is `false`. No label will be added unless the provider is -explicitly configured to do so by setting the value to `true`. +The default value is `true`. Unless explicitly configured (along with +`terraform_attribution_label_addition_strategy`, described below) the label +be added to newly provisioned resources. --- diff --git a/mmv1/third_party/terraform/website/docs/guides/version_6_upgrade.html.markdown b/mmv1/third_party/terraform/website/docs/guides/version_6_upgrade.html.markdown index d056ec29af15..8b9dfcbcdb95 100644 --- a/mmv1/third_party/terraform/website/docs/guides/version_6_upgrade.html.markdown +++ b/mmv1/third_party/terraform/website/docs/guides/version_6_upgrade.html.markdown @@ -88,9 +88,29 @@ terraform { ## Provider -### Provider-level change example header +### Compute: `name_prefix` max length has been extended from 37 to 54 characters -Description of the change and how users should adjust their configuration (if needed). +Affected resources: `google_compute_instance_template`, `google_compute_region_instance_template`, `google_compute_ssl_certificate`, +and `google_compute_region_ssl_certificate` + +Previously, the max length of `name_prefix` was 37 characters since the autogenerated UUID suffix was 26 characters which combined to +the total max length for names of 63 characters. +In 6.0, providing a `name_prefix` larger than 37 characters will prompt the provider to use a shortened suffix of only 9 characters, leading to a new max of 54 characters for `name_prefix`. This shortened suffix is inevitably more prone to collisions, so use the longer max `name_prefix` length with caution. + +### Provider attribution label is enabled by default + +Version 5.0.0 introduced the `goog-terraform-provisioned = true` label that could +be automatically added to resources, making it easy to identify resources created +by the provider when using other tools such as `gcloud` or the GCP web console. In +5.0.0 the label needed to be enabled explicitly; in 6.0.0 the default is to add the +label to all newly created resources. This behavior can be disabled in the provider +configuration. For example: + +```hcl +provider "google" { + add_terraform_attribution_label = false +} +``` ## Datasources @@ -108,6 +128,10 @@ Description of the change and how users should adjust their configuration (if ne A `view` can no longer be created when `schema` contains required fields +### `allow_resource_tags_on_deletion` is now removed + +Resource tags are now always allowed on table deletion. + ## Resource: `google_bigquery_reservation` ### `multi_region_auxiliary` is now removed @@ -155,6 +179,17 @@ and then run `terraform apply` to apply the change. ## Resource: `google_cloud_run_v2_job` +### Job 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 Job. In 6.0.0, existing jobs 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. + ### retyped `containers.env` to SET from ARRAY Previously, `containers.env` was a list, making it order-dependent. It is now a set. @@ -163,6 +198,17 @@ If you were relying on accessing an individual environment variable by index (fo ## Resource: `google_cloud_run_v2_service` +### Service 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 Service. In 6.0.0, existing services 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. + ### `liveness_probe` no longer defaults from API Cloud Run does not provide a default value for liveness probe. Now removing this field @@ -174,6 +220,18 @@ Previously, `containers.env` was a list, making it order-dependent. It is now a If you were relying on accessing an individual environment variable by index (for example, `google_cloud_run_v2_service.template.containers.0.env.0.name`), then that will now need to by hash (for example, `google_cloud_run_v2_service.template.containers.0.env..name`). +## Resource: `google_composer_environment` + +### `ip_allocation_policy = []` is no longer valid configuration + +There was no functional difference between setting `ip_allocation_policy = []` and not setting `ip_allocation_policy` at all. Removing the field from configuration should not produce a diff. + +## Resources: `google_compute_instance_from_template` and `google_compute_instance_from_machine_image` + +### `network_interface.alias_ip_range, network_interface.access_config, attached_disk, guest_accelerator, service_account, scratch_disk` can no longer be set to an empty block `[]` + +`field = []` is no longer valid configuration for these fields. Removing the fields from configuration should not produce a diff. + ## Resource: `google_compute_subnetwork` ### `secondary_ip_range = []` is no longer valid configuration @@ -214,7 +272,7 @@ Support for the deletionProtectionEnabled field has been added. Redis clusters w ### Fields `min_throughput` and `max_throughput` no longer have default values -The fields `min_throughput` and `max_throughput` no longer have default values +The fields `min_throughput` and `max_throughput` no longer have default values set by the provider. This was necessary to add conflicting field validation, also described in this guide. @@ -224,7 +282,7 @@ will default to values present in data returned from the API. ### Conflicting field validation added for `min_throughput` and `min_instances`, and `max_throughput` and `max_instances` The provider will now enforce that `google_vpc_access_connector` resources can only -include one of `min_throughput` and `min_instances` and one of `max_throughput`and +include one of `min_throughput` and `min_instances` and one of `max_throughput` and `max_instances`. Previously if a user included all four fields in a resource block they would experience a permadiff. This is a result of how `min_instances` and `max_instances` fields' values take precedence in the API, and how the API calculates @@ -235,12 +293,138 @@ 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 + +Previously `lifecycle_rule.condition.age` attribute was being set zero value by default and `lifecycle_rule.condition.no_age` was introduced to prevent that. +Now `lifecycle_rule.condition.no_age` is no longer supported and `lifecycle_rule.condition.age` won't set a zero value by default. +Removed in favor of the field `lifecycle_rule.condition.send_age_if_zero` which can be used to set zero value for `lifecycle_rule.condition.age` attribute. + +For a seamless update, if your state today uses `no_age=true`, update it to remove `no_age` and set `send_age_if_zero=false`. If you do not use `no_age=true`, you will need to add `send_age_if_zero=true` to your state to avoid any changes after updating to 6.0.0. + +## Resource: `google_container_cluster` + +### `advanced_datapath_observability_config.relay_mode` is now removed + +Previously, through `relay_mode` field usage, users could both enable Dataplane V2 +Flow Observability feature (that deploys Hubble relay component) and configure +managed load balancers. Due to users' needs to have better control over how +Hubble relay components shall be exposed in their clusters, managed load +balancer deployments are not supported anymore and users are expected to deploy +their own load balancers. + +If `advanced_datapath_observability_config` is defined, `enable_relay` is now a +required field instead and users are expected to use this field instead. + +Recommended migration from `relay_mode` to `enable_relay` depending on +`relay_mode` value: +* `DISABLED`: set `enable_relay` to `false` +* `INTERNAL_VPC_LB`: set `enable_relay` to `true` and define internal load + balancer with VPC scope +* `EXTERNAL_LB`: set `enable_relay` to `true` and define external load balancer + with public access + +See exported endpoints for Dataplane V2 Observability feature to learn what +target you might wish to expose with load balancers: +https://cloud.google.com/kubernetes-engine/docs/concepts/about-dpv2-observability#gke-dataplane-v2-observability-endpoints + +## Resource: `google_container_cluster` + +### Three label-related fields are now present + +* `resource_labels` field is non-authoritative and only manages the labels defined by +the users on the resource through Terraform. +* The new output-only `terraform_labels` field merges the labels defined by the users +on the resource through Terraform and the default labels configured on the provider. +* The new output-only `effective_labels` field lists all of labels present on the resource +in GCP, including the labels configured through Terraform, the system, and other clients. + +## Data source: `google_container_cluster` + +### Three label-related fields are now present + +All three of `resource_labels`, `effective_labels` and `terraform_labels` will now be present. +All of these three fields include all of the labels present on the resource in GCP including +the labels configured through Terraform, the system, and other clients, equivalent to +`effective_labels` on the resource. + +## Resource: `google_edgenetwork_network` + +### Three label-related fields are now present + +* `labels` field is non-authoritative and only manages the labels defined by +the users on the resource through Terraform. +* The new output-only `terraform_labels` field merges the labels defined by the users +on the resource through Terraform and the default labels configured on the provider. +* The new output-only `effective_labels` field lists all of labels present on the resource +in GCP, including the labels configured through Terraform, the system, and other clients. + +## Resource: `google_edgenetwork_subnet` + +### Three label-related fields are now present + +* `labels` field is non-authoritative and only manages the labels defined by +the users on the resource through Terraform. +* The new output-only `terraform_labels` field merges the labels defined by the users +on the resource through Terraform and the default labels configured on the provider. +* The new output-only `effective_labels` field lists all of labels present on the resource +in GCP, including the labels configured through Terraform, the system, and other clients. + +## Resource: `google_workstations_workstation_config` + +### `host.gce_instance.disable_ssh` now defaults to true + +* `disable_ssh` field now defaults to true. To enable SSH, please set `disable_ssh` to false. + ## Removals +### Resource: `google_alloydb_cluster` + +## `network` is now removed + +`network` has been removed in favor of `network_config.network` + ### Resource: `google_identity_platform_project_default_config` is now removed `google_identity_platform_project_default_config` is removed in favor of `google_identity_platform_project_config` +## Resource: `google_integrations_client` + +### `create_sample_worklfows` and `provision_gmek` is now removed + +`create_sample_worklfows` and `provision_gmek` is now removed in favor of `create_sample_integrations` + +## Resource: `google_project` + +### Project deletion now prevented by default with `deletion_policy` + +The field `skip_delete` is removed and the default value for `deletion_policy` is now +`PREVENT` instead of `DELETE`. The `PREVENT` value for `deletion_policy` stops Terraform +from deleting or recreating your project. Setting this field to `ABANDON` allows the +resource to be abandoned instead of deleted. To remove deletion protection entirely, +explicitly set this field to `DELETE` in your configuration and run `terraform apply`. A +`skip_delete` value of `false` can be changed to a `deletion_policy` value of `DELETE` and +a `skip_delete` value of `true` to a `deletion_policy` value of `ABANDON` for equivalent +behavior. + +### Resource: `google_datastore_index` is now removed + +`google_datastore_index` is removed in favor of `google_firestore_index` + ## Resource: `google_storage_bucket` ### `lifecycle_rule.condition.no_age` is now removed diff --git a/mmv1/third_party/terraform/website/docs/r/compute_instance_template.html.markdown b/mmv1/third_party/terraform/website/docs/r/compute_instance_template.html.markdown index 36f3392a992b..cd97bf4405e8 100644 --- a/mmv1/third_party/terraform/website/docs/r/compute_instance_template.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/compute_instance_template.html.markdown @@ -295,7 +295,14 @@ The following arguments are supported: this blank, Terraform will auto-generate a unique name. * `name_prefix` - (Optional) Creates a unique name beginning with the specified - prefix. Conflicts with `name`. + prefix. Conflicts with `name`. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + + Resulting name for a `name_prefix` <= 37 characters: + `name_prefix` + YYYYmmddHHSSssss + 8 digit incremental counter + Resulting name for a `name_prefix` 38 - 54 characters: + `name_prefix` + YYmmdd + 3 digit incremental counter * `can_ip_forward` - (Optional) Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false. diff --git a/mmv1/third_party/terraform/website/docs/r/compute_region_instance_template.html.markdown b/mmv1/third_party/terraform/website/docs/r/compute_region_instance_template.html.markdown index 74384427c13c..c7ebb9e0c3d0 100644 --- a/mmv1/third_party/terraform/website/docs/r/compute_region_instance_template.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/compute_region_instance_template.html.markdown @@ -307,7 +307,14 @@ The following arguments are supported: this blank, Terraform will auto-generate a unique name. * `name_prefix` - (Optional) Creates a unique name beginning with the specified - prefix. Conflicts with `name`. + prefix. Conflicts with `name`. Max length is 54 characters. + Prefixes with lengths longer than 37 characters will use a shortened + UUID that will be more prone to collisions. + + Resulting name for a `name_prefix` <= 37 characters: + `name_prefix` + YYYYmmddHHSSssss + 8 digit incremental counter + Resulting name for a `name_prefix` 38 - 54 characters: + `name_prefix` + YYmmdd + 3 digit incremental counter * `can_ip_forward` - (Optional) Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false. diff --git a/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown b/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown index 0554f7aa1533..b11194f59922 100644 --- a/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown @@ -328,6 +328,15 @@ channel. Structure is [documented below](#nested_release_channel). * `resource_labels` - (Optional) The GCE resource labels (a map of key/value pairs) to be applied to the cluster. + **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. + Please refer to the field 'effective_labels' for all of the labels present on the resource. + +* `terraform_labels` - + The combination of labels configured directly on the resource and default labels configured on the provider. + +* `effective_labels` - + All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services. + * `cost_management_config` - (Optional) Configuration for the [Cost Allocation](https://cloud.google.com/kubernetes-engine/docs/how-to/cost-allocations) feature. Structure is [documented below](#nested_cost_management_config). @@ -645,8 +654,7 @@ This block also contains several computed attributes, documented below. The `advanced_datapath_observability_config` block supports: * `enable_metrics` - (Required) Whether or not to enable advanced datapath metrics. -* `enable_relay` - (Optional) Whether or not Relay is enabled. -* `relay_mode` - (Optional, Deprecated) Mode used to make Relay available. Deprecated in favor of `enable_relay` field. Remove this attribute's configuration as this field will be removed in the next major release and `enable_relay` will become a required field. +* `enable_relay` - (Required) Whether or not Relay is enabled. The `maintenance_policy` block supports: * `daily_maintenance_window` - (Optional) structure documented below. diff --git a/mmv1/third_party/terraform/website/docs/r/google_project.html.markdown b/mmv1/third_party/terraform/website/docs/r/google_project.html.markdown index fff53a4a8874..6d45074bb2d5 100644 --- a/mmv1/third_party/terraform/website/docs/r/google_project.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/google_project.html.markdown @@ -78,12 +78,6 @@ The following arguments are supported: See [Google Cloud Billing API Access Control](https://cloud.google.com/billing/docs/how-to/billing-access) for more details. -* `skip_delete` - (Optional) If true, the Terraform resource can be deleted without - deleting the Project via the Google API. `skip_delete` is deprecated and will be - removed in 6.0.0. Please use deletion_policy instead. A `skip_delete` value of `false` - can be changed to a `deletion_policy` value of `DELETE` and a `skip_delete` value of `true` - to a `deletion_policy` value of `ABANDON` for equivalent behavior. - * `labels` - (Optional) A set of key/value label pairs to assign to the project. **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource. @@ -104,7 +98,7 @@ The following arguments are supported: * `deletion_policy` - (Optional) The deletion policy for the Project. Setting PREVENT will protect the project against any destroy actions caused by a terraform apply or terraform destroy. Setting ABANDON allows the resource to be abandoned rather than deleted, i.e., the Terraform resource can be deleted without deleting the Project via - the Google API. Possible values are: "PREVENT", "ABANDON", "DELETE". Default value is `DELETE`. + the Google API. Possible values are: "PREVENT", "ABANDON", "DELETE". Default value is `PREVENT`. ## Attributes Reference diff --git a/mmv1/third_party/terraform/website/docs/r/sql_database_instance.html.markdown b/mmv1/third_party/terraform/website/docs/r/sql_database_instance.html.markdown index 220bfc44f3f5..dfc63b30ecec 100644 --- a/mmv1/third_party/terraform/website/docs/r/sql_database_instance.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/sql_database_instance.html.markdown @@ -377,12 +377,7 @@ Specifying a network enables private IP. At least `ipv4_enabled` must be enabled or a `private_network` must be configured. This setting can be updated, but it cannot be removed after it is set. -* `require_ssl` - (Optional, Deprecated) Whether SSL connections over IP are enforced or not. To change this field, also set the corresponding value in `ssl_mode`. It will be fully deprecated in a future major release. For now, please use `ssl_mode` with a compatible `require_ssl` value instead. - -* `ssl_mode` - (Optional) Specify how SSL connection should be enforced in DB connections. This field provides more SSL enforcement options compared to `require_ssl`. To change this field, also set the correspoding value in `require_ssl`. - * For PostgreSQL instances, the value pairs are listed in the [API reference doc](https://cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances#ipconfiguration) for `ssl_mode` field. - * For MySQL instances, use the same value pairs as the PostgreSQL instances. - * For SQL Server instances, set it to `ALLOW_UNENCRYPTED_AND_ENCRYPTED` when `require_ssl=false` and `ENCRYPTED_ONLY` otherwise. +* `ssl_mode` - (Optional) Specify how SSL connection should be enforced in DB connections. * `server_ca_mode` - (Optional) Specify how the server certificate's Certificate Authority is hosted. Supported value is `GOOGLE_MANAGED_INTERNAL_CA`. diff --git a/mmv1/third_party/terraform/website/docs/r/storage_bucket.html.markdown b/mmv1/third_party/terraform/website/docs/r/storage_bucket.html.markdown index 8304aba71fc3..db1b5e7e8aed 100644 --- a/mmv1/third_party/terraform/website/docs/r/storage_bucket.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/storage_bucket.html.markdown @@ -171,9 +171,7 @@ The following arguments are supported: The `condition` block supports the following elements, and requires at least one to be defined. If you specify multiple conditions in a rule, an object has to match all of the conditions for the action to be taken: -* `age` - (Optional) Minimum age of an object in days to satisfy this condition. If not supplied alongside another condition and without setting `no_age` to `true`, a default `age` of 0 will be set. - -* `no_age` - (Optional, Deprecated) While set `true`, `age` value will be omitted from requests. This prevents a default age of `0` from being applied, and if you do not have an `age` value set, setting this to `true` is strongly recommended. When unset and other conditions are set to zero values, this can result in a rule that applies your action to all files in the bucket. `no_age` is deprecated and will be removed in a future major release. Use `send_age_if_zero` instead. +* `age` - (Optional) Minimum age of an object in days to satisfy this condition. **Note** To set `0` value of `age`, `send_age_if_zero` should be set `true` otherwise `0` value of `age` field will be ignored. * `created_before` - (Optional) A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when an object is created before midnight of the specified date in UTC. @@ -193,7 +191,7 @@ The following arguments are supported: * `days_since_custom_time` - (Optional) Days since the date set in the `customTime` metadata for the object. This condition is satisfied when the current date and time is at least the specified number of days after the `customTime`. Due to a current bug you are unable to set this value to `0` within Terraform. When set to `0` it will be ignored, and your state will treat it as though you supplied no `days_since_custom_time` condition. -* `send_age_if_zero` - (Optional, Default: true) While set true, `age` value will be sent in the request even for zero value of the field. This field is only useful and required for setting 0 value to the `age` field. It can be used alone or together with `age` attribute. **NOTE** `age` attibute with `0` value will be ommitted from the API request if `send_age_if_zero` field is having `false` value. +* `send_age_if_zero` - (Optional) While set true, `age` value will be sent in the request even for zero value of the field. This field is only useful and required for setting 0 value to the `age` field. It can be used alone or together with `age` attribute. **NOTE** `age` attibute with `0` value will be ommitted from the API request if `send_age_if_zero` field is having `false` value. * `send_days_since_custom_time_if_zero` - (Optional) While set true, `days_since_custom_time` value will be sent in the request even for zero value of the field. This field is only useful for setting 0 value to the `days_since_custom_time` field. It can be used alone or together with `days_since_custom_time`. diff --git a/mmv1/third_party/tgc/sql_database_instance.go b/mmv1/third_party/tgc/sql_database_instance.go index 45cecb9a91a7..3903b31f2c98 100644 --- a/mmv1/third_party/tgc/sql_database_instance.go +++ b/mmv1/third_party/tgc/sql_database_instance.go @@ -189,10 +189,11 @@ func expandIpConfiguration(configured []interface{}) *sqladmin.IpConfiguration { return &sqladmin.IpConfiguration{ Ipv4Enabled: _ipConfiguration["ipv4_enabled"].(bool), - RequireSsl: _ipConfiguration["require_ssl"].(bool), PrivateNetwork: _ipConfiguration["private_network"].(string), AuthorizedNetworks: expandAuthorizedNetworks(_ipConfiguration["authorized_networks"].(*schema.Set).List()), - ForceSendFields: []string{"Ipv4Enabled", "RequireSsl"}, + ForceSendFields: []string{"Ipv4Enabled"}, + NullFields: []string{"RequireSsl"}, + SslMode: _ipConfiguration["ssl_mode"].(string), } } func expandAuthorizedNetworks(configured []interface{}) []*sqladmin.AclEntry { diff --git a/mmv1/third_party/tgc/tests/data/example_alloydb_instance.tf b/mmv1/third_party/tgc/tests/data/example_alloydb_instance.tf index 3295f6ecaa50..b6803e2986af 100644 --- a/mmv1/third_party/tgc/tests/data/example_alloydb_instance.tf +++ b/mmv1/third_party/tgc/tests/data/example_alloydb_instance.tf @@ -15,8 +15,10 @@ provider "google" { resource "google_alloydb_cluster" "default" { cluster_id = "alloydb-cluster" location = "us-central1" - network = "default" - + network_config { + network = "default" + } + initial_user { password = "alloydb-cluster" } diff --git a/mmv1/third_party/tgc/tests/data/example_google_cloudfunctions_function.json b/mmv1/third_party/tgc/tests/data/example_google_cloudfunctions_function.json index 023ace64ebc9..8965a7c1a46b 100644 --- a/mmv1/third_party/tgc/tests/data/example_google_cloudfunctions_function.json +++ b/mmv1/third_party/tgc/tests/data/example_google_cloudfunctions_function.json @@ -27,7 +27,9 @@ } }, "ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}", - "ancestors": ["organizations/{{.OrgID}}"] + "ancestors": [ + "organizations/{{.OrgID}}" + ] }, { "name": "//vpcaccess.googleapis.com/projects/{{.Provider.project}}/locations/us-east1/connectors/vpc-con-cf", @@ -40,12 +42,12 @@ "data": { "ipCidrRange": "10.8.0.0/28", "machineType": "e2-micro", - "maxThroughput": 300, - "minThroughput": 200, "network": "default" } }, "ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}", - "ancestors": ["organizations/{{.OrgID}}"] + "ancestors": [ + "organizations/{{.OrgID}}" + ] } ] \ No newline at end of file diff --git a/mmv1/third_party/tgc/tests/data/example_google_datastream_stream.json b/mmv1/third_party/tgc/tests/data/example_google_datastream_stream.json index 74d5ba20182b..598a664e33b1 100644 --- a/mmv1/third_party/tgc/tests/data/example_google_datastream_stream.json +++ b/mmv1/third_party/tgc/tests/data/example_google_datastream_stream.json @@ -59,7 +59,7 @@ } ], "ipv4Enabled": true, - "requireSsl": false + "requireSsl": null }, "pricingPlan": "PER_USE", "storageAutoResize": true, @@ -155,4 +155,4 @@ "ancestors": ["organizations/{{.OrgID}}"], "ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}" } -] \ No newline at end of file +] diff --git a/mmv1/third_party/tgc/tests/data/example_google_datastream_stream_append_only.json b/mmv1/third_party/tgc/tests/data/example_google_datastream_stream_append_only.json index afabec983537..bced423d4fde 100644 --- a/mmv1/third_party/tgc/tests/data/example_google_datastream_stream_append_only.json +++ b/mmv1/third_party/tgc/tests/data/example_google_datastream_stream_append_only.json @@ -59,7 +59,7 @@ } ], "ipv4Enabled": true, - "requireSsl": false + "requireSsl": null }, "pricingPlan": "PER_USE", "storageAutoResize": true, @@ -155,4 +155,4 @@ "ancestors": ["organizations/{{.OrgID}}"], "ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}" } -] \ No newline at end of file +] diff --git a/mmv1/third_party/tgc/tests/data/example_google_logging_folder_bucket_config.tf b/mmv1/third_party/tgc/tests/data/example_google_logging_folder_bucket_config.tf index ef2e64b836b1..a9fe52aecb9f 100644 --- a/mmv1/third_party/tgc/tests/data/example_google_logging_folder_bucket_config.tf +++ b/mmv1/third_party/tgc/tests/data/example_google_logging_folder_bucket_config.tf @@ -14,6 +14,7 @@ provider "google" { resource "google_folder" "default" { display_name = "some-folder-name" parent = "organizations/{{.OrgID}}" + deletion_protection = false } resource "google_logging_folder_bucket_config" "basic" { diff --git a/mmv1/third_party/tgc/tests/data/example_project_create.tf b/mmv1/third_party/tgc/tests/data/example_project_create.tf index 2043396c2ad6..8039b56979ba 100644 --- a/mmv1/third_party/tgc/tests/data/example_project_create.tf +++ b/mmv1/third_party/tgc/tests/data/example_project_create.tf @@ -33,6 +33,7 @@ resource "google_project" "my_project-in-a-folder" { folder_id = google_folder.department1.name billing_account = "{{.Project.BillingAccountName}}" + deletion_policy = "DELETE" labels = { "project-label-key-a" = "project-label-val-a" @@ -42,4 +43,5 @@ resource "google_project" "my_project-in-a-folder" { resource "google_folder" "department1" { display_name = "Department 1" parent = "organizations/{{.OrgID}}" + deletion_protection = false } diff --git a/mmv1/third_party/tgc/tests/data/example_project_create_empty_project_id.tf b/mmv1/third_party/tgc/tests/data/example_project_create_empty_project_id.tf index 374df42c4fea..1f4b89671223 100644 --- a/mmv1/third_party/tgc/tests/data/example_project_create_empty_project_id.tf +++ b/mmv1/third_party/tgc/tests/data/example_project_create_empty_project_id.tf @@ -33,6 +33,7 @@ resource "google_project" "my_project-in-a-folder" { folder_id = google_folder.department1.name billing_account = "{{.Project.BillingAccountName}}" + deletion_policy = "DELETE" labels = { "project-label-key-a" = "project-label-val-a" @@ -48,4 +49,5 @@ resource "random_string" "suffix" { resource "google_folder" "department1" { display_name = "Department 1" parent = "organizations/{{.OrgID}}" + deletion_protection = false } diff --git a/mmv1/third_party/tgc/tests/data/example_project_in_folder.tf b/mmv1/third_party/tgc/tests/data/example_project_in_folder.tf index b75f74a3316f..10504a515737 100644 --- a/mmv1/third_party/tgc/tests/data/example_project_in_folder.tf +++ b/mmv1/third_party/tgc/tests/data/example_project_in_folder.tf @@ -31,4 +31,5 @@ resource "google_project" "my_project" { name = "My Project" project_id = "foobat" folder_id = "folders/{{.FolderID}}" + deletion_policy = "DELETE" } diff --git a/mmv1/third_party/tgc/tests/data/example_project_in_org.tf b/mmv1/third_party/tgc/tests/data/example_project_in_org.tf index 615ca8de7a45..157d666ba226 100644 --- a/mmv1/third_party/tgc/tests/data/example_project_in_org.tf +++ b/mmv1/third_party/tgc/tests/data/example_project_in_org.tf @@ -31,4 +31,5 @@ resource "google_project" "my_project" { name = "My Project" project_id = "foobat" org_id = "{{.OrgID}}" + deletion_policy = "DELETE" } diff --git a/mmv1/third_party/tgc/tests/data/example_project_update.tf b/mmv1/third_party/tgc/tests/data/example_project_update.tf index 65d9f6fc2f3b..e9a1bd3206e6 100644 --- a/mmv1/third_party/tgc/tests/data/example_project_update.tf +++ b/mmv1/third_party/tgc/tests/data/example_project_update.tf @@ -37,4 +37,5 @@ resource "google_project" "my_project" { labels = { "project-label-key-a" = "project-label-val-a" } + deletion_policy = "DELETE" } diff --git a/mmv1/third_party/tgc/tests/data/example_vpc_access_connector.json b/mmv1/third_party/tgc/tests/data/example_vpc_access_connector.json index febb8f3bc824..a45c1ff18d44 100644 --- a/mmv1/third_party/tgc/tests/data/example_vpc_access_connector.json +++ b/mmv1/third_party/tgc/tests/data/example_vpc_access_connector.json @@ -10,11 +10,11 @@ "parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}", "data": { "ipCidrRange": "10.8.0.0/28", - "maxThroughput": 300, - "minThroughput": 200, + "minInstances": 2, + "maxInstances": 3, "network": "default", "machineType": "e2-micro" } } } -] +] \ No newline at end of file diff --git a/mmv1/third_party/tgc/tests/data/example_vpc_access_connector.tf b/mmv1/third_party/tgc/tests/data/example_vpc_access_connector.tf index 9281200db1f0..308803bb3db5 100644 --- a/mmv1/third_party/tgc/tests/data/example_vpc_access_connector.tf +++ b/mmv1/third_party/tgc/tests/data/example_vpc_access_connector.tf @@ -31,4 +31,6 @@ resource "google_vpc_access_connector" "connector" { ip_cidr_range = "10.8.0.0/28" network = "default" region = "us-central1" + min_instances = 2 + max_instances = 3 } diff --git a/mmv1/third_party/tgc/tests/data/full_sql_database_instance.json b/mmv1/third_party/tgc/tests/data/full_sql_database_instance.json index e9bec3fd717f..34f0e15b9243 100644 --- a/mmv1/third_party/tgc/tests/data/full_sql_database_instance.json +++ b/mmv1/third_party/tgc/tests/data/full_sql_database_instance.json @@ -64,7 +64,8 @@ } ], "ipv4Enabled": true, - "requireSsl": true + "requireSsl": null, + "sslMode": "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" }, "locationPreference": { "followGaeApplication": "test-follow_gae_application", diff --git a/mmv1/third_party/tgc/tests/data/full_sql_database_instance.tf b/mmv1/third_party/tgc/tests/data/full_sql_database_instance.tf index 9cd7249ee21e..a569ce5512f0 100644 --- a/mmv1/third_party/tgc/tests/data/full_sql_database_instance.tf +++ b/mmv1/third_party/tgc/tests/data/full_sql_database_instance.tf @@ -85,7 +85,7 @@ resource "google_sql_database_instance" "main" { } ipv4_enabled = true private_network = google_compute_network.private_network.self_link - require_ssl = true + ssl_mode = "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" } location_preference { follow_gae_application = "test-follow_gae_application" diff --git a/tools/issue-labeler/labeler/enrolled_teams.yml b/tools/issue-labeler/labeler/enrolled_teams.yml index c589196da898..0c3a64cca6c4 100755 --- a/tools/issue-labeler/labeler/enrolled_teams.yml +++ b/tools/issue-labeler/labeler/enrolled_teams.yml @@ -350,7 +350,6 @@ service/firestore-controlplane: - google_firestore_database service/firestore-dataplane: resources: - - google_datastore_index - google_firestore_document - google_firestore_field - google_firestore_index diff --git a/tpgtools/api/apikeys/samples/android.key.json b/tpgtools/api/apikeys/samples/android.key.json index 8dc4dede79a8..65b3de5011e1 100755 --- a/tpgtools/api/apikeys/samples/android.key.json +++ b/tpgtools/api/apikeys/samples/android.key.json @@ -1,6 +1,5 @@ { "name": "{{key}}", - "project": "{{ref:basic.cloudresourcemanager.project.json:name}}", "displayName": "sample-key", "restrictions": { "androidKeyRestrictions": { diff --git a/tpgtools/api/apikeys/samples/android_key.yaml b/tpgtools/api/apikeys/samples/android_key.yaml index 9ddaed88bbeb..31ced31a3b37 100755 --- a/tpgtools/api/apikeys/samples/android_key.yaml +++ b/tpgtools/api/apikeys/samples/android_key.yaml @@ -17,12 +17,8 @@ type: key versions: - ga resource: samples/android.key.json -dependencies: -- samples/basic.cloudresourcemanager.project.json updates: - resource: samples/android_update.key.json - dependencies: - - samples/basic.cloudresourcemanager.project.json variables: - name: app type: resource_name diff --git a/tpgtools/api/apikeys/samples/android_update.key.json b/tpgtools/api/apikeys/samples/android_update.key.json index 71b84a6bb2d5..4d565fbcbc8c 100755 --- a/tpgtools/api/apikeys/samples/android_update.key.json +++ b/tpgtools/api/apikeys/samples/android_update.key.json @@ -1,6 +1,5 @@ { "name": "{{key}}", - "project": "{{ref:basic.cloudresourcemanager.project.json:name}}", "displayName": "sample-key", "restrictions": { "androidKeyRestrictions": { diff --git a/tpgtools/api/apikeys/samples/apikeys.serviceusage.service.json b/tpgtools/api/apikeys/samples/apikeys.serviceusage.service.json index 87ed4f510b54..8a59d7ec7bcb 100755 --- a/tpgtools/api/apikeys/samples/apikeys.serviceusage.service.json +++ b/tpgtools/api/apikeys/samples/apikeys.serviceusage.service.json @@ -1,5 +1,4 @@ { "name": "apikeys.googleapis.com", - "project": "{{ref:basic.cloudresourcemanager.project.json:name}}", "state": "ENABLED" } diff --git a/tpgtools/api/apikeys/samples/basic.cloudbilling.project_billing_info.json b/tpgtools/api/apikeys/samples/basic.cloudbilling.project_billing_info.json deleted file mode 100755 index 54f385157d61..000000000000 --- a/tpgtools/api/apikeys/samples/basic.cloudbilling.project_billing_info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "{{ref:basic.cloudresourcemanager.project.json:name}}", - "billingAccountName": "{{billing_account}}" -} diff --git a/tpgtools/api/apikeys/samples/basic.cloudresourcemanager.project.json b/tpgtools/api/apikeys/samples/basic.cloudresourcemanager.project.json deleted file mode 100755 index 2ef8040c1b40..000000000000 --- a/tpgtools/api/apikeys/samples/basic.cloudresourcemanager.project.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "{{app}}", - "parent": "organizations/{{org_id}}" -} diff --git a/tpgtools/api/apikeys/samples/basic.key.json b/tpgtools/api/apikeys/samples/basic.key.json index a319cfc3261f..ad86c006519d 100755 --- a/tpgtools/api/apikeys/samples/basic.key.json +++ b/tpgtools/api/apikeys/samples/basic.key.json @@ -1,6 +1,5 @@ { "name": "{{key}}", - "project": "{{ref:basic.cloudresourcemanager.project.json:name}}", "displayName": "sample-key", "restrictions": { "browserKeyRestrictions": { diff --git a/tpgtools/api/apikeys/samples/basic_key.yaml b/tpgtools/api/apikeys/samples/basic_key.yaml index d09a4ac717ab..a43631f4924b 100755 --- a/tpgtools/api/apikeys/samples/basic_key.yaml +++ b/tpgtools/api/apikeys/samples/basic_key.yaml @@ -17,12 +17,8 @@ type: key versions: - ga resource: samples/basic.key.json -dependencies: -- samples/basic.cloudresourcemanager.project.json updates: - resource: samples/update.key.json - dependencies: - - samples/basic.cloudresourcemanager.project.json variables: - name: app type: resource_name diff --git a/tpgtools/api/apikeys/samples/ios.key.json b/tpgtools/api/apikeys/samples/ios.key.json index eeb1bea021e5..fd8c0f87188b 100755 --- a/tpgtools/api/apikeys/samples/ios.key.json +++ b/tpgtools/api/apikeys/samples/ios.key.json @@ -1,6 +1,5 @@ { "name": "{{key}}", - "project": "{{ref:basic.cloudresourcemanager.project.json:name}}", "displayName": "sample-key", "restrictions": { "iosKeyRestrictions": { diff --git a/tpgtools/api/apikeys/samples/ios_key.yaml b/tpgtools/api/apikeys/samples/ios_key.yaml index d85ea873f024..5af5d1714b33 100755 --- a/tpgtools/api/apikeys/samples/ios_key.yaml +++ b/tpgtools/api/apikeys/samples/ios_key.yaml @@ -17,12 +17,8 @@ type: key versions: - ga resource: samples/ios.key.json -dependencies: -- samples/basic.cloudresourcemanager.project.json updates: - resource: samples/ios_update.key.json - dependencies: - - samples/basic.cloudresourcemanager.project.json variables: - name: app type: resource_name diff --git a/tpgtools/api/apikeys/samples/ios_update.key.json b/tpgtools/api/apikeys/samples/ios_update.key.json index a45969b4e255..a218d9aefdec 100755 --- a/tpgtools/api/apikeys/samples/ios_update.key.json +++ b/tpgtools/api/apikeys/samples/ios_update.key.json @@ -1,6 +1,5 @@ { "name": "{{key}}", - "project": "{{ref:basic.cloudresourcemanager.project.json:name}}", "displayName": "sample-key", "restrictions": { "iosKeyRestrictions": { diff --git a/tpgtools/api/apikeys/samples/minimal.key.json b/tpgtools/api/apikeys/samples/minimal.key.json index 0de198c1fb72..351f34304e8c 100755 --- a/tpgtools/api/apikeys/samples/minimal.key.json +++ b/tpgtools/api/apikeys/samples/minimal.key.json @@ -1,5 +1,4 @@ { "name": "{{key}}", - "project": "{{ref:basic.cloudresourcemanager.project.json:name}}", "displayName": "sample-key" } diff --git a/tpgtools/api/apikeys/samples/minimal_key.yaml b/tpgtools/api/apikeys/samples/minimal_key.yaml index 899728b04575..a1e424a4a2c7 100755 --- a/tpgtools/api/apikeys/samples/minimal_key.yaml +++ b/tpgtools/api/apikeys/samples/minimal_key.yaml @@ -17,8 +17,6 @@ type: key versions: - ga resource: samples/minimal.key.json -dependencies: -- samples/basic.cloudresourcemanager.project.json variables: - name: app type: resource_name diff --git a/tpgtools/api/apikeys/samples/server.key.json b/tpgtools/api/apikeys/samples/server.key.json index 378cebe04ba8..083c18cc22b8 100755 --- a/tpgtools/api/apikeys/samples/server.key.json +++ b/tpgtools/api/apikeys/samples/server.key.json @@ -1,6 +1,5 @@ { "name": "{{key}}", - "project": "{{ref:basic.cloudresourcemanager.project.json:name}}", "displayName": "sample-key", "restrictions": { "serverKeyRestrictions": { diff --git a/tpgtools/api/apikeys/samples/server_key.yaml b/tpgtools/api/apikeys/samples/server_key.yaml index 4f3c1eff1498..ed36aaf9e6b4 100755 --- a/tpgtools/api/apikeys/samples/server_key.yaml +++ b/tpgtools/api/apikeys/samples/server_key.yaml @@ -17,12 +17,8 @@ type: key versions: - ga resource: samples/server.key.json -dependencies: -- samples/basic.cloudresourcemanager.project.json updates: - resource: samples/server_update.key.json - dependencies: - - samples/basic.cloudresourcemanager.project.json variables: - name: app type: resource_name diff --git a/tpgtools/api/apikeys/samples/server_update.key.json b/tpgtools/api/apikeys/samples/server_update.key.json index 9fb285ce1256..aa5927b712ed 100755 --- a/tpgtools/api/apikeys/samples/server_update.key.json +++ b/tpgtools/api/apikeys/samples/server_update.key.json @@ -1,6 +1,5 @@ { "name": "{{key}}", - "project": "{{ref:basic.cloudresourcemanager.project.json:name}}", "displayName": "sample-key", "restrictions": { "serverKeyRestrictions": { diff --git a/tpgtools/api/apikeys/samples/update.key.json b/tpgtools/api/apikeys/samples/update.key.json index 82e961a9c4eb..05925b608e37 100755 --- a/tpgtools/api/apikeys/samples/update.key.json +++ b/tpgtools/api/apikeys/samples/update.key.json @@ -1,6 +1,5 @@ { "name":"{{key}}", - "project": "{{ref:basic.cloudresourcemanager.project.json:name}}", "displayName": "sample-key-update", "restrictions": { "browserKeyRestrictions": { diff --git a/tpgtools/overrides/assuredworkloads/samples/workload/basic.tf.tmpl b/tpgtools/overrides/assuredworkloads/samples/workload/basic.tf.tmpl index 8d303ef61437..51db686c8b2f 100644 --- a/tpgtools/overrides/assuredworkloads/samples/workload/basic.tf.tmpl +++ b/tpgtools/overrides/assuredworkloads/samples/workload/basic.tf.tmpl @@ -18,4 +18,5 @@ resource "google_assured_workloads_workload" "primary" { resource "google_folder" "folder1" { display_name = "{{name}}" parent = "organizations/{{org_id}}" + deletion_protection = false } \ No newline at end of file diff --git a/tpgtools/overrides/assuredworkloads/samples/workload/basic_update.tf.tmpl b/tpgtools/overrides/assuredworkloads/samples/workload/basic_update.tf.tmpl index 4d5fb120eb93..f58d0caa2d31 100644 --- a/tpgtools/overrides/assuredworkloads/samples/workload/basic_update.tf.tmpl +++ b/tpgtools/overrides/assuredworkloads/samples/workload/basic_update.tf.tmpl @@ -18,4 +18,5 @@ resource "google_assured_workloads_workload" "primary" { resource "google_folder" "folder1" { display_name = "{{name}}" parent = "organizations/{{org_id}}" + deletion_protection = false } \ No newline at end of file diff --git a/tpgtools/overrides/assuredworkloads/samples/workload/full.tf.tmpl b/tpgtools/overrides/assuredworkloads/samples/workload/full.tf.tmpl index 6f6892ceb96f..d73ba356def2 100644 --- a/tpgtools/overrides/assuredworkloads/samples/workload/full.tf.tmpl +++ b/tpgtools/overrides/assuredworkloads/samples/workload/full.tf.tmpl @@ -14,4 +14,5 @@ resource "google_assured_workloads_workload" "primary" { resource "google_folder" "folder1" { display_name = "{{name}}" parent = "organizations/{{org_id}}" + deletion_protection = false } diff --git a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule.tf.tmpl b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule.tf.tmpl index e3176d43aee0..243065e67d61 100644 --- a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule.tf.tmpl +++ b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule.tf.tmpl @@ -11,6 +11,7 @@ resource "google_network_security_address_group" "basic_global_networksecurity_a resource "google_folder" "folder" { display_name = "{{policy}}" parent = "organizations/{{org_id}}" + deletion_protection = false } resource "google_compute_firewall_policy" "default" { diff --git a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_update.tf.tmpl b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_update.tf.tmpl index 82930ce33b3f..02a06ec9f717 100644 --- a/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_update.tf.tmpl +++ b/tpgtools/overrides/compute/samples/firewallpolicyrule/basic_fir_sec_rule_update.tf.tmpl @@ -11,6 +11,7 @@ resource "google_network_security_address_group" "basic_global_networksecurity_a resource "google_folder" "folder" { display_name = "{{policy}}" parent = "organizations/{{org_id}}" + deletion_protection = false } resource "google_compute_firewall_policy" "default" {