From a99fc2d8888eec5e162201b560540379f6105236 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Thu, 24 Aug 2023 21:27:40 +0000 Subject: [PATCH] Cleanup deprecated folders (#8720) * Remove folder resources and data_sources * Remove utility files * Move more utility files * Fix tgc * Import provider package in tgc * Remove utils files Signed-off-by: Modular Magician --- .changelog/8720.txt | 3 + google/acctest/bootstrap_iam_test_utils.go | 8 - google/acctest/gcp_sweeper.go | 23 -- google/acctest/provider_test_utils.go | 221 +--------- google/appengine_operation.go | 22 - google/bootstrap_iam_test_utils.go | 48 --- google/bootstrap_test_utils.go | 121 ------ google/cloudfunctions_operation.go | 23 -- google/cloudrun_polling.go | 14 - google/common_diff_suppress.go | 178 -------- google/common_operation.go | 22 - google/common_polling.go | 88 ---- google/composer_operation.go | 18 - google/compute_operation.go | 16 - google/config.go | 13 - google/config_test_utils.go | 135 ------ google/container_attached_operation.go | 24 -- google/container_operation.go | 18 - google/convert.go | 29 -- google/data_source_google_billing_account.go | 11 - google/data_source_google_compute_address.go | 12 - .../data_source_google_service_account_jwt.go | 9 - google/dataproc_cluster_operation.go | 18 - google/dataproc_job_operation.go | 22 - google/datasource_helpers.go | 46 --- google/datasource_iam_policy.go | 14 - google/datastream_operation.go | 24 -- google/deployment_manager_operation.go | 16 - google/dialogflow_cx_operation.go | 24 -- google/error_retry_predicates.go | 165 -------- google/extract.go | 13 - google/field_helpers.go | 246 ----------- google/framework_test_utils.go | 30 -- google/framework_transport.go | 19 - google/framework_utils.go | 47 --- google/gcp_sweeper.go | 18 - google/gkeonprem_operation.go | 3 - google/hashcode.go | 17 - google/iam.go | 64 --- google/iam_bigquery_dataset.go | 22 - google/iam_bigtable_instance.go | 22 - google/iam_bigtable_table.go | 22 - google/iam_billing_account.go | 22 - google/iam_dataproc_cluster.go | 21 - google/iam_dataproc_job.go | 21 - google/iam_folder.go | 32 -- google/iam_organization.go | 22 - google/iam_project.go | 27 -- google/image.go | 37 -- google/import.go | 38 -- google/logging_exclusion_billing_account.go | 20 - google/logging_exclusion_folder.go | 20 - google/logging_exclusion_organization.go | 20 - google/logging_exclusion_project.go | 20 - google/logging_utils.go | 17 - google/metadata.go | 46 --- ...etwork_security_address_group_operation.go | 16 - google/path_or_contents.go | 17 - google/provider_test_utils.go | 174 -------- google/pubsub_utils.go | 17 - google/regional_utils.go | 37 -- google/resource_bigtable_gc_policy.go | 13 - google/resource_bigtable_table.go | 11 - google/resource_cloudfunctions_function.go | 9 - google/resource_compute_attached_disk.go | 12 - google/resource_dataflow_job.go | 11 - google/resource_google_organization_policy.go | 11 - google/resource_google_project.go | 32 -- google/resource_iam_audit_config.go | 14 - google/resource_iam_binding.go | 27 -- google/resource_iam_member.go | 14 - google/resource_iam_policy.go | 14 - google/resource_logging_exclusion.go | 10 - google/resource_manager_operation.go | 19 - .../resource_service_networking_connection.go | 18 - google/resource_storage_bucket_acl.go | 11 - google/resource_storage_notification.go | 11 - google/retry_utils.go | 55 --- google/runadminv3_operation.go | 24 -- google/self_link_helpers.go | 111 ----- google/service_account_waiter.go | 14 - google/service_networking_operation.go | 17 - google/service_scope.go | 19 - google/serviceman_operation.go | 18 - .../dataplex/resource_dataplex_task_test.go | 20 +- ...resource_google_project_iam_member_test.go | 4 +- .../resource_google_project_test.go | 2 +- .../resource_storage_bucket_acl_test.go | 11 +- .../resource_storage_notification_test.go | 5 +- google/sqladmin_operation.go | 25 -- google/stateful_mig_polling.go | 14 - google/tags_location_operation.go | 28 -- .../apigateway/api_descriptor.pb | Bin 7924 -> 0 bytes .../test-fixtures/apigateway/bookstore.proto | 126 ------ google/test-fixtures/apigateway/openapi.yaml | 21 - .../apigee_keystore_alias_test_cert.pem | 21 - .../apigee_keystore_alias_test_cert2.pem | 21 - .../apigee/apigee_keystore_alias_test_key.pem | 28 -- .../apigee/apigee_sharedflow_bundle.zip | Bin 1016 -> 0 bytes .../apigee/apigee_sharedflow_bundle2.zip | Bin 2645 -> 0 bytes google/test-fixtures/apigee/keyStore.p12 | Bin 4069 -> 0 bytes .../appengine/hello-world-flask/app.yaml | 18 - .../appengine/hello-world-flask/main.py | 36 -- .../hello-world-flask/requirements.txt | 2 - .../test-fixtures/appengine/hello-world.zip | Bin 2418 -> 0 bytes .../bigquerytable/avro-generated.avro | Bin 285 -> 0 bytes ...-368c-496b-97ae-e3ac28051a4d-00001.parquet | Bin 524 -> 0 bytes ...-bb88-4b5a-94bd-370f286c858a.metadata.json | 70 ---- .../bigquerytable/test.parquet.gzip | Bin 909 -> 0 bytes .../binauthz/generated_payload.json.tmpl | 12 - .../test-fixtures/certificatemanager/cert.pem | 19 - .../certificatemanager/private-key.pem | 28 -- .../cloudfunctions/bucket_trigger.js | 21 - .../cloudfunctions/firestore_trigger.js | 13 - .../cloudfunctions/http_trigger.js | 9 - .../cloudfunctions/http_trigger_update.js | 9 - .../cloudfunctions/pubsub_trigger.js | 14 - .../secret_environment_variables.js | 7 - .../cloudfunctions/secret_volumes_mount.js | 18 - .../function-source-eventarc-gcs.zip | Bin 597 -> 0 bytes .../function-source-pubsub.zip | Bin 696 -> 0 bytes google/test-fixtures/cloudfunctions2/index-js | 5 - .../service_account.yml.tmpl | 6 - google/test-fixtures/dlp/words.txt | 3 - google/test-fixtures/fake_account.json | 2 +- google/test-fixtures/fake_client.json | 11 - google/test-fixtures/header-logo.png | Bin 3368 -> 0 bytes google/test-fixtures/rsa_cert.pem | 17 - google/test-fixtures/rsa_csr.pem | 19 - google/test-fixtures/rsa_private_4096.pem | 52 --- google/test-fixtures/rsa_public.pem | 14 - .../serviceaccount/public_key.pem | 17 - google/test-fixtures/ssh_rsa.pub | 1 - google/test-fixtures/ssl_cert/test.crt | 21 - google/test-fixtures/ssl_cert/test.csr | 17 - google/test-fixtures/ssl_cert/test.key | 27 -- google/test-fixtures/test_api_descriptor.pb | Bin 8752 -> 0 bytes google/test-fixtures/workflow.yaml | 17 - google/test_utils.go | 69 ---- google/tpgresource/utils_test.go | 102 +++-- google/transport_test_utils.go | 18 - google/utils.go | 389 ------------------ google/utils_test.go | 52 --- google/validation.go | 252 ------------ google/vcr_utils.go | 21 - google/vertex_ai_operation.go | 24 -- scripts/diff.go | 4 +- 147 files changed, 101 insertions(+), 4688 deletions(-) create mode 100644 .changelog/8720.txt delete mode 100644 google/acctest/gcp_sweeper.go delete mode 100644 google/appengine_operation.go delete mode 100644 google/bootstrap_iam_test_utils.go delete mode 100644 google/bootstrap_test_utils.go delete mode 100644 google/cloudfunctions_operation.go delete mode 100644 google/cloudrun_polling.go delete mode 100644 google/common_diff_suppress.go delete mode 100644 google/common_operation.go delete mode 100644 google/common_polling.go delete mode 100644 google/composer_operation.go delete mode 100644 google/compute_operation.go delete mode 100644 google/config.go delete mode 100644 google/config_test_utils.go delete mode 100644 google/container_attached_operation.go delete mode 100644 google/container_operation.go delete mode 100644 google/convert.go delete mode 100644 google/data_source_google_billing_account.go delete mode 100644 google/data_source_google_compute_address.go delete mode 100644 google/data_source_google_service_account_jwt.go delete mode 100644 google/dataproc_cluster_operation.go delete mode 100644 google/dataproc_job_operation.go delete mode 100644 google/datasource_helpers.go delete mode 100644 google/datasource_iam_policy.go delete mode 100644 google/datastream_operation.go delete mode 100644 google/deployment_manager_operation.go delete mode 100644 google/dialogflow_cx_operation.go delete mode 100644 google/error_retry_predicates.go delete mode 100644 google/extract.go delete mode 100644 google/field_helpers.go delete mode 100644 google/framework_test_utils.go delete mode 100644 google/framework_transport.go delete mode 100644 google/framework_utils.go delete mode 100644 google/gcp_sweeper.go delete mode 100644 google/gkeonprem_operation.go delete mode 100644 google/hashcode.go delete mode 100644 google/iam.go delete mode 100644 google/iam_bigquery_dataset.go delete mode 100644 google/iam_bigtable_instance.go delete mode 100644 google/iam_bigtable_table.go delete mode 100644 google/iam_billing_account.go delete mode 100644 google/iam_dataproc_cluster.go delete mode 100644 google/iam_dataproc_job.go delete mode 100644 google/iam_folder.go delete mode 100644 google/iam_organization.go delete mode 100644 google/iam_project.go delete mode 100644 google/image.go delete mode 100644 google/import.go delete mode 100644 google/logging_exclusion_billing_account.go delete mode 100644 google/logging_exclusion_folder.go delete mode 100644 google/logging_exclusion_organization.go delete mode 100644 google/logging_exclusion_project.go delete mode 100644 google/logging_utils.go delete mode 100644 google/metadata.go delete mode 100644 google/network_security_address_group_operation.go delete mode 100644 google/path_or_contents.go delete mode 100644 google/provider_test_utils.go delete mode 100644 google/pubsub_utils.go delete mode 100644 google/regional_utils.go delete mode 100644 google/resource_bigtable_gc_policy.go delete mode 100644 google/resource_bigtable_table.go delete mode 100644 google/resource_cloudfunctions_function.go delete mode 100644 google/resource_compute_attached_disk.go delete mode 100644 google/resource_dataflow_job.go delete mode 100644 google/resource_google_organization_policy.go delete mode 100644 google/resource_google_project.go delete mode 100644 google/resource_iam_audit_config.go delete mode 100644 google/resource_iam_binding.go delete mode 100644 google/resource_iam_member.go delete mode 100644 google/resource_iam_policy.go delete mode 100644 google/resource_logging_exclusion.go delete mode 100644 google/resource_manager_operation.go delete mode 100644 google/resource_service_networking_connection.go delete mode 100644 google/resource_storage_bucket_acl.go delete mode 100644 google/resource_storage_notification.go delete mode 100644 google/retry_utils.go delete mode 100644 google/runadminv3_operation.go delete mode 100644 google/self_link_helpers.go delete mode 100644 google/service_account_waiter.go delete mode 100644 google/service_networking_operation.go delete mode 100644 google/service_scope.go delete mode 100644 google/serviceman_operation.go delete mode 100644 google/sqladmin_operation.go delete mode 100644 google/stateful_mig_polling.go delete mode 100644 google/tags_location_operation.go delete mode 100644 google/test-fixtures/apigateway/api_descriptor.pb delete mode 100644 google/test-fixtures/apigateway/bookstore.proto delete mode 100644 google/test-fixtures/apigateway/openapi.yaml delete mode 100644 google/test-fixtures/apigee/apigee_keystore_alias_test_cert.pem delete mode 100644 google/test-fixtures/apigee/apigee_keystore_alias_test_cert2.pem delete mode 100644 google/test-fixtures/apigee/apigee_keystore_alias_test_key.pem delete mode 100644 google/test-fixtures/apigee/apigee_sharedflow_bundle.zip delete mode 100644 google/test-fixtures/apigee/apigee_sharedflow_bundle2.zip delete mode 100644 google/test-fixtures/apigee/keyStore.p12 delete mode 100644 google/test-fixtures/appengine/hello-world-flask/app.yaml delete mode 100644 google/test-fixtures/appengine/hello-world-flask/main.py delete mode 100644 google/test-fixtures/appengine/hello-world-flask/requirements.txt delete mode 100644 google/test-fixtures/appengine/hello-world.zip delete mode 100644 google/test-fixtures/bigquerytable/avro-generated.avro delete mode 100644 google/test-fixtures/bigquerytable/simple/data/00000-0-4e4a11ad-368c-496b-97ae-e3ac28051a4d-00001.parquet delete mode 100644 google/test-fixtures/bigquerytable/simple/metadata/00000-1114da6b-bb88-4b5a-94bd-370f286c858a.metadata.json delete mode 100644 google/test-fixtures/bigquerytable/test.parquet.gzip delete mode 100644 google/test-fixtures/binauthz/generated_payload.json.tmpl delete mode 100644 google/test-fixtures/certificatemanager/cert.pem delete mode 100644 google/test-fixtures/certificatemanager/private-key.pem delete mode 100644 google/test-fixtures/cloudfunctions/bucket_trigger.js delete mode 100644 google/test-fixtures/cloudfunctions/firestore_trigger.js delete mode 100644 google/test-fixtures/cloudfunctions/http_trigger.js delete mode 100644 google/test-fixtures/cloudfunctions/http_trigger_update.js delete mode 100644 google/test-fixtures/cloudfunctions/pubsub_trigger.js delete mode 100644 google/test-fixtures/cloudfunctions/secret_environment_variables.js delete mode 100644 google/test-fixtures/cloudfunctions/secret_volumes_mount.js delete mode 100644 google/test-fixtures/cloudfunctions2/function-source-eventarc-gcs.zip delete mode 100644 google/test-fixtures/cloudfunctions2/function-source-pubsub.zip delete mode 100644 google/test-fixtures/cloudfunctions2/index-js delete mode 100644 google/test-fixtures/deploymentmanager/service_account.yml.tmpl delete mode 100644 google/test-fixtures/dlp/words.txt delete mode 100644 google/test-fixtures/fake_client.json delete mode 100644 google/test-fixtures/header-logo.png delete mode 100644 google/test-fixtures/rsa_cert.pem delete mode 100644 google/test-fixtures/rsa_csr.pem delete mode 100644 google/test-fixtures/rsa_private_4096.pem delete mode 100644 google/test-fixtures/rsa_public.pem delete mode 100644 google/test-fixtures/serviceaccount/public_key.pem delete mode 100644 google/test-fixtures/ssh_rsa.pub delete mode 100644 google/test-fixtures/ssl_cert/test.crt delete mode 100644 google/test-fixtures/ssl_cert/test.csr delete mode 100644 google/test-fixtures/ssl_cert/test.key delete mode 100644 google/test-fixtures/test_api_descriptor.pb delete mode 100644 google/test-fixtures/workflow.yaml delete mode 100644 google/test_utils.go delete mode 100644 google/transport_test_utils.go delete mode 100644 google/utils.go delete mode 100644 google/utils_test.go delete mode 100644 google/validation.go delete mode 100644 google/vcr_utils.go delete mode 100644 google/vertex_ai_operation.go diff --git a/.changelog/8720.txt b/.changelog/8720.txt new file mode 100644 index 00000000000..8ec013c0699 --- /dev/null +++ b/.changelog/8720.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` diff --git a/google/acctest/bootstrap_iam_test_utils.go b/google/acctest/bootstrap_iam_test_utils.go index 81af4f8fefd..e7bf9edb89c 100644 --- a/google/acctest/bootstrap_iam_test_utils.go +++ b/google/acctest/bootstrap_iam_test_utils.go @@ -94,11 +94,3 @@ func BootstrapPSARoles(t *testing.T, prefix, agentName string, roles []string) b func BootstrapPSARole(t *testing.T, prefix, agentName, role string) bool { return BootstrapPSARoles(t, prefix, agentName, []string{role}) } - -// Returns the bindings that are in the first set of bindings but not the second. -// -// Deprecated: For backward compatibility missingBindings is still working, -// but all new code should use MissingBindings in the tpgiamresource package instead. -func missingBindings(a, b []*cloudresourcemanager.Binding) []*cloudresourcemanager.Binding { - return tpgiamresource.MissingBindings(a, b) -} diff --git a/google/acctest/gcp_sweeper.go b/google/acctest/gcp_sweeper.go deleted file mode 100644 index e0a8a5d4b58..00000000000 --- a/google/acctest/gcp_sweeper.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package acctest - -import ( - "github.com/hashicorp/terraform-provider-google/google/sweeper" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// SharedConfigForRegion returns a common config setup needed for the sweeper -// functions for a given region -// -// Deprecated: For backward compatibility SharedConfigForRegion is still working, -// but all new code should use SharedConfigForRegion in the sweeper package instead. -func SharedConfigForRegion(region string) (*transport_tpg.Config, error) { - return sweeper.SharedConfigForRegion(region) -} - -// Deprecated: For backward compatibility IsSweepableTestResource is still working, -// but all new code should use IsSweepableTestResource in the sweeper package instead. -func IsSweepableTestResource(resourceName string) bool { - return sweeper.IsSweepableTestResource(resourceName) -} diff --git a/google/acctest/provider_test_utils.go b/google/acctest/provider_test_utils.go index af45adbb7f7..045f6517204 100644 --- a/google/acctest/provider_test_utils.go +++ b/google/acctest/provider_test_utils.go @@ -20,86 +20,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -// Deprecated: For backward compatibility TestEnvVar is still working, -// but all new code should use TestEnvVar in the envvar package instead. -const TestEnvVar = envvar.TestEnvVar - -// Deprecated: For backward compatibility CredsEnvVars is still working, -// but all new code should use CredsEnvVars in the envvar package instead. -var CredsEnvVars = envvar.CredsEnvVars - -// Deprecated: For backward compatibility ProjectNumberEnvVars is still working, -// but all new code should use ProjectNumberEnvVars in the envvar package instead. -var ProjectNumberEnvVars = envvar.ProjectNumberEnvVars - -// Deprecated: For backward compatibility ProjectEnvVars is still working, -// but all new code should use ProjectEnvVars in the envvar package instead. -var ProjectEnvVars = envvar.ProjectEnvVars - -// Deprecated: For backward compatibility FirestoreProjectEnvVars is still working, -// but all new code should use FirestoreProjectEnvVars in the envvar package instead. -var FirestoreProjectEnvVars = envvar.FirestoreProjectEnvVars - -// Deprecated: For backward compatibility RegionEnvVars is still working, -// but all new code should use RegionEnvVars in the envvar package instead. -var RegionEnvVars = envvar.RegionEnvVars - -// Deprecated: For backward compatibility ZoneEnvVars is still working, -// but all new code should use ZoneEnvVars in the envvar package instead. -var ZoneEnvVars = envvar.ZoneEnvVars - -// Deprecated: For backward compatibility OrgEnvVars is still working, -// but all new code should use OrgEnvVars in the envvar package instead. -var OrgEnvVars = envvar.OrgEnvVars - -// This value is the Customer ID of the GOOGLE_ORG_DOMAIN workspace. -// See https://admin.google.com/ac/accountsettings when logged into an org admin for the value. -// -// Deprecated: For backward compatibility CustIdEnvVars is still working, -// but all new code should use CustIdEnvVars in the envvar package instead. -var CustIdEnvVars = envvar.CustIdEnvVars - -// This value is the username of an identity account within the GOOGLE_ORG_DOMAIN workspace. -// For example in the org example.com with a user "foo@example.com", this would be set to "foo". -// See https://admin.google.com/ac/users when logged into an org admin for a list. -// -// Deprecated: For backward compatibility IdentityUserEnvVars is still working, -// but all new code should use IdentityUserEnvVars in the envvar package instead. -var IdentityUserEnvVars = envvar.IdentityUserEnvVars - -// Deprecated: For backward compatibility OrgEnvDomainVars is still working, -// but all new code should use OrgEnvDomainVars in the envvar package instead. -var OrgEnvDomainVars = envvar.OrgEnvDomainVars - -// Deprecated: For backward compatibility ServiceAccountEnvVars is still working, -// but all new code should use ServiceAccountEnvVars in the envvar package instead. -var ServiceAccountEnvVars = envvar.ServiceAccountEnvVars - -// Deprecated: For backward compatibility OrgTargetEnvVars is still working, -// but all new code should use OrgTargetEnvVars in the envvar package instead. -var OrgTargetEnvVars = envvar.OrgTargetEnvVars - -// This is the billing account that will be charged for the infrastructure used during testing. For -// that reason, it is also the billing account used for creating new projects. -// -// Deprecated: For backward compatibility BillingAccountEnvVars is still working, -// but all new code should use BillingAccountEnvVars in the envvar package instead. -var BillingAccountEnvVars = envvar.BillingAccountEnvVars - -// This is the billing account that will be modified to test billing-related functionality. It is -// expected to have more permissions granted to the test user and support subaccounts. -// -// Deprecated: For backward compatibility MasterBillingAccountEnvVars is still working, -// but all new code should use MasterBillingAccountEnvVars in the envvar package instead. -var MasterBillingAccountEnvVars = envvar.MasterBillingAccountEnvVars - -// This value is the description used for test PublicAdvertisedPrefix setup to avoid required DNS -// setup. This is only used during integration tests and would be invalid to surface to users -// -// Deprecated: For backward compatibility PapDescriptionEnvVars is still working, -// but all new code should use PapDescriptionEnvVars in the envvar package instead. -var PapDescriptionEnvVars = envvar.PapDescriptionEnvVars - var TestAccProviders map[string]*schema.Provider var testAccProvider *schema.Provider @@ -136,20 +56,20 @@ func AccTestPreCheck(t *testing.T) { os.Setenv("GOOGLE_CREDENTIALS", string(creds)) } - if v := transport_tpg.MultiEnvSearch(CredsEnvVars); v == "" { - t.Fatalf("One of %s must be set for acceptance tests", strings.Join(CredsEnvVars, ", ")) + if v := transport_tpg.MultiEnvSearch(envvar.CredsEnvVars); v == "" { + t.Fatalf("One of %s must be set for acceptance tests", strings.Join(envvar.CredsEnvVars, ", ")) } - if v := transport_tpg.MultiEnvSearch(ProjectEnvVars); v == "" { - t.Fatalf("One of %s must be set for acceptance tests", strings.Join(ProjectEnvVars, ", ")) + if v := transport_tpg.MultiEnvSearch(envvar.ProjectEnvVars); v == "" { + t.Fatalf("One of %s must be set for acceptance tests", strings.Join(envvar.ProjectEnvVars, ", ")) } - if v := transport_tpg.MultiEnvSearch(RegionEnvVars); v == "" { - t.Fatalf("One of %s must be set for acceptance tests", strings.Join(RegionEnvVars, ", ")) + if v := transport_tpg.MultiEnvSearch(envvar.RegionEnvVars); v == "" { + t.Fatalf("One of %s must be set for acceptance tests", strings.Join(envvar.RegionEnvVars, ", ")) } - if v := transport_tpg.MultiEnvSearch(ZoneEnvVars); v == "" { - t.Fatalf("One of %s must be set for acceptance tests", strings.Join(ZoneEnvVars, ", ")) + if v := transport_tpg.MultiEnvSearch(envvar.ZoneEnvVars); v == "" { + t.Fatalf("One of %s must be set for acceptance tests", strings.Join(envvar.ZoneEnvVars, ", ")) } } @@ -175,125 +95,6 @@ func GetTestProject(is *terraform.InstanceState, config *transport_tpg.Config) ( return "", fmt.Errorf("%q: required field is not set", "project") } -// AccTestPreCheck ensures at least one of the project env variables is set. -// -// Deprecated: For backward compatibility GetTestProjectNumberFromEnv is still working, -// but all new code should use GetTestProjectNumberFromEnv in the envvar package instead. -func GetTestProjectNumberFromEnv() string { - return envvar.GetTestProjectNumberFromEnv() -} - -// AccTestPreCheck ensures at least one of the project env variables is set. -// -// Deprecated: For backward compatibility GetTestProjectFromEnv is still working, -// but all new code should use GetTestProjectFromEnv in the envvar package instead. -func GetTestProjectFromEnv() string { - return envvar.GetTestProjectFromEnv() -} - -// AccTestPreCheck ensures at least one of the credentials env variables is set. -// -// Deprecated: For backward compatibility GetTestCredsFromEnv is still working, -// but all new code should use GetTestCredsFromEnv in the envvar package instead. -func GetTestCredsFromEnv() string { - return envvar.GetTestCredsFromEnv() -} - -// AccTestPreCheck ensures at least one of the region env variables is set. -// -// Deprecated: For backward compatibility GetTestRegionFromEnv is still working, -// but all new code should use GetTestRegionFromEnv in the envvar package instead. -func GetTestRegionFromEnv() string { - return envvar.GetTestRegionFromEnv() -} - -// Deprecated: For backward compatibility GetTestZoneFromEnv is still working, -// but all new code should use GetTestZoneFromEnv in the envvar package instead. -func GetTestZoneFromEnv() string { - return envvar.GetTestZoneFromEnv() -} - -// Deprecated: For backward compatibility GetTestCustIdFromEnv is still working, -// but all new code should use GetTestCustIdFromEnv in the envvar package instead. -func GetTestCustIdFromEnv(t *testing.T) string { - return envvar.GetTestCustIdFromEnv(t) -} - -// Deprecated: For backward compatibility GetTestIdentityUserFromEnv is still working, -// but all new code should use GetTestIdentityUserFromEnv in the envvar package instead. -func GetTestIdentityUserFromEnv(t *testing.T) string { - return envvar.GetTestIdentityUserFromEnv(t) -} - -// Firestore can't be enabled at the same time as Datastore, so we need a new -// project to manage it until we can enable Firestore programmatically. -// -// Deprecated: For backward compatibility GetTestFirestoreProjectFromEnv is still working, -// but all new code should use GetTestFirestoreProjectFromEnv in the envvar package instead. -func GetTestFirestoreProjectFromEnv(t *testing.T) string { - return envvar.GetTestFirestoreProjectFromEnv(t) -} - -// Returns the raw organization id like 1234567890, skipping the test if one is -// not found. -// -// Deprecated: For backward compatibility GetTestOrgFromEnv is still working, -// but all new code should use GetTestOrgFromEnv in the envvar package instead. -func GetTestOrgFromEnv(t *testing.T) string { - return envvar.GetTestOrgFromEnv(t) -} - -// Alternative to GetTestOrgFromEnv that doesn't need *testing.T -// If using this, you need to process unset values at the call site -// -// Deprecated: For backward compatibility UnsafeGetTestOrgFromEnv is still working, -// but all new code should use UnsafeGetTestOrgFromEnv in the envvar package instead. -func UnsafeGetTestOrgFromEnv() string { - return envvar.UnsafeGetTestOrgFromEnv() -} - -// Deprecated: For backward compatibility GetTestOrgDomainFromEnv is still working, -// but all new code should use GetTestOrgDomainFromEnv in the envvar package instead. -func GetTestOrgDomainFromEnv(t *testing.T) string { - return envvar.GetTestOrgDomainFromEnv(t) -} - -// Deprecated: For backward compatibility GetTestOrgTargetFromEnv is still working, -// but all new code should use GetTestOrgTargetFromEnv in the envvar package instead. -func GetTestOrgTargetFromEnv(t *testing.T) string { - return envvar.GetTestOrgTargetFromEnv(t) -} - -// This is the billing account that will be charged for the infrastructure used during testing. For -// that reason, it is also the billing account used for creating new projects. -// -// Deprecated: For backward compatibility GetTestBillingAccountFromEnv is still working, -// but all new code should use GetTestBillingAccountFromEnv in the envvar package instead. -func GetTestBillingAccountFromEnv(t *testing.T) string { - return envvar.GetTestBillingAccountFromEnv(t) -} - -// This is the billing account that will be modified to test billing-related functionality. It is -// expected to have more permissions granted to the test user and support subaccounts. -// -// Deprecated: For backward compatibility GetTestMasterBillingAccountFromEnv is still working, -// but all new code should use GetTestMasterBillingAccountFromEnv in the envvar package instead. -func GetTestMasterBillingAccountFromEnv(t *testing.T) string { - return envvar.GetTestMasterBillingAccountFromEnv(t) -} - -// Deprecated: For backward compatibility GetTestServiceAccountFromEnv is still working, -// but all new code should use GetTestServiceAccountFromEnv in the envvar package instead. -func GetTestServiceAccountFromEnv(t *testing.T) string { - return envvar.GetTestServiceAccountFromEnv(t) -} - -// Deprecated: For backward compatibility GetTestPublicAdvertisedPrefixDescriptionFromEnv is still working, -// but all new code should use GetTestPublicAdvertisedPrefixDescriptionFromEnv in the envvar package instead. -func GetTestPublicAdvertisedPrefixDescriptionFromEnv(t *testing.T) string { - return envvar.GetTestPublicAdvertisedPrefixDescriptionFromEnv(t) -} - // Some tests fail during VCR. One common case is race conditions when creating resources. // If a test config adds two fine-grained resources with the same parent it is undefined // which will be created first, causing VCR to fail ~50% of the time @@ -309,9 +110,3 @@ func SleepInSecondsForTest(t int) resource.TestCheckFunc { return nil } } - -// Deprecated: For backward compatibility SkipIfEnvNotSet is still working, -// but all new code should use SkipIfEnvNotSet in the envvar package instead. -func SkipIfEnvNotSet(t *testing.T, envs ...string) { - envvar.SkipIfEnvNotSet(t, envs...) -} diff --git a/google/appengine_operation.go b/google/appengine_operation.go deleted file mode 100644 index cbe4c936386..00000000000 --- a/google/appengine_operation.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/appengine" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Deprecated: For backward compatibility AppEngineOperationWaitTimeWithResponse is still working, -// but all new code should use AppEngineOperationWaitTimeWithResponse in the appengine package instead. -func AppEngineOperationWaitTimeWithResponse(config *transport_tpg.Config, res interface{}, response *map[string]interface{}, appId, activity, userAgent string, timeout time.Duration) error { - return appengine.AppEngineOperationWaitTimeWithResponse(config, res, response, appId, activity, userAgent, timeout) -} - -// Deprecated: For backward compatibility AppEngineOperationWaitTime is still working, -// but all new code should use AppEngineOperationWaitTime in the appengine package instead. -func AppEngineOperationWaitTime(config *transport_tpg.Config, res interface{}, appId, activity, userAgent string, timeout time.Duration) error { - return appengine.AppEngineOperationWaitTime(config, res, appId, activity, userAgent, timeout) -} diff --git a/google/bootstrap_iam_test_utils.go b/google/bootstrap_iam_test_utils.go deleted file mode 100644 index 719e24c02f1..00000000000 --- a/google/bootstrap_iam_test_utils.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "testing" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" - cloudresourcemanager "google.golang.org/api/cloudresourcemanager/v1" -) - -// BootstrapAllPSARoles ensures that the given project's IAM -// policy grants the given service agents the given roles. -// prefix is usually "service-" and indicates the service agent should have the -// given prefix before the project number. -// This is important to bootstrap because using iam policy resources means that -// deleting them removes permissions for concurrent tests. -// Return whether the bindings changed. -func BootstrapAllPSARoles(t *testing.T, prefix string, agentNames, roles []string) bool { - return acctest.BootstrapAllPSARoles(t, prefix, agentNames, roles) -} - -// BootstrapAllPSARole is a version of BootstrapAllPSARoles for granting a -// single role to multiple service agents. -func BootstrapAllPSARole(t *testing.T, prefix string, agentNames []string, role string) bool { - return acctest.BootstrapAllPSARole(t, prefix, agentNames, role) -} - -// BootstrapPSARoles is a version of BootstrapAllPSARoles for granting roles to -// a single service agent. -func BootstrapPSARoles(t *testing.T, prefix, agentName string, roles []string) bool { - return acctest.BootstrapPSARoles(t, prefix, agentName, roles) -} - -// BootstrapPSARole is a simplified version of BootstrapPSARoles for granting a -// single role to a single service agent. -func BootstrapPSARole(t *testing.T, prefix, agentName, role string) bool { - return acctest.BootstrapPSARole(t, prefix, agentName, role) -} - -// Returns the bindings that are in the first set of bindings but not the second. -// -// Deprecated: For backward compatibility missingBindings is still working, -// but all new code should use MissingBindings in the tpgiamresource package instead. -func missingBindings(a, b []*cloudresourcemanager.Binding) []*cloudresourcemanager.Binding { - return tpgiamresource.MissingBindings(a, b) -} diff --git a/google/bootstrap_test_utils.go b/google/bootstrap_test_utils.go deleted file mode 100644 index 86c5ec33281..00000000000 --- a/google/bootstrap_test_utils.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "testing" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - - cloudresourcemanager "google.golang.org/api/cloudresourcemanager/v1" -) - -type BootstrappedKMS = acctest.BootstrappedKMS - -func BootstrapKMSKey(t *testing.T) acctest.BootstrappedKMS { - return acctest.BootstrapKMSKey(t) -} - -func BootstrapKMSKeyInLocation(t *testing.T, locationID string) acctest.BootstrappedKMS { - return acctest.BootstrapKMSKeyInLocation(t, locationID) -} - -// BootstrapKMSKeyWithPurpose returns a KMS key in the "global" location. -// See BootstrapKMSKeyWithPurposeInLocation. -func BootstrapKMSKeyWithPurpose(t *testing.T, purpose string) acctest.BootstrappedKMS { - return acctest.BootstrapKMSKeyWithPurpose(t, purpose) -} - -/** -* BootstrapKMSKeyWithPurposeInLocation will return a KMS key in a -* particular location with the given purpose that can be used -* in tests that are testing KMS integration with other resources. -* -* This will either return an existing key or create one if it hasn't been created -* in the project yet. The motivation is because keyrings don't get deleted and we -* don't want a linear growth of disabled keyrings in a project. We also don't want -* to incur the overhead of creating a new project for each test that needs to use -* a KMS key. -**/ -func BootstrapKMSKeyWithPurposeInLocation(t *testing.T, purpose, locationID string) acctest.BootstrappedKMS { - return acctest.BootstrapKMSKeyWithPurposeInLocation(t, purpose, locationID) -} - -func BootstrapKMSKeyWithPurposeInLocationAndName(t *testing.T, purpose, locationID, keyShortName string) acctest.BootstrappedKMS { - return acctest.BootstrapKMSKeyWithPurposeInLocationAndName(t, purpose, locationID, keyShortName) -} - -func BootstrapServiceAccount(t *testing.T, project, testRunner string) string { - return acctest.BootstrapServiceAccount(t, project, testRunner) -} - -func BootstrapSharedTestADDomain(t *testing.T, testId string, networkName string) string { - return acctest.BootstrapSharedTestADDomain(t, testId, networkName) -} - -// BootstrapSharedTestNetwork will return a persistent compute network for a -// test or set of tests. -// -// Resources like service_networking_connection use a consumer network and -// create a complementing tenant network which we don't control. These tenant -// networks never get cleaned up and they can accumulate to the point where a -// limit is reached for the organization. By reusing a consumer network across -// test runs, we can reduce the number of tenant networks that are needed. -// See b/146351146 for more context. -// -// testId specifies the test for which a shared network is used/initialized. -// Note that if the network is being used for a service_networking_connection, -// the same testId should generally not be used across tests, to avoid race -// conditions where multiple tests attempt to modify the connection at once. -// -// Returns the name of a network, creating it if it hasn't been created in the -// test project. -func BootstrapSharedTestNetwork(t *testing.T, testId string) string { - return acctest.BootstrapSharedTestNetwork(t, testId) -} - -func BootstrapServicePerimeterProjects(t *testing.T, desiredProjects int) []*cloudresourcemanager.Project { - return acctest.BootstrapServicePerimeterProjects(t, desiredProjects) -} - -func RemoveContainerServiceAgentRoleFromContainerEngineRobot(t *testing.T, project *cloudresourcemanager.Project) { - acctest.RemoveContainerServiceAgentRoleFromContainerEngineRobot(t, project) -} - -// BootstrapProject will create or get a project named -// "" that will persist across test runs, -// where projectIDSuffix is based off of getTestProjectFromEnv(). The reason -// for the naming is to isolate bootstrapped projects by test environment. -// Given the existing projects being used by our team, the prefix provided to -// this function can be no longer than 18 characters. -func BootstrapProject(t *testing.T, projectIDPrefix, billingAccount string, services []string) *cloudresourcemanager.Project { - return acctest.BootstrapProject(t, projectIDPrefix, billingAccount, services) -} - -// BootstrapConfig returns a Config pulled from the environment. -func BootstrapConfig(t *testing.T) *transport_tpg.Config { - return acctest.BootstrapConfig(t) -} - -// BootstrapSharedSQLInstanceBackupRun will return a shared SQL db instance that -// has a backup created for it. -func BootstrapSharedSQLInstanceBackupRun(t *testing.T) string { - return acctest.BootstrapSharedSQLInstanceBackupRun(t) -} - -func BootstrapSharedCaPoolInLocation(t *testing.T, location string) string { - return acctest.BootstrapSharedCaPoolInLocation(t, location) -} - -func BootstrapSubnet(t *testing.T, subnetName string, networkName string) string { - return acctest.BootstrapSubnet(t, subnetName, networkName) -} - -func BootstrapNetworkAttachment(t *testing.T, networkAttachmentName string, subnetName string) string { - return acctest.BootstrapNetworkAttachment(t, networkAttachmentName, subnetName) -} - -func setupProjectsAndGetAccessToken(org, billing, pid, service string, config *transport_tpg.Config) (string, error) { - return acctest.SetupProjectsAndGetAccessToken(org, billing, pid, service, config) -} diff --git a/google/cloudfunctions_operation.go b/google/cloudfunctions_operation.go deleted file mode 100644 index bd860cf6e46..00000000000 --- a/google/cloudfunctions_operation.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - tpgcloudfunctions "github.com/hashicorp/terraform-provider-google/google/services/cloudfunctions" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - "google.golang.org/api/cloudfunctions/v1" -) - -// Deprecated: For backward compatibility cloudFunctionsOperationWait is still working, -// but all new code should use CloudFunctionsOperationWait in the tpgcloudfunctions package instead. -func cloudFunctionsOperationWait(config *transport_tpg.Config, op *cloudfunctions.Operation, activity, userAgent string, timeout time.Duration) error { - return tpgcloudfunctions.CloudFunctionsOperationWait(config, op, activity, userAgent, timeout) -} - -// Deprecated: For backward compatibility IsCloudFunctionsSourceCodeError is still working, -// but all new code should use IsCloudFunctionsSourceCodeError in the tpgcloudfunctions package instead. -func IsCloudFunctionsSourceCodeError(err error) (bool, string) { - return tpgcloudfunctions.IsCloudFunctionsSourceCodeError(err) -} diff --git a/google/cloudrun_polling.go b/google/cloudrun_polling.go deleted file mode 100644 index 5f7bf0dcdb7..00000000000 --- a/google/cloudrun_polling.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/cloudrun" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Deprecated: For backward compatibility PollCheckKnativeStatusFunc is still working, -// but all new code should use PollCheckKnativeStatusFunc in the cloudrun package instead. -func PollCheckKnativeStatusFunc(knativeRestResponse map[string]interface{}) func(resp map[string]interface{}, respErr error) transport_tpg.PollResult { - return cloudrun.PollCheckKnativeStatusFunc(knativeRestResponse) -} diff --git a/google/common_diff_suppress.go b/google/common_diff_suppress.go deleted file mode 100644 index 5849e3034c3..00000000000 --- a/google/common_diff_suppress.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -// Contains common diff suppress functions. - -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" -) - -// Deprecated: For backward compatibility OptionalPrefixSuppress is still working, -// but all new code should use OptionalPrefixSuppress in the tpgresource package instead. -func OptionalPrefixSuppress(prefix string) schema.SchemaDiffSuppressFunc { - return tpgresource.OptionalPrefixSuppress(prefix) -} - -// Deprecated: For backward compatibility IgnoreMissingKeyInMap is still working, -// but all new code should use IgnoreMissingKeyInMap in the tpgresource package instead. -func IgnoreMissingKeyInMap(key string) schema.SchemaDiffSuppressFunc { - return tpgresource.IgnoreMissingKeyInMap(key) -} - -// Deprecated: For backward compatibility OptionalSurroundingSpacesSuppress is still working, -// but all new code should use OptionalSurroundingSpacesSuppress in the tpgresource package instead. -func OptionalSurroundingSpacesSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.OptionalSurroundingSpacesSuppress(k, old, new, d) -} - -// Deprecated: For backward compatibility EmptyOrDefaultStringSuppress is still working, -// but all new code should use EmptyOrDefaultStringSuppress in the tpgresource package instead. -func EmptyOrDefaultStringSuppress(defaultVal string) schema.SchemaDiffSuppressFunc { - return tpgresource.EmptyOrDefaultStringSuppress(defaultVal) -} - -// Deprecated: For backward compatibility IpCidrRangeDiffSuppress is still working, -// but all new code should use IpCidrRangeDiffSuppress in the tpgresource package instead. -func IpCidrRangeDiffSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.IpCidrRangeDiffSuppress(k, old, new, d) -} - -// Deprecated: For backward compatibility Sha256DiffSuppress is still working, -// but all new code should use Sha256DiffSuppress in the tpgresource package instead. -// Sha256DiffSuppress -// if old is the hex-encoded sha256 sum of new, treat them as equal -func Sha256DiffSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.Sha256DiffSuppress(k, old, new, d) -} - -// Deprecated: For backward compatibility CaseDiffSuppress is still working, -// but all new code should use CaseDiffSuppress in the tpgresource package instead. -func CaseDiffSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.CaseDiffSuppress(k, old, new, d) -} - -// Deprecated: For backward compatibility PortRangeDiffSuppress is still working, -// but all new code should use PortRangeDiffSuppress in the tpgresource package instead. -// Port range '80' and '80-80' is equivalent. -// `old` is read from the server and always has the full range format (e.g. '80-80', '1024-2048'). -// `new` can be either a single port or a port range. -func PortRangeDiffSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.PortRangeDiffSuppress(k, old, new, d) -} - -// Deprecated: For backward compatibility Rfc3339TimeDiffSuppress is still working, -// but all new code should use Rfc3339TimeDiffSuppress in the tpgresource package instead. -// Single-digit hour is equivalent to hour with leading zero e.g. suppress diff 1:00 => 01:00. -// Assume either value could be in either format. -func Rfc3339TimeDiffSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.Rfc3339TimeDiffSuppress(k, old, new, d) -} - -// Deprecated: For backward compatibility EmptyOrUnsetBlockDiffSuppress is still working, -// but all new code should use EmptyOrUnsetBlockDiffSuppress in the tpgresource package instead. -// Suppress diffs for blocks where one version is completely unset and the other is set -// to an empty block. This might occur in situations where removing a block completely -// is impossible (if it's computed or part of an AtLeastOneOf), so instead the user sets -// its values to empty. -// NOTE: Using Optional + Computed is *strongly* preferred to this DSF, as it's -// more well understood and resilient to API changes. -func EmptyOrUnsetBlockDiffSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.EmptyOrUnsetBlockDiffSuppress(k, old, new, d) -} - -// Deprecated: For backward compatibility EmptyOrUnsetBlockDiffSuppressLogic is still working, -// but all new code should use EmptyOrUnsetBlockDiffSuppressLogic in the tpgresource package instead. -// The core logic for EmptyOrUnsetBlockDiffSuppress, in a format that is more conducive -// to unit testing. -func EmptyOrUnsetBlockDiffSuppressLogic(k, old, new string, o, n interface{}) bool { - return tpgresource.EmptyOrUnsetBlockDiffSuppressLogic(k, old, new, o, n) -} - -// Deprecated: For backward compatibility LocationDiffSuppress is still working, -// but all new code should use LocationDiffSuppress in the tpgresource package instead. -// Suppress diffs for values that are equivalent except for their use of the words "location" -// compared to "region" or "zone" -func LocationDiffSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.LocationDiffSuppress(k, old, new, d) -} - -// Deprecated: For backward compatibility locationDiffSuppressHelper is still working, -// but all new code should use LocationDiffSuppressHelper in the tpgresource package instead. -func locationDiffSuppressHelper(a, b string) bool { - return tpgresource.LocationDiffSuppressHelper(a, b) -} - -// Deprecated: For backward compatibility AbsoluteDomainSuppress is still working, -// but all new code should use AbsoluteDomainSuppress in the tpgresource package instead. -// For managed SSL certs, if new is an absolute FQDN (trailing '.') but old isn't, treat them as equals. -func AbsoluteDomainSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.AbsoluteDomainSuppress(k, old, new, d) -} - -// Deprecated: For backward compatibility TimestampDiffSuppress is still working, -// but all new code should use TimestampDiffSuppress in the tpgresource package instead. -func TimestampDiffSuppress(format string) schema.SchemaDiffSuppressFunc { - return tpgresource.TimestampDiffSuppress(format) -} - -// Deprecated: For backward compatibility InternalIpDiffSuppress is still working, -// but all new code should use InternalIpDiffSuppress in the tpgresource package instead. -// suppress diff when saved is Ipv4 format while new is required a reference -// this happens for an internal ip for Private Services Connect -func InternalIpDiffSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.InternalIpDiffSuppress(k, old, new, d) -} - -// Deprecated: For backward compatibility DurationDiffSuppress is still working, -// but all new code should use DurationDiffSuppress in the tpgresource package instead. -// Suppress diffs for duration format. ex "60.0s" and "60s" same -// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#duration -func DurationDiffSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.DurationDiffSuppress(k, old, new, d) -} - -// Use this method when the field accepts either an IP address or a -// self_link referencing a resource (such as google_compute_route's -// next_hop_ilb) -// -// Deprecated: For backward compatibility CompareIpAddressOrSelfLinkOrResourceName is still working, -// but all new code should use CompareIpAddressOrSelfLinkOrResourceName in the tpgresource package instead. -func CompareIpAddressOrSelfLinkOrResourceName(_, old, new string, _ *schema.ResourceData) bool { - return tpgresource.CompareIpAddressOrSelfLinkOrResourceName("", old, new, nil) -} - -// Use this method when subnet is optioanl and auto_create_subnetworks = true -// API sometimes choose a subnet so the diff needs to be ignored -// -// Deprecated: For backward compatibility CompareOptionalSubnet is still working, -// but all new code should use CompareOptionalSubnet in the tpgresource package instead. -func CompareOptionalSubnet(_, old, new string, _ *schema.ResourceData) bool { - return tpgresource.CompareOptionalSubnet("", old, new, nil) -} - -// Deprecated: For backward compatibility LastSlashDiffSuppress is still working, -// but all new code should use LastSlashDiffSuppress in the tpgresource package instead. -// Suppress diffs in below cases -// "https://hello-rehvs75zla-uc.a.run.app/" -> "https://hello-rehvs75zla-uc.a.run.app" -// "https://hello-rehvs75zla-uc.a.run.app" -> "https://hello-rehvs75zla-uc.a.run.app/" -func LastSlashDiffSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.LastSlashDiffSuppress(k, old, new, d) -} - -// Deprecated: For backward compatibility ProjectNumberDiffSuppress is still working, -// but all new code should use ProjectNumberDiffSuppress in the tpgresource package instead. -// Suppress diffs when the value read from api -// has the project number instead of the project name -func ProjectNumberDiffSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.ProjectNumberDiffSuppress(k, old, new, d) -} - -func compareCryptoKeyVersions(_, old, new string, _ *schema.ResourceData) bool { - return tpgresource.CompareCryptoKeyVersions("", old, new, nil) -} - -func cidrOrSizeDiffSuppress(k, old, new string, d *schema.ResourceData) bool { - return tpgresource.CidrOrSizeDiffSuppress(k, old, new, d) -} diff --git a/google/common_operation.go b/google/common_operation.go deleted file mode 100644 index 4b67c0df1cf..00000000000 --- a/google/common_operation.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" -) - -// Deprecated: For backward compatibility CommonRefreshFunc is still working, -// but all new code should use CommonRefreshFunc in the tpgresource package instead. -func CommonRefreshFunc(w tpgresource.Waiter) resource.StateRefreshFunc { - return tpgresource.CommonRefreshFunc(w) -} - -// Deprecated: For backward compatibility OperationWait is still working, -// but all new code should use OperationWait in the tpgresource package instead. -func OperationWait(w tpgresource.Waiter, activity string, timeout time.Duration, pollInterval time.Duration) error { - return tpgresource.OperationWait(w, activity, timeout, pollInterval) -} diff --git a/google/common_polling.go b/google/common_polling.go deleted file mode 100644 index 06bfe5ee96d..00000000000 --- a/google/common_polling.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Helper functions to construct result of single pollRead as return result for a PollCheckResponseFunc -// -// Deprecated: For backward compatibility ErrorPollResult is still working, -// but all new code should use ErrorPollResult in the transport_tpg package instead. -func ErrorPollResult(err error) transport_tpg.PollResult { - return transport_tpg.ErrorPollResult(err) -} - -// Deprecated: For backward compatibility PendingStatusPollResult is still working, -// but all new code should use PendingStatusPollResult in the transport_tpg package instead. -func PendingStatusPollResult(status string) transport_tpg.PollResult { - return transport_tpg.PendingStatusPollResult(status) -} - -// Deprecated: For backward compatibility SuccessPollResult is still working, -// but all new code should use SuccessPollResult in the transport_tpg package instead. -func SuccessPollResult() transport_tpg.PollResult { - return transport_tpg.SuccessPollResult() -} - -// Deprecated: For backward compatibility PollingWaitTime is still working, -// but all new code should use PollingWaitTime in the transport_tpg package instead. -func PollingWaitTime(pollF transport_tpg.PollReadFunc, checkResponse transport_tpg.PollCheckResponseFunc, activity string, - timeout time.Duration, targetOccurrences int) error { - return transport_tpg.PollingWaitTime(pollF, checkResponse, activity, timeout, targetOccurrences) -} - -// RetryWithTargetOccurrences is a basic wrapper around StateChangeConf that will retry -// a function until it returns the specified amount of target occurrences continuously. -// Adapted from the Retry function in the go SDK. -// -// Deprecated: For backward compatibility RetryWithTargetOccurrences is still working, -// but all new code should use RetryWithTargetOccurrences in the transport_tpg package instead. -func RetryWithTargetOccurrences(timeout time.Duration, targetOccurrences int, - f resource.RetryFunc) error { - return transport_tpg.RetryWithTargetOccurrences(timeout, targetOccurrences, f) -} - -/** - * Common PollCheckResponseFunc implementations - */ - -// PollCheckForExistence waits for a successful response, continues polling on 404, -// and returns any other error. -// -// Deprecated: For backward compatibility PollCheckForExistence is still working, -// but all new code should use PollCheckForExistence in the transport_tpg package instead. -func PollCheckForExistence(_ map[string]interface{}, respErr error) transport_tpg.PollResult { - return transport_tpg.PollCheckForExistence(nil, respErr) -} - -// PollCheckForExistenceWith403 waits for a successful response, continues polling on 404 or 403, -// and returns any other error. -// -// Deprecated: For backward compatibility PollCheckForExistenceWith403 is still working, -// but all new code should use PollCheckForExistenceWith403 in the transport_tpg package instead. -func PollCheckForExistenceWith403(_ map[string]interface{}, respErr error) transport_tpg.PollResult { - return transport_tpg.PollCheckForExistenceWith403(nil, respErr) -} - -// PollCheckForAbsence waits for a 404/403 response, continues polling on a successful -// response, and returns any other error. -// -// Deprecated: For backward compatibility PollCheckForAbsenceWith403 is still working, -// but all new code should use PollCheckForAbsenceWith403 in the transport_tpg package instead. -func PollCheckForAbsenceWith403(_ map[string]interface{}, respErr error) transport_tpg.PollResult { - return transport_tpg.PollCheckForAbsenceWith403(nil, respErr) -} - -// PollCheckForAbsence waits for a 404 response, continues polling on a successful -// response, and returns any other error. -// -// Deprecated: For backward compatibility PollCheckForAbsence is still working, -// but all new code should use PollCheckForAbsence in the transport_tpg package instead. -func PollCheckForAbsence(_ map[string]interface{}, respErr error) transport_tpg.PollResult { - return transport_tpg.PollCheckForAbsence(nil, respErr) -} diff --git a/google/composer_operation.go b/google/composer_operation.go deleted file mode 100644 index 7f403a0394a..00000000000 --- a/google/composer_operation.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - tpgcomposer "github.com/hashicorp/terraform-provider-google/google/services/composer" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - - "google.golang.org/api/composer/v1" -) - -// Deprecated: For backward compatibility ComposerOperationWaitTime is still working, -// but all new code should use ComposerOperationWaitTime in the tpgcomposer package instead. -func ComposerOperationWaitTime(config *transport_tpg.Config, op *composer.Operation, project, activity, userAgent string, timeout time.Duration) error { - return tpgcomposer.ComposerOperationWaitTime(config, op, project, activity, userAgent, timeout) -} diff --git a/google/compute_operation.go b/google/compute_operation.go deleted file mode 100644 index d943e672292..00000000000 --- a/google/compute_operation.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/compute" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Deprecated: For backward compatibility ComputeOperationWaitTime is still working, -// but all new code should use ComputeOperationWaitTime in the compute package instead. -func ComputeOperationWaitTime(config *transport_tpg.Config, res interface{}, project, activity, userAgent string, timeout time.Duration) error { - return compute.ComputeOperationWaitTime(config, res, project, activity, userAgent, timeout) -} diff --git a/google/config.go b/google/config.go deleted file mode 100644 index 6924fc418a5..00000000000 --- a/google/config.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Deprecated: For backward compatibility MultiEnvSearch is still working, -// but all new code should use MultiEnvSearch in the transport_tpg package instead. -func MultiEnvSearch(ks []string) string { - return transport_tpg.MultiEnvSearch(ks) -} diff --git a/google/config_test_utils.go b/google/config_test_utils.go deleted file mode 100644 index 5a77affffed..00000000000 --- a/google/config_test_utils.go +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - "net/http/httptest" - "strings" -) - -const testFakeCredentialsPath = "./test-fixtures/fake_account.json" - -// NewTestConfig create a config using the http test server. -func NewTestConfig(server *httptest.Server) *transport_tpg.Config { - cfg := &transport_tpg.Config{} - cfg.Client = server.Client() - configureTestBasePaths(cfg, server.URL) - return cfg -} - -func configureTestBasePaths(c *transport_tpg.Config, url string) { - if !strings.HasSuffix(url, "/") { - url = url + "/" - } - // Generated Products - c.AccessApprovalBasePath = url - c.AccessContextManagerBasePath = url - c.ActiveDirectoryBasePath = url - c.AlloydbBasePath = url - c.ApigeeBasePath = url - c.AppEngineBasePath = url - c.ArtifactRegistryBasePath = url - c.BeyondcorpBasePath = url - c.BigQueryBasePath = url - c.BigqueryAnalyticsHubBasePath = url - c.BigqueryConnectionBasePath = url - c.BigqueryDatapolicyBasePath = url - c.BigqueryDataTransferBasePath = url - c.BigqueryReservationBasePath = url - c.BigtableBasePath = url - c.BillingBasePath = url - c.BinaryAuthorizationBasePath = url - c.CertificateManagerBasePath = url - c.CloudAssetBasePath = url - c.CloudBuildBasePath = url - c.Cloudbuildv2BasePath = url - c.CloudFunctionsBasePath = url - c.Cloudfunctions2BasePath = url - c.CloudIdentityBasePath = url - c.CloudIdsBasePath = url - c.CloudIotBasePath = url - c.CloudRunBasePath = url - c.CloudRunV2BasePath = url - c.CloudSchedulerBasePath = url - c.CloudTasksBasePath = url - c.ComputeBasePath = url - c.ContainerAnalysisBasePath = url - c.ContainerAttachedBasePath = url - c.CoreBillingBasePath = url - c.DatabaseMigrationServiceBasePath = url - c.DataCatalogBasePath = url - c.DataFusionBasePath = url - c.DataLossPreventionBasePath = url - c.DataplexBasePath = url - c.DataprocBasePath = url - c.DataprocMetastoreBasePath = url - c.DatastoreBasePath = url - c.DatastreamBasePath = url - c.DeploymentManagerBasePath = url - c.DialogflowBasePath = url - c.DialogflowCXBasePath = url - c.DNSBasePath = url - c.DocumentAIBasePath = url - c.DocumentAIWarehouseBasePath = url - c.EssentialContactsBasePath = url - c.FilestoreBasePath = url - c.FirestoreBasePath = url - c.GameServicesBasePath = url - c.GKEBackupBasePath = url - c.GKEHubBasePath = url - c.GKEHub2BasePath = url - c.HealthcareBasePath = url - c.IAM2BasePath = url - c.IAMBetaBasePath = url - c.IAMWorkforcePoolBasePath = url - c.IapBasePath = url - c.IdentityPlatformBasePath = url - c.KMSBasePath = url - c.LoggingBasePath = url - c.LookerBasePath = url - c.MemcacheBasePath = url - c.MLEngineBasePath = url - c.MonitoringBasePath = url - c.NetworkConnectivityBasePath = url - c.NetworkManagementBasePath = url - c.NetworkSecurityBasePath = url - c.NetworkServicesBasePath = url - c.NotebooksBasePath = url - c.OSConfigBasePath = url - c.OSLoginBasePath = url - c.PrivatecaBasePath = url - c.PublicCABasePath = url - c.PubsubBasePath = url - c.PubsubLiteBasePath = url - c.RedisBasePath = url - c.ResourceManagerBasePath = url - c.SecretManagerBasePath = url - c.SecurityCenterBasePath = url - c.ServiceManagementBasePath = url - c.ServiceUsageBasePath = url - c.SourceRepoBasePath = url - c.SpannerBasePath = url - c.SQLBasePath = url - c.StorageBasePath = url - c.StorageTransferBasePath = url - c.TagsBasePath = url - c.TPUBasePath = url - c.VertexAIBasePath = url - c.VPCAccessBasePath = url - c.WorkflowsBasePath = url - - // Handwritten Products / Versioned / Atypical Entries - c.CloudBillingBasePath = url - c.ComposerBasePath = url - c.ContainerBasePath = url - c.DataprocBasePath = url - c.DataflowBasePath = url - c.IamCredentialsBasePath = url - c.ResourceManagerV3BasePath = url - c.IAMBasePath = url - c.ServiceNetworkingBasePath = url - c.BigQueryBasePath = url - c.StorageTransferBasePath = url - c.BigtableAdminBasePath = url -} diff --git a/google/container_attached_operation.go b/google/container_attached_operation.go deleted file mode 100644 index c51513434a6..00000000000 --- a/google/container_attached_operation.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/containerattached" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// nolint: deadcode,unused -// -// Deprecated: For backward compatibility ContainerAttachedOperationWaitTimeWithResponse is still working, -// but all new code should use ContainerAttachedOperationWaitTimeWithResponse in the containerattached package instead. -func ContainerAttachedOperationWaitTimeWithResponse(config *transport_tpg.Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error { - return containerattached.ContainerAttachedOperationWaitTimeWithResponse(config, op, response, project, activity, userAgent, timeout) -} - -// Deprecated: For backward compatibility ContainerAttachedOperationWaitTime is still working, -// but all new code should use ContainerAttachedOperationWaitTime in the containerattached package instead. -func ContainerAttachedOperationWaitTime(config *transport_tpg.Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error { - return containerattached.ContainerAttachedOperationWaitTime(config, op, project, activity, userAgent, timeout) -} diff --git a/google/container_operation.go b/google/container_operation.go deleted file mode 100644 index 38c706ba1ab..00000000000 --- a/google/container_operation.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - tpgcontainer "github.com/hashicorp/terraform-provider-google/google/services/container" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - - "google.golang.org/api/container/v1" -) - -// Deprecated: For backward compatibility ContainerOperationWait is still working, -// but all new code should use ContainerOperationWait in the tpgcontainer package instead. -func ContainerOperationWait(config *transport_tpg.Config, op *container.Operation, project, location, activity, userAgent string, timeout time.Duration) error { - return tpgcontainer.ContainerOperationWait(config, op, project, location, activity, userAgent, timeout) -} diff --git a/google/convert.go b/google/convert.go deleted file mode 100644 index 362c2408ad4..00000000000 --- a/google/convert.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/tpgresource" -) - -// Convert between two types by converting to/from JSON. Intended to switch -// between multiple API versions, as they are strict supersets of one another. -// item and out are pointers to structs -// -// Deprecated: For backward compatibility Convert is still working, -// but all new code should use Convert in the tpgresource package instead. -func Convert(item, out interface{}) error { - return tpgresource.Convert(item, out) -} - -// When converting to a map, we can't use setOmittedFields because FieldByName -// fails. Luckily, we don't use the omitted fields anymore with generated -// resources, and this function is used to bridge from handwritten -> generated. -// Since this is a known type, we can create it inline instead of needing to -// pass an object in. -// -// Deprecated: For backward compatibility ConvertToMap is still working, -// but all new code should use ConvertToMap in the tpgresource package instead. -func ConvertToMap(item interface{}) (map[string]interface{}, error) { - return tpgresource.ConvertToMap(item) -} diff --git a/google/data_source_google_billing_account.go b/google/data_source_google_billing_account.go deleted file mode 100644 index 41322e04980..00000000000 --- a/google/data_source_google_billing_account.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/billing" -) - -func canonicalBillingAccountName(ba string) string { - return billing.CanonicalBillingAccountName(ba) -} diff --git a/google/data_source_google_compute_address.go b/google/data_source_google_compute_address.go deleted file mode 100644 index f3b21f366d7..00000000000 --- a/google/data_source_google_compute_address.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/compute" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -func parseComputeAddressId(id string, config *transport_tpg.Config) (*compute.ComputeAddressId, error) { - return compute.ParseComputeAddressId(id, config) -} diff --git a/google/data_source_google_service_account_jwt.go b/google/data_source_google_service_account_jwt.go deleted file mode 100644 index d898f0aaca0..00000000000 --- a/google/data_source_google_service_account_jwt.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import "github.com/hashicorp/terraform-provider-google/google/services/resourcemanager" - -var ( - dataSourceGoogleServiceAccountJwtNow = resourcemanager.DataSourceGoogleServiceAccountJwtNow -) diff --git a/google/dataproc_cluster_operation.go b/google/dataproc_cluster_operation.go deleted file mode 100644 index e0a0e2dc06f..00000000000 --- a/google/dataproc_cluster_operation.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - tpgdataproc "github.com/hashicorp/terraform-provider-google/google/services/dataproc" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - - "google.golang.org/api/dataproc/v1" -) - -// Deprecated: For backward compatibility dataprocClusterOperationWait is still working, -// but all new code should use DataprocClusterOperationWait in the tpgdataproc package instead. -func dataprocClusterOperationWait(config *transport_tpg.Config, op *dataproc.Operation, activity, userAgent string, timeout time.Duration) error { - return tpgdataproc.DataprocClusterOperationWait(config, op, activity, userAgent, timeout) -} diff --git a/google/dataproc_job_operation.go b/google/dataproc_job_operation.go deleted file mode 100644 index 6f2ad784b25..00000000000 --- a/google/dataproc_job_operation.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/dataproc" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Deprecated: For backward compatibility dataprocJobOperationWait is still working, -// but all new code should use DataprocJobOperationWait in the dataproc package instead. -func dataprocJobOperationWait(config *transport_tpg.Config, region, projectId, jobId, activity, userAgent string, timeout time.Duration) error { - return dataproc.DataprocJobOperationWait(config, region, projectId, jobId, activity, userAgent, timeout) -} - -// Deprecated: For backward compatibility dataprocDeleteOperationWait is still working, -// but all new code should use DataprocDeleteOperationWait in the dataproc package instead. -func dataprocDeleteOperationWait(config *transport_tpg.Config, region, projectId, jobId, activity, userAgent string, timeout time.Duration) error { - return dataproc.DataprocDeleteOperationWait(config, region, projectId, jobId, activity, userAgent, timeout) -} diff --git a/google/datasource_helpers.go b/google/datasource_helpers.go deleted file mode 100644 index 80960ebea52..00000000000 --- a/google/datasource_helpers.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" -) - -// datasourceSchemaFromResourceSchema is a recursive func that -// converts an existing Resource schema to a Datasource schema. -// All schema elements are copied, but certain attributes are ignored or changed: -// - all attributes have Computed = true -// - all attributes have ForceNew, Required = false -// - Validation funcs and attributes (e.g. MaxItems) are not copied -// -// Deprecated: For backward compatibility datasourceSchemaFromResourceSchema is still working, -// but all new code should use DatasourceSchemaFromResourceSchema in the tpgresource package instead. -func datasourceSchemaFromResourceSchema(rs map[string]*schema.Schema) map[string]*schema.Schema { - return tpgresource.DatasourceSchemaFromResourceSchema(rs) -} - -// fixDatasourceSchemaFlags is a convenience func that toggles the Computed, -// Optional + Required flags on a schema element. This is useful when the schema -// has been generated (using `datasourceSchemaFromResourceSchema` above for -// example) and therefore the attribute flags were not set appropriately when -// first added to the schema definition. Currently only supports top-level -// schema elements. -// -// Deprecated: For backward compatibility fixDatasourceSchemaFlags is still working, -// but all new code should use FixDatasourceSchemaFlags in the tpgresource package instead. -func fixDatasourceSchemaFlags(schema map[string]*schema.Schema, required bool, keys ...string) { - tpgresource.FixDatasourceSchemaFlags(schema, required, keys...) -} - -// Deprecated: For backward compatibility addRequiredFieldsToSchema is still working, -// but all new code should use AddRequiredFieldsToSchema in the tpgresource package instead. -func addRequiredFieldsToSchema(schema map[string]*schema.Schema, keys ...string) { - tpgresource.AddRequiredFieldsToSchema(schema, keys...) -} - -// Deprecated: For backward compatibility addOptionalFieldsToSchema is still working, -// but all new code should use AddOptionalFieldsToSchema in the tpgresource package instead. -func addOptionalFieldsToSchema(schema map[string]*schema.Schema, keys ...string) { - tpgresource.AddOptionalFieldsToSchema(schema, keys...) -} diff --git a/google/datasource_iam_policy.go b/google/datasource_iam_policy.go deleted file mode 100644 index 5f1a6468f71..00000000000 --- a/google/datasource_iam_policy.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" -) - -// Deprecated: For backward compatibility DataSourceIamPolicy is still working, -// but all new code should use DataSourceIamPolicy in the tpgiamresource package instead. -func DataSourceIamPolicy(parentSpecificSchema map[string]*schema.Schema, newUpdaterFunc tpgiamresource.NewResourceIamUpdaterFunc, options ...func(*tpgiamresource.IamSettings)) *schema.Resource { - return tpgiamresource.DataSourceIamPolicy(parentSpecificSchema, newUpdaterFunc, options...) -} diff --git a/google/datastream_operation.go b/google/datastream_operation.go deleted file mode 100644 index 3d672d39e69..00000000000 --- a/google/datastream_operation.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/datastream" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// nolint: deadcode,unused -// -// Deprecated: For backward compatibility DatastreamOperationWaitTimeWithResponse is still working, -// but all new code should use DatastreamOperationWaitTimeWithResponse in the datastream package instead. -func DatastreamOperationWaitTimeWithResponse(config *transport_tpg.Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error { - return datastream.DatastreamOperationWaitTimeWithResponse(config, op, response, project, activity, userAgent, timeout) -} - -// Deprecated: For backward compatibility DatastreamOperationWaitTime is still working, -// but all new code should use DatastreamOperationWaitTime in the datastream package instead. -func DatastreamOperationWaitTime(config *transport_tpg.Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error { - return datastream.DatastreamOperationWaitTime(config, op, project, activity, userAgent, timeout) -} diff --git a/google/deployment_manager_operation.go b/google/deployment_manager_operation.go deleted file mode 100644 index 9fbe66983ae..00000000000 --- a/google/deployment_manager_operation.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/deploymentmanager" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Deprecated: For backward compatibility DeploymentManagerOperationWaitTime is still working, -// but all new code should use DeploymentManagerOperationWaitTime in the deploymentmanager package instead. -func DeploymentManagerOperationWaitTime(config *transport_tpg.Config, resp interface{}, project, activity, userAgent string, timeout time.Duration) error { - return deploymentmanager.DeploymentManagerOperationWaitTime(config, resp, project, activity, userAgent, timeout) -} diff --git a/google/dialogflow_cx_operation.go b/google/dialogflow_cx_operation.go deleted file mode 100644 index 87ab44b0a1a..00000000000 --- a/google/dialogflow_cx_operation.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/dialogflowcx" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// nolint: deadcode,unused -// -// Deprecated: For backward compatibility DialogflowCXOperationWaitTimeWithResponse is still working, -// but all new code should use DialogflowCXOperationWaitTimeWithResponse in the dialogflowcx package instead. -func DialogflowCXOperationWaitTimeWithResponse(config *transport_tpg.Config, op map[string]interface{}, response *map[string]interface{}, activity, userAgent, location string, timeout time.Duration) error { - return dialogflowcx.DialogflowCXOperationWaitTimeWithResponse(config, op, response, activity, userAgent, location, timeout) -} - -// Deprecated: For backward compatibility DialogflowCXOperationWaitTime is still working, -// but all new code should use DialogflowCXOperationWaitTime in the dialogflowcx package instead. -func DialogflowCXOperationWaitTime(config *transport_tpg.Config, op map[string]interface{}, activity, userAgent, location string, timeout time.Duration) error { - return dialogflowcx.DialogflowCXOperationWaitTime(config, op, activity, userAgent, location, timeout) -} diff --git a/google/error_retry_predicates.go b/google/error_retry_predicates.go deleted file mode 100644 index a335892aefd..00000000000 --- a/google/error_retry_predicates.go +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// We've encountered a few common fingerprint-related strings; if this is one of -// them, we're confident this is an error due to fingerprints. -// -// Deprecated: For backward compatibility FINGERPRINT_FAIL_ERRORS is still working, -// but all new code should use FINGERPRINT_FAIL_ERRORS in the transport_tpg package instead. -var FINGERPRINT_FAIL_ERRORS = transport_tpg.FINGERPRINT_FAIL_ERRORS - -// Retry the operation if it looks like a fingerprint mismatch. -// -// Deprecated: For backward compatibility IsFingerprintError is still working, -// but all new code should use IsFingerprintError in the transport_tpg package instead. -func IsFingerprintError(err error) (bool, string) { - return transport_tpg.IsFingerprintError(err) -} - -// If a permission necessary to provision a resource is created in the same config -// as the resource itself, the permission may not have propagated by the time terraform -// attempts to create the resource. This allows those errors to be retried until the timeout expires -// -// Deprecated: For backward compatibility IamMemberMissing is still working, -// but all new code should use IamMemberMissing in the transport_tpg package instead. -func IamMemberMissing(err error) (bool, string) { - return transport_tpg.IamMemberMissing(err) -} - -// Cloud PubSub returns a 400 error if a topic's parent project was recently created and an -// organization policy has not propagated. -// See https://github.com/hashicorp/terraform-provider-google/issues/4349 -// -// Deprecated: For backward compatibility PubsubTopicProjectNotReady is still working, -// but all new code should use PubsubTopicProjectNotReady in the transport_tpg package instead. -func PubsubTopicProjectNotReady(err error) (bool, string) { - return transport_tpg.PubsubTopicProjectNotReady(err) -} - -// Retry if Cloud SQL operation returns a 429 with a specific message for -// concurrent operations. -// -// Deprecated: For backward compatibility IsSqlOperationInProgressError is still working, -// but all new code should use IsSqlOperationInProgressError in the transport_tpg package instead. -func IsSqlOperationInProgressError(err error) (bool, string) { - return transport_tpg.IsSqlOperationInProgressError(err) -} - -// Retry if service usage decides you're activating the same service multiple -// times. This can happen if a service and a dependent service aren't batched -// together- eg container.googleapis.com in one request followed by compute.g.c -// in the next (container relies on compute and implicitly activates it) -// -// Deprecated: For backward compatibility ServiceUsageServiceBeingActivated is still working, -// but all new code should use ServiceUsageServiceBeingActivated in the transport_tpg package instead. -func ServiceUsageServiceBeingActivated(err error) (bool, string) { - return transport_tpg.ServiceUsageServiceBeingActivated(err) -} - -// Retry if Bigquery operation returns a 403 with a specific message for -// concurrent operations (which are implemented in terms of 'edit quota'). -// -// Deprecated: For backward compatibility IsBigqueryIAMQuotaError is still working, -// but all new code should use IsBigqueryIAMQuotaError in the transport_tpg package instead. -func IsBigqueryIAMQuotaError(err error) (bool, string) { - return transport_tpg.IsBigqueryIAMQuotaError(err) -} - -// Retry if Monitoring operation returns a 409 with a specific message for -// concurrent operations. -// -// Deprecated: For backward compatibility IsMonitoringConcurrentEditError is still working, -// but all new code should use IsMonitoringConcurrentEditError in the transport_tpg package instead. -func IsMonitoringConcurrentEditError(err error) (bool, string) { - return transport_tpg.IsMonitoringConcurrentEditError(err) -} - -// Retry if KMS CryptoKeyVersions returns a 400 for PENDING_GENERATION -// -// Deprecated: For backward compatibility IsCryptoKeyVersionsPendingGeneration is still working, -// but all new code should use IsCryptoKeyVersionsPendingGeneration in the transport_tpg package instead. -func IsCryptoKeyVersionsPendingGeneration(err error) (bool, string) { - return transport_tpg.IsCryptoKeyVersionsPendingGeneration(err) -} - -// Retry if getting a resource/operation returns a 404 for specific operations. -// opType should describe the operation for which 404 can be retryable. -// -// Deprecated: For backward compatibility IsNotFoundRetryableError is still working, -// but all new code should use IsNotFoundRetryableError in the transport_tpg package instead. -func IsNotFoundRetryableError(opType string) transport_tpg.RetryErrorPredicateFunc { - return transport_tpg.IsNotFoundRetryableError(opType) -} - -// Deprecated: For backward compatibility IsDataflowJobUpdateRetryableError is still working, -// but all new code should use IsDataflowJobUpdateRetryableError in the transport_tpg package instead. -func IsDataflowJobUpdateRetryableError(err error) (bool, string) { - return transport_tpg.IsDataflowJobUpdateRetryableError(err) -} - -// Deprecated: For backward compatibility IsPeeringOperationInProgress is still working, -// but all new code should use IsPeeringOperationInProgress in the transport_tpg package instead. -func IsPeeringOperationInProgress(err error) (bool, string) { - return transport_tpg.IsPeeringOperationInProgress(err) -} - -// Deprecated: For backward compatibility DatastoreIndex409Contention is still working, -// but all new code should use DatastoreIndex409Contention in the transport_tpg package instead. -func DatastoreIndex409Contention(err error) (bool, string) { - return transport_tpg.DatastoreIndex409Contention(err) -} - -// Deprecated: For backward compatibility IapClient409Operation is still working, -// but all new code should use IapClient409Operation in the transport_tpg package instead. -func IapClient409Operation(err error) (bool, string) { - return transport_tpg.IapClient409Operation(err) -} - -// Deprecated: For backward compatibility HealthcareDatasetNotInitialized is still working, -// but all new code should use HealthcareDatasetNotInitialized in the transport_tpg package instead. -func HealthcareDatasetNotInitialized(err error) (bool, string) { - return transport_tpg.HealthcareDatasetNotInitialized(err) -} - -// Cloud Run APIs may return a 409 on create to indicate that a resource has been deleted in the foreground -// (eg GET and LIST) but not the backing apiserver. When we encounter a 409, we can retry it. -// Note that due to limitations in MMv1's error_retry_predicates this is currently applied to all requests. -// We only expect to receive it on create, though. -// -// Deprecated: For backward compatibility IsCloudRunCreationConflict is still working, -// but all new code should use IsCloudRunCreationConflict in the transport_tpg package instead. -func IsCloudRunCreationConflict(err error) (bool, string) { - return transport_tpg.IsCloudRunCreationConflict(err) -} - -// If a service account is deleted in the middle of updating an IAM policy -// it can cause the API to return an error. In fine-grained IAM resources we -// read the policy, modify it, then send it back to the API. Retrying is -// useful particularly in high-traffic projects. -// We don't want to retry _every_ time we see this error because the -// user-provided SA could trigger this too. At the callsite, we should check -// if the current etag matches the old etag and short-circuit if they do as -// that indicates the new config is the likely problem. -// -// Deprecated: For backward compatibility IamServiceAccountNotFound is still working, -// but all new code should use IamServiceAccountNotFound in the transport_tpg package instead. -func IamServiceAccountNotFound(err error) (bool, string) { - return transport_tpg.IamServiceAccountNotFound(err) -} - -// Concurrent Apigee operations can fail with a 400 error -// -// Deprecated: For backward compatibility IsApigeeRetryableError is still working, -// but all new code should use IsApigeeRetryableError in the transport_tpg package instead. -func IsApigeeRetryableError(err error) (bool, string) { - return transport_tpg.IsApigeeRetryableError(err) -} - -func IsSwgAutogenRouterRetryable(err error) (bool, string) { - return transport_tpg.IsSwgAutogenRouterRetryable(err) -} diff --git a/google/extract.go b/google/extract.go deleted file mode 100644 index b1ce7cf6994..00000000000 --- a/google/extract.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/logging" -) - -// ExtractFieldByPattern returns the value of a field extracted from a parent field according to the given regular expression pattern. -// An error is returned if the field already has a value different than the value extracted. -func ExtractFieldByPattern(fieldName, fieldValue, parentFieldValue, pattern string) (string, error) { - return logging.ExtractFieldByPattern(fieldName, fieldValue, parentFieldValue, pattern) -} diff --git a/google/field_helpers.go b/google/field_helpers.go deleted file mode 100644 index c4a179b3ca8..00000000000 --- a/google/field_helpers.go +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -const ( - // Deprecated: For backward compatibility globalLinkTemplate is still working, - // but all new code should use GlobalLinkTemplate in the tpgresource package instead. - globalLinkTemplate = tpgresource.GlobalLinkTemplate - // Deprecated: For backward compatibility globalLinkBasePattern is still working, - // but all new code should use GlobalLinkBasePattern in the tpgresource package instead. - globalLinkBasePattern = tpgresource.GlobalLinkBasePattern - // Deprecated: For backward compatibility zonalLinkTemplate is still working, - // but all new code should use ZonalLinkTemplate in the tpgresource package instead. - zonalLinkTemplate = tpgresource.ZonalLinkTemplate - // Deprecated: For backward compatibility zonalLinkBasePattern is still working, - // but all new code should use ZonalLinkBasePattern in the tpgresource package instead. - zonalLinkBasePattern = tpgresource.ZonalLinkBasePattern - // Deprecated: For backward compatibility zonalPartialLinkBasePattern is still working, - // but all new code should use ZonalPartialLinkBasePattern in the tpgresource package instead. - zonalPartialLinkBasePattern = tpgresource.ZonalPartialLinkBasePattern - // Deprecated: For backward compatibility regionalLinkTemplate is still working, - // but all new code should use RegionalLinkTemplate in the tpgresource package instead. - regionalLinkTemplate = tpgresource.RegionalLinkTemplate - // Deprecated: For backward compatibility regionalLinkBasePattern is still working, - // but all new code should use RegionalLinkBasePattern in the tpgresource package instead. - regionalLinkBasePattern = tpgresource.RegionalLinkBasePattern - // Deprecated: For backward compatibility regionalPartialLinkBasePattern is still working, - // but all new code should use RegionalPartialLinkBasePattern in the tpgresource package instead. - regionalPartialLinkBasePattern = tpgresource.RegionalPartialLinkBasePattern - // Deprecated: For backward compatibility projectLinkTemplate is still working, - // but all new code should use ProjectLinkTemplate in the tpgresource package instead. - projectLinkTemplate = tpgresource.ProjectLinkTemplate - // Deprecated: For backward compatibility projectBasePattern is still working, - // but all new code should use ProjectBasePattern in the tpgresource package instead. - projectBasePattern = tpgresource.ProjectBasePattern - // Deprecated: For backward compatibility organizationLinkTemplate is still working, - // but all new code should use OrganizationLinkTemplate in the tpgresource package instead. - organizationLinkTemplate = tpgresource.OrganizationLinkTemplate - // Deprecated: For backward compatibility organizationBasePattern is still working, - // but all new code should use OrganizationBasePattern in the tpgresource package instead. - organizationBasePattern = tpgresource.OrganizationBasePattern -) - -// ------------------------------------------------------------ -// Field helpers -// ------------------------------------------------------------ - -// Deprecated: For backward compatibility ParseNetworkFieldValue is still working, -// but all new code should use ParseNetworkFieldValue in the tpgresource package instead. -func ParseNetworkFieldValue(network string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.GlobalFieldValue, error) { - return tpgresource.ParseNetworkFieldValue(network, d, config) -} - -// Deprecated: For backward compatibility ParseSubnetworkFieldValue is still working, -// but all new code should use ParseSubnetworkFieldValue in the tpgresource package instead. -func ParseSubnetworkFieldValue(subnetwork string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.RegionalFieldValue, error) { - return tpgresource.ParseSubnetworkFieldValue(subnetwork, d, config) -} - -// Deprecated: For backward compatibility ParseSubnetworkFieldValueWithProjectField is still working, -// but all new code should use ParseSubnetworkFieldValueWithProjectField in the tpgresource package instead. -func ParseSubnetworkFieldValueWithProjectField(subnetwork, projectField string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.RegionalFieldValue, error) { - return tpgresource.ParseSubnetworkFieldValueWithProjectField(subnetwork, projectField, d, config) -} - -// Deprecated: For backward compatibility ParseSslCertificateFieldValue is still working, -// but all new code should use ParseSslCertificateFieldValue in the tpgresource package instead. -func ParseSslCertificateFieldValue(sslCertificate string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.GlobalFieldValue, error) { - return tpgresource.ParseSslCertificateFieldValue(sslCertificate, d, config) -} - -// Deprecated: For backward compatibility ParseHttpHealthCheckFieldValue is still working, -// but all new code should use ParseHttpHealthCheckFieldValue in the tpgresource package instead. -func ParseHttpHealthCheckFieldValue(healthCheck string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.GlobalFieldValue, error) { - return tpgresource.ParseHttpHealthCheckFieldValue(healthCheck, d, config) -} - -// Deprecated: For backward compatibility ParseDiskFieldValue is still working, -// but all new code should use ParseDiskFieldValue in the tpgresource package instead. -func ParseDiskFieldValue(disk string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.ZonalFieldValue, error) { - return tpgresource.ParseDiskFieldValue(disk, d, config) -} - -// Deprecated: For backward compatibility ParseRegionDiskFieldValue is still working, -// but all new code should use ParseRegionDiskFieldValue in the tpgresource package instead. -func ParseRegionDiskFieldValue(disk string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.RegionalFieldValue, error) { - return tpgresource.ParseRegionDiskFieldValue(disk, d, config) -} - -// Deprecated: For backward compatibility ParseOrganizationCustomRoleName is still working, -// but all new code should use ParseOrganizationCustomRoleName in the tpgresource package instead. -func ParseOrganizationCustomRoleName(role string) (*tpgresource.OrganizationFieldValue, error) { - return tpgresource.ParseOrganizationCustomRoleName(role) -} - -// Deprecated: For backward compatibility ParseAcceleratorFieldValue is still working, -// but all new code should use ParseAcceleratorFieldValue in the tpgresource package instead. -func ParseAcceleratorFieldValue(accelerator string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.ZonalFieldValue, error) { - return tpgresource.ParseAcceleratorFieldValue(accelerator, d, config) -} - -// Deprecated: For backward compatibility ParseMachineTypesFieldValue is still working, -// but all new code should use ParseMachineTypesFieldValue in the tpgresource package instead. -func ParseMachineTypesFieldValue(machineType string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.ZonalFieldValue, error) { - return tpgresource.ParseMachineTypesFieldValue(machineType, d, config) -} - -// Deprecated: For backward compatibility ParseInstanceFieldValue is still working, -// but all new code should use ParseInstanceFieldValue in the tpgresource package instead. -func ParseInstanceFieldValue(instance string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.ZonalFieldValue, error) { - return tpgresource.ParseInstanceFieldValue(instance, d, config) -} - -// Deprecated: For backward compatibility ParseInstanceGroupFieldValue is still working, -// but all new code should use ParseInstanceGroupFieldValue in the tpgresource package instead. -func ParseInstanceGroupFieldValue(instanceGroup string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.ZonalFieldValue, error) { - return tpgresource.ParseInstanceGroupFieldValue(instanceGroup, d, config) -} - -// Deprecated: For backward compatibility ParseInstanceTemplateFieldValue is still working, -// but all new code should use ParseInstanceTemplateFieldValue in the tpgresource package instead. -func ParseInstanceTemplateFieldValue(instanceTemplate string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.GlobalFieldValue, error) { - return tpgresource.ParseInstanceTemplateFieldValue(instanceTemplate, d, config) -} - -// Deprecated: For backward compatibility ParseMachineImageFieldValue is still working, -// but all new code should use ParseMachineImageFieldValue in the tpgresource package instead. -func ParseMachineImageFieldValue(machineImage string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.GlobalFieldValue, error) { - return tpgresource.ParseMachineImageFieldValue(machineImage, d, config) -} - -// Deprecated: For backward compatibility ParseSecurityPolicyFieldValue is still working, -// but all new code should use ParseSecurityPolicyFieldValue in the tpgresource package instead. -func ParseSecurityPolicyFieldValue(securityPolicy string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.GlobalFieldValue, error) { - return tpgresource.ParseSecurityPolicyFieldValue(securityPolicy, d, config) -} - -// Deprecated: For backward compatibility ParseNetworkEndpointGroupFieldValue is still working, -// but all new code should use ParseNetworkEndpointGroupFieldValue in the tpgresource package instead. -func ParseNetworkEndpointGroupFieldValue(networkEndpointGroup string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.ZonalFieldValue, error) { - return tpgresource.ParseNetworkEndpointGroupFieldValue(networkEndpointGroup, d, config) -} - -// Deprecated: For backward compatibility ParseNetworkEndpointGroupRegionalFieldValue is still working, -// but all new code should use ParseNetworkEndpointGroupRegionalFieldValue in the tpgresource package instead. -func ParseNetworkEndpointGroupRegionalFieldValue(networkEndpointGroup string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (*tpgresource.RegionalFieldValue, error) { - return tpgresource.ParseNetworkEndpointGroupRegionalFieldValue(networkEndpointGroup, d, config) -} - -// ------------------------------------------------------------ -// Base helpers used to create helpers for specific fields. -// ------------------------------------------------------------ - -// Parses a global field supporting 5 different formats: -// - https://www.googleapis.com/compute/ANY_VERSION/projects/{my_project}/global/{resource_type}/{resource_name} -// - projects/{my_project}/global/{resource_type}/{resource_name} -// - global/{resource_type}/{resource_name} -// - resource_name -// - "" (empty string). RelativeLink() returns empty if isEmptyValid is true. -// -// If the project is not specified, it first tries to get the project from the `projectSchemaField` and then fallback on the default project. -// -// Deprecated: For backward compatibility parseGlobalFieldValue is still working, -// but all new code should use ParseGlobalFieldValue in the tpgresource package instead. -func parseGlobalFieldValue(resourceType, fieldValue, projectSchemaField string, d tpgresource.TerraformResourceData, config *transport_tpg.Config, isEmptyValid bool) (*tpgresource.GlobalFieldValue, error) { - return tpgresource.ParseGlobalFieldValue(resourceType, fieldValue, projectSchemaField, d, config, isEmptyValid) -} - -// Parses a zonal field supporting 5 different formats: -// - https://www.googleapis.com/compute/ANY_VERSION/projects/{my_project}/zones/{zone}/{resource_type}/{resource_name} -// - projects/{my_project}/zones/{zone}/{resource_type}/{resource_name} -// - zones/{zone}/{resource_type}/{resource_name} -// - resource_name -// - "" (empty string). RelativeLink() returns empty if isEmptyValid is true. -// -// If the project is not specified, it first tries to get the project from the `projectSchemaField` and then fallback on the default project. -// If the zone is not specified, it takes the value of `zoneSchemaField`. -// -// Deprecated: For backward compatibility parseZonalFieldValue is still working, -// but all new code should use ParseZonalFieldValue in the tpgresource package instead. -func parseZonalFieldValue(resourceType, fieldValue, projectSchemaField, zoneSchemaField string, d tpgresource.TerraformResourceData, config *transport_tpg.Config, isEmptyValid bool) (*tpgresource.ZonalFieldValue, error) { - return tpgresource.ParseZonalFieldValue(resourceType, fieldValue, projectSchemaField, zoneSchemaField, d, config, isEmptyValid) -} - -// Deprecated: For backward compatibility getProjectFromSchema is still working, -// but all new code should use GetProjectFromSchema in the tpgresource package instead. -func getProjectFromSchema(projectSchemaField string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (string, error) { - return tpgresource.GetProjectFromSchema(projectSchemaField, d, config) -} - -// Deprecated: For backward compatibility getBillingProjectFromSchema is still working, -// but all new code should use GetBillingProjectFromSchema in the tpgresource package instead. -func getBillingProjectFromSchema(billingProjectSchemaField string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (string, error) { - return tpgresource.GetBillingProjectFromSchema(billingProjectSchemaField, d, config) -} - -// Parses an organization field with the following formats: -// - organizations/{my_organizations}/{resource_type}/{resource_name} -// -// Deprecated: For backward compatibility parseOrganizationFieldValue is still working, -// but all new code should use ParseOrganizationFieldValue in the tpgresource package instead. -func parseOrganizationFieldValue(resourceType, fieldValue string, isEmptyValid bool) (*tpgresource.OrganizationFieldValue, error) { - return tpgresource.ParseOrganizationFieldValue(resourceType, fieldValue, isEmptyValid) -} - -// Parses a regional field supporting 5 different formats: -// - https://www.googleapis.com/compute/ANY_VERSION/projects/{my_project}/regions/{region}/{resource_type}/{resource_name} -// - projects/{my_project}/regions/{region}/{resource_type}/{resource_name} -// - regions/{region}/{resource_type}/{resource_name} -// - resource_name -// - "" (empty string). RelativeLink() returns empty if isEmptyValid is true. -// -// If the project is not specified, it first tries to get the project from the `projectSchemaField` and then fallback on the default project. -// If the region is not specified, see function documentation for `getRegionFromSchema`. -// -// Deprecated: For backward compatibility parseRegionalFieldValue is still working, -// but all new code should use ParseRegionalFieldValue in the tpgresource package instead. -func parseRegionalFieldValue(resourceType, fieldValue, projectSchemaField, regionSchemaField, zoneSchemaField string, d tpgresource.TerraformResourceData, config *transport_tpg.Config, isEmptyValid bool) (*tpgresource.RegionalFieldValue, error) { - return tpgresource.ParseRegionalFieldValue(resourceType, fieldValue, projectSchemaField, regionSchemaField, zoneSchemaField, d, config, isEmptyValid) -} - -// Infers the region based on the following (in order of priority): -// - `regionSchemaField` in resource schema -// - region extracted from the `zoneSchemaField` in resource schema -// - provider-level region -// - region extracted from the provider-level zone -// -// Deprecated: For backward compatibility getRegionFromSchema is still working, -// but all new code should use GetRegionFromSchema in the tpgresource package instead. -func getRegionFromSchema(regionSchemaField, zoneSchemaField string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (string, error) { - return tpgresource.GetRegionFromSchema(regionSchemaField, zoneSchemaField, d, config) -} - -// Parses a project field with the following formats: -// - projects/{my_projects}/{resource_type}/{resource_name} -// -// Deprecated: For backward compatibility parseProjectFieldValue is still working, -// but all new code should use ParseProjectFieldValue in the tpgresource package instead. -func parseProjectFieldValue(resourceType, fieldValue, projectSchemaField string, d tpgresource.TerraformResourceData, config *transport_tpg.Config, isEmptyValid bool) (*tpgresource.ProjectFieldValue, error) { - return tpgresource.ParseProjectFieldValue(resourceType, fieldValue, projectSchemaField, d, config, isEmptyValid) -} diff --git a/google/framework_test_utils.go b/google/framework_test_utils.go deleted file mode 100644 index 3bc32f64eda..00000000000 --- a/google/framework_test_utils.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - "github.com/hashicorp/terraform-provider-google/google/fwtransport" -) - -// General test utils - -// testExtractResourceAttr navigates a test's state to find the specified resource (or data source) attribute and makes the value -// accessible via the attributeValue string pointer. -func testExtractResourceAttr(resourceName string, attributeName string, attributeValue *string) resource.TestCheckFunc { - return acctest.TestExtractResourceAttr(resourceName, attributeName, attributeValue) -} - -// testCheckAttributeValuesEqual compares two string pointers, which have been used to retrieve attribute values from the test's state. -func testCheckAttributeValuesEqual(i *string, j *string) resource.TestCheckFunc { - return acctest.TestCheckAttributeValuesEqual(i, j) -} - -// This function isn't a test of transport.go; instead, it is used as an alternative -// to ReplaceVars inside tests. -func replaceVarsForFrameworkTest(prov *fwtransport.FrameworkProviderConfig, rs *terraform.ResourceState, linkTmpl string) (string, error) { - return acctest.ReplaceVarsForFrameworkTest(prov, rs, linkTmpl) -} diff --git a/google/framework_transport.go b/google/framework_transport.go deleted file mode 100644 index feeda6e2821..00000000000 --- a/google/framework_transport.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-provider-google/google/fwtransport" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -func sendFrameworkRequest(p *fwtransport.FrameworkProviderConfig, method, project, rawurl, userAgent string, body map[string]interface{}, errorRetryPredicates ...transport_tpg.RetryErrorPredicateFunc) (map[string]interface{}, diag.Diagnostics) { - return fwtransport.SendFrameworkRequest(p, method, project, rawurl, userAgent, body, errorRetryPredicates...) -} - -func sendFrameworkRequestWithTimeout(p *fwtransport.FrameworkProviderConfig, method, project, rawurl, userAgent string, body map[string]interface{}, timeout time.Duration, errorRetryPredicates ...transport_tpg.RetryErrorPredicateFunc) (map[string]interface{}, diag.Diagnostics) { - return fwtransport.SendFrameworkRequestWithTimeout(p, method, project, rawurl, userAgent, body, timeout, errorRetryPredicates...) -} diff --git a/google/framework_utils.go b/google/framework_utils.go deleted file mode 100644 index c8e0f96492b..00000000000 --- a/google/framework_utils.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "context" - - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - - "github.com/hashicorp/terraform-provider-google/google/fwmodels" - "github.com/hashicorp/terraform-provider-google/google/fwresource" - "github.com/hashicorp/terraform-provider-google/google/fwtransport" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" -) - -func CompileUserAgentString(ctx context.Context, name, tfVersion, provVersion string) string { - return fwtransport.CompileUserAgentString(ctx, name, tfVersion, provVersion) -} - -func GetCurrentUserEmailFramework(p *fwtransport.FrameworkProviderConfig, userAgent string, diags *diag.Diagnostics) string { - return fwtransport.GetCurrentUserEmailFramework(p, userAgent, diags) -} - -func generateFrameworkUserAgentString(metaData *fwmodels.ProviderMetaModel, currUserAgent string) string { - return fwtransport.GenerateFrameworkUserAgentString(metaData, currUserAgent) -} - -// GetProject reads the "project" field from the given resource and falls -// back to the provider's value if not given. If the provider's value is not -// given, an error is returned. -func getProjectFramework(rVal, pVal types.String, diags *diag.Diagnostics) types.String { - return fwresource.GetProjectFramework(rVal, pVal, diags) -} - -func handleDatasourceNotFoundError(ctx context.Context, err error, state *tfsdk.State, resource string, diags *diag.Diagnostics) { - fwtransport.HandleDatasourceNotFoundError(ctx, err, state, resource, diags) -} - -// field helpers - -// Parses a project field with the following formats: -// - projects/{my_projects}/{resource_type}/{resource_name} -func parseProjectFieldValueFramework(resourceType, fieldValue, projectSchemaField string, rVal, pVal types.String, isEmptyValid bool, diags *diag.Diagnostics) *tpgresource.ProjectFieldValue { - return fwresource.ParseProjectFieldValueFramework(resourceType, fieldValue, projectSchemaField, rVal, pVal, isEmptyValid, diags) -} diff --git a/google/gcp_sweeper.go b/google/gcp_sweeper.go deleted file mode 100644 index aa79bc3ed58..00000000000 --- a/google/gcp_sweeper.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/acctest" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// SharedConfigForRegion returns a common config setup needed for the sweeper -// functions for a given region -func SharedConfigForRegion(region string) (*transport_tpg.Config, error) { - return acctest.SharedConfigForRegion(region) -} - -func IsSweepableTestResource(resourceName string) bool { - return acctest.IsSweepableTestResource(resourceName) -} diff --git a/google/gkeonprem_operation.go b/google/gkeonprem_operation.go deleted file mode 100644 index 9821d4cf9b2..00000000000 --- a/google/gkeonprem_operation.go +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google diff --git a/google/hashcode.go b/google/hashcode.go deleted file mode 100644 index ee713e4d66a..00000000000 --- a/google/hashcode.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import "github.com/hashicorp/terraform-provider-google/google/tpgresource" - -// hashcode hashes a string to a unique hashcode. -// -// crc32 returns a uint32, but for our use we need -// and non negative integer. Here we cast to an integer -// and invert it if the result is negative. -// -// Deprecated: For backward compatibility hashcode is still working, -// but all new code should use Hashcode in the tpgresource package instead. -func hashcode(s string) int { - return tpgresource.Hashcode(s) -} diff --git a/google/iam.go b/google/iam.go deleted file mode 100644 index 5283c3dbe91..00000000000 --- a/google/iam.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -// Utils for modifying IAM policies for resources across GCP -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" - "google.golang.org/api/cloudresourcemanager/v1" -) - -// Deprecated: For backward compatibility IamPolicyVersion is still working, -// but all new code should use IamPolicyVersion in the tpgiamresource package instead. -const IamPolicyVersion = tpgiamresource.IamPolicyVersion - -type ( - // The ResourceIamUpdater interface is implemented for each GCP resource supporting IAM policy. - // Implementations should be created per resource and should keep track of the resource identifier. - // - // Deprecated: For backward compatibility ResourceIamUpdater is still working, - // but all new code should use ResourceIamUpdater in the tpgiamresource package instead. - ResourceIamUpdater = tpgiamresource.ResourceIamUpdater - - // Parser for Terraform resource identifier (d.Id) for resource whose IAM policy is being changed - // - // Deprecated: For backward compatibility ResourceIdParserFunc is still working, - // but all new code should use ResourceIdParserFunc in the tpgiamresource package instead. - ResourceIdParserFunc = tpgiamresource.ResourceIdParserFunc -) - -// Flattens a list of Bindings so each role+condition has a single Binding with combined members -// -// Deprecated: For backward compatibility MergeBindings is still working, -// but all new code should use MergeBindings in the tpgiamresource package instead. -func MergeBindings(bindings []*cloudresourcemanager.Binding) []*cloudresourcemanager.Binding { - return tpgiamresource.MergeBindings(bindings) -} - -// Deprecated: For backward compatibility compareBindings is still working, -// but all new code should use CompareBindings in the tpgiamresource package instead. -func compareBindings(a, b []*cloudresourcemanager.Binding) bool { - return tpgiamresource.CompareBindings(a, b) -} - -// Deprecated: For backward compatibility compareAuditConfigs is still working, -// but all new code should use CompareAuditConfigs in the tpgiamresource package instead. -func compareAuditConfigs(a, b []*cloudresourcemanager.AuditConfig) bool { - return tpgiamresource.CompareAuditConfigs(a, b) -} - -// Util to deref and print auditConfigs -// -// Deprecated: For backward compatibility debugPrintAuditConfigs is still working, -// but all new code should use DebugPrintAuditConfigs in the tpgiamresource package instead. -func debugPrintAuditConfigs(bs []*cloudresourcemanager.AuditConfig) string { - return tpgiamresource.DebugPrintAuditConfigs(bs) -} - -// Util to deref and print bindings -// -// Deprecated: For backward compatibility debugPrintBindings is still working, -// but all new code should use DebugPrintBindings in the tpgiamresource package instead. -func debugPrintBindings(bs []*cloudresourcemanager.Binding) string { - return tpgiamresource.DebugPrintBindings(bs) -} diff --git a/google/iam_bigquery_dataset.go b/google/iam_bigquery_dataset.go deleted file mode 100644 index ad496245e53..00000000000 --- a/google/iam_bigquery_dataset.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/bigquery" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -var IamBigqueryDatasetSchema = bigquery.IamBigqueryDatasetSchema - -func NewBigqueryDatasetIamUpdater(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (tpgiamresource.ResourceIamUpdater, error) { - return bigquery.NewBigqueryDatasetIamUpdater(d, config) -} - -func BigqueryDatasetIdParseFunc(d *schema.ResourceData, config *transport_tpg.Config) error { - return bigquery.BigqueryDatasetIdParseFunc(d, config) -} diff --git a/google/iam_bigtable_instance.go b/google/iam_bigtable_instance.go deleted file mode 100644 index 9edd03ce6b3..00000000000 --- a/google/iam_bigtable_instance.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/bigtable" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -var IamBigtableInstanceSchema = bigtable.IamBigtableInstanceSchema - -func NewBigtableInstanceUpdater(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (tpgiamresource.ResourceIamUpdater, error) { - return bigtable.NewBigtableInstanceUpdater(d, config) -} - -func BigtableInstanceIdParseFunc(d *schema.ResourceData, config *transport_tpg.Config) error { - return bigtable.BigtableInstanceIdParseFunc(d, config) -} diff --git a/google/iam_bigtable_table.go b/google/iam_bigtable_table.go deleted file mode 100644 index 51cfd20a562..00000000000 --- a/google/iam_bigtable_table.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/bigtable" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -var IamBigtableTableSchema = bigtable.IamBigtableTableSchema - -func NewBigtableTableUpdater(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (tpgiamresource.ResourceIamUpdater, error) { - return bigtable.NewBigtableTableUpdater(d, config) -} - -func BigtableTableIdParseFunc(d *schema.ResourceData, config *transport_tpg.Config) error { - return bigtable.BigtableTableIdParseFunc(d, config) -} diff --git a/google/iam_billing_account.go b/google/iam_billing_account.go deleted file mode 100644 index 0f77456950d..00000000000 --- a/google/iam_billing_account.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/hashicorp/terraform-provider-google/google/services/billing" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -var IamBillingAccountSchema = billing.IamBillingAccountSchema - -func NewBillingAccountIamUpdater(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (tpgiamresource.ResourceIamUpdater, error) { - return billing.NewBillingAccountIamUpdater(d, config) -} - -func BillingAccountIdParseFunc(d *schema.ResourceData, _ *transport_tpg.Config) error { - return billing.BillingAccountIdParseFunc(d, nil) -} diff --git a/google/iam_dataproc_cluster.go b/google/iam_dataproc_cluster.go deleted file mode 100644 index 13397bb8913..00000000000 --- a/google/iam_dataproc_cluster.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-google/google/services/dataproc" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -var IamDataprocClusterSchema = dataproc.IamDataprocClusterSchema - -func NewDataprocClusterUpdater(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (tpgiamresource.ResourceIamUpdater, error) { - return dataproc.NewDataprocClusterUpdater(d, config) -} - -func DataprocClusterIdParseFunc(d *schema.ResourceData, config *transport_tpg.Config) error { - return dataproc.DataprocClusterIdParseFunc(d, config) -} diff --git a/google/iam_dataproc_job.go b/google/iam_dataproc_job.go deleted file mode 100644 index 7b2ab792b8a..00000000000 --- a/google/iam_dataproc_job.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-google/google/services/dataproc" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -var IamDataprocJobSchema = dataproc.IamDataprocJobSchema - -func NewDataprocJobUpdater(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (tpgiamresource.ResourceIamUpdater, error) { - return dataproc.NewDataprocJobUpdater(d, config) -} - -func DataprocJobIdParseFunc(d *schema.ResourceData, config *transport_tpg.Config) error { - return dataproc.DataprocJobIdParseFunc(d, config) -} diff --git a/google/iam_folder.go b/google/iam_folder.go deleted file mode 100644 index 7439db8f429..00000000000 --- a/google/iam_folder.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - cloudresourcemanager "google.golang.org/api/cloudresourcemanager/v1" - - "github.com/hashicorp/terraform-provider-google/google/services/resourcemanager" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -var IamFolderSchema = resourcemanager.IamFolderSchema - -func NewFolderIamUpdater(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (tpgiamresource.ResourceIamUpdater, error) { - return resourcemanager.NewFolderIamUpdater(d, config) -} - -func FolderIdParseFunc(d *schema.ResourceData, _ *transport_tpg.Config) error { - return resourcemanager.FolderIdParseFunc(d, nil) -} - -func canonicalFolderId(folder string) string { - return resourcemanager.CanonicalFolderId(folder) -} - -// Retrieve the existing IAM Policy for a folder -func getFolderIamPolicyByFolderName(folderName, userAgent string, config *transport_tpg.Config) (*cloudresourcemanager.Policy, error) { - return resourcemanager.GetFolderIamPolicyByFolderName(folderName, userAgent, config) -} diff --git a/google/iam_organization.go b/google/iam_organization.go deleted file mode 100644 index be73b65fd0c..00000000000 --- a/google/iam_organization.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/hashicorp/terraform-provider-google/google/services/resourcemanager" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -var IamOrganizationSchema = resourcemanager.IamOrganizationSchema - -func NewOrganizationIamUpdater(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (tpgiamresource.ResourceIamUpdater, error) { - return resourcemanager.NewOrganizationIamUpdater(d, config) -} - -func OrgIdParseFunc(d *schema.ResourceData, _ *transport_tpg.Config) error { - return resourcemanager.OrgIdParseFunc(d, nil) -} diff --git a/google/iam_project.go b/google/iam_project.go deleted file mode 100644 index b8a679efb80..00000000000 --- a/google/iam_project.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/hashicorp/terraform-provider-google/google/services/resourcemanager" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -var IamProjectSchema = resourcemanager.IamProjectSchema - -func NewProjectIamUpdater(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (tpgiamresource.ResourceIamUpdater, error) { - return resourcemanager.NewProjectIamUpdater(d, config) -} - -func ProjectIdParseFunc(d *schema.ResourceData, _ *transport_tpg.Config) error { - return resourcemanager.ProjectIdParseFunc(d, nil) -} - -func compareProjectName(_, old, new string, _ *schema.ResourceData) bool { - // We can either get "projects/project-id" or "project-id", so strip any prefixes - return resourcemanager.CompareProjectName("", old, new, nil) -} diff --git a/google/image.go b/google/image.go deleted file mode 100644 index dbc8f5d4fe6..00000000000 --- a/google/image.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/compute" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// built-in projects to look for images/families containing the string -// on the left in -var imageMap = compute.ImageMap - -// If the given name is a URL, return it. -// If it's in the form projects/{project}/global/images/{image}, return it -// If it's in the form projects/{project}/global/images/family/{family}, return it -// If it's in the form global/images/{image}, return it -// If it's in the form global/images/family/{family}, return it -// If it's in the form family/{family}, check if it's a family in the current project. If it is, return it as global/images/family/{family}. -// -// If not, check if it could be a GCP-provided family, and if it exists. If it does, return it as projects/{project}/global/images/family/{family}. -// -// If it's in the form {project}/{family-or-image}, check if it's an image in the named project. If it is, return it as projects/{project}/global/images/{image}. -// -// If not, check if it's a family in the named project. If it is, return it as projects/{project}/global/images/family/{family}. -// -// If it's in the form {family-or-image}, check if it's an image in the current project. If it is, return it as global/images/{image}. -// -// If not, check if it could be a GCP-provided image, and if it exists. If it does, return it as projects/{project}/global/images/{image}. -// If not, check if it's a family in the current project. If it is, return it as global/images/family/{family}. -// If not, check if it could be a GCP-provided family, and if it exists. If it does, return it as projects/{project}/global/images/family/{family} -// -// Deprecated: For backward compatibility resolveImage is still working, -// but all new code should use ResolveImage in the compute package instead. -func resolveImage(c *transport_tpg.Config, project, name, userAgent string) (string, error) { - return compute.ResolveImage(c, project, name, userAgent) -} diff --git a/google/import.go b/google/import.go deleted file mode 100644 index 1047eaba226..00000000000 --- a/google/import.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Parse an import id extracting field values using the given list of regexes. -// They are applied in order. The first in the list is tried first. -// -// e.g: -// - projects/(?P[^/]+)/regions/(?P[^/]+)/subnetworks/(?P[^/]+) (applied first) -// - (?P[^/]+)/(?P[^/]+)/(?P[^/]+), -// - (?P[^/]+) (applied last) -// -// Deprecated: For backward compatibility ParseImportId is still working, -// but all new code should use ParseImportId in the tpgresource package instead. -func ParseImportId(idRegexes []string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) error { - return tpgresource.ParseImportId(idRegexes, d, config) -} - -// Parse an import id extracting field values using the given list of regexes. -// They are applied in order. The first in the list is tried first. -// This does not mutate any of the parameters, returning a map of matches -// Similar to ParseImportId in import.go, but less import specific -// -// e.g: -// - projects/(?P[^/]+)/regions/(?P[^/]+)/subnetworks/(?P[^/]+) (applied first) -// - (?P[^/]+)/(?P[^/]+)/(?P[^/]+), -// - (?P[^/]+) (applied last) -// -// Deprecated: For backward compatibility getImportIdQualifiers is still working, -// but all new code should use GetImportIdQualifiers in the tpgresource package instead. -func getImportIdQualifiers(idRegexes []string, d tpgresource.TerraformResourceData, config *transport_tpg.Config, id string) (map[string]string, error) { - return tpgresource.GetImportIdQualifiers(idRegexes, d, config, id) -} diff --git a/google/logging_exclusion_billing_account.go b/google/logging_exclusion_billing_account.go deleted file mode 100644 index d222ea8ab77..00000000000 --- a/google/logging_exclusion_billing_account.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/hashicorp/terraform-provider-google/google/services/logging" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -var BillingAccountLoggingExclusionSchema = logging.BillingAccountLoggingExclusionSchema - -func NewBillingAccountLoggingExclusionUpdater(d *schema.ResourceData, config *transport_tpg.Config) (logging.ResourceLoggingExclusionUpdater, error) { - return logging.NewBillingAccountLoggingExclusionUpdater(d, config) -} - -func BillingAccountLoggingExclusionIdParseFunc(d *schema.ResourceData, _ *transport_tpg.Config) error { - return logging.BillingAccountLoggingExclusionIdParseFunc(d, nil) -} diff --git a/google/logging_exclusion_folder.go b/google/logging_exclusion_folder.go deleted file mode 100644 index a38593a9e10..00000000000 --- a/google/logging_exclusion_folder.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/hashicorp/terraform-provider-google/google/services/logging" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -var FolderLoggingExclusionSchema = logging.FolderLoggingExclusionSchema - -func NewFolderLoggingExclusionUpdater(d *schema.ResourceData, config *transport_tpg.Config) (logging.ResourceLoggingExclusionUpdater, error) { - return logging.NewFolderLoggingExclusionUpdater(d, config) -} - -func FolderLoggingExclusionIdParseFunc(d *schema.ResourceData, _ *transport_tpg.Config) error { - return logging.FolderLoggingExclusionIdParseFunc(d, nil) -} diff --git a/google/logging_exclusion_organization.go b/google/logging_exclusion_organization.go deleted file mode 100644 index 431725c9c9b..00000000000 --- a/google/logging_exclusion_organization.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/hashicorp/terraform-provider-google/google/services/logging" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -var OrganizationLoggingExclusionSchema = logging.OrganizationLoggingExclusionSchema - -func NewOrganizationLoggingExclusionUpdater(d *schema.ResourceData, config *transport_tpg.Config) (logging.ResourceLoggingExclusionUpdater, error) { - return logging.NewOrganizationLoggingExclusionUpdater(d, config) -} - -func OrganizationLoggingExclusionIdParseFunc(d *schema.ResourceData, _ *transport_tpg.Config) error { - return logging.OrganizationLoggingExclusionIdParseFunc(d, nil) -} diff --git a/google/logging_exclusion_project.go b/google/logging_exclusion_project.go deleted file mode 100644 index 630628cade0..00000000000 --- a/google/logging_exclusion_project.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - - "github.com/hashicorp/terraform-provider-google/google/services/logging" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -var ProjectLoggingExclusionSchema = logging.ProjectLoggingExclusionSchema - -func NewProjectLoggingExclusionUpdater(d *schema.ResourceData, config *transport_tpg.Config) (logging.ResourceLoggingExclusionUpdater, error) { - return logging.NewProjectLoggingExclusionUpdater(d, config) -} - -func ProjectLoggingExclusionIdParseFunc(d *schema.ResourceData, config *transport_tpg.Config) error { - return logging.ProjectLoggingExclusionIdParseFunc(d, config) -} diff --git a/google/logging_utils.go b/google/logging_utils.go deleted file mode 100644 index 1726b3f2871..00000000000 --- a/google/logging_utils.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/logging" -) - -// loggingSinkResourceTypes contains all the possible Stackdriver Logging resource types. Used to parse ids safely. -var loggingSinkResourceTypes = logging.LoggingSinkResourceTypes - -type LoggingSinkId = logging.LoggingSinkId - -// parseLoggingSinkId parses a canonical id into a LoggingSinkId, or returns an error on failure. -func parseLoggingSinkId(id string) (*LoggingSinkId, error) { - return logging.ParseLoggingSinkId(id) -} diff --git a/google/metadata.go b/google/metadata.go deleted file mode 100644 index 96f27e5385a..00000000000 --- a/google/metadata.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "google.golang.org/api/compute/v1" - - tpgcompute "github.com/hashicorp/terraform-provider-google/google/services/compute" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Since the google compute API uses optimistic locking, there is a chance -// we need to resubmit our updated metadata. To do this, you need to provide -// an update function that attempts to submit your metadata -func MetadataRetryWrapper(update func() error) error { - return transport_tpg.MetadataRetryWrapper(update) -} - -// Update the metadata (serverMD) according to the provided diff (oldMDMap v -// newMDMap). -// -// Deprecated: For backward compatibility MetadataUpdate is still working, -// but all new code should use PollCheckKnaMetadataUpdatetiveStatusFunc in the tpgcompute package instead. -func MetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, serverMD *compute.Metadata) { - tpgcompute.MetadataUpdate(oldMDMap, newMDMap, serverMD) -} - -// Update the beta metadata (serverMD) according to the provided diff (oldMDMap v -// newMDMap). -// -// Deprecated: For backward compatibility BetaMetadataUpdate is still working, -// but all new code should use BetaMetadataUpdate in the tpgcompute package instead. -func BetaMetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, serverMD *compute.Metadata) { - tpgcompute.BetaMetadataUpdate(oldMDMap, newMDMap, serverMD) -} - -// This function differs from flattenMetadataBeta only in that it takes -// compute.metadata rather than compute.metadata as an argument. It should -// be removed in favour of flattenMetadataBeta if/when all resources using it get -// beta support. -// -// Deprecated: For backward compatibility flattenMetadata is still working, -// but all new code should use FlattenMetadata in the tpgcompute package instead. -func flattenMetadata(metadata *compute.Metadata) map[string]interface{} { - return tpgcompute.FlattenMetadata(metadata) -} diff --git a/google/network_security_address_group_operation.go b/google/network_security_address_group_operation.go deleted file mode 100644 index 376657ca4b9..00000000000 --- a/google/network_security_address_group_operation.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/networksecurity" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// NetworkSecurityAddressGroupOperationWaitTime is specific for address group resource because the only difference is that it does not need project param. -func NetworkSecurityAddressGroupOperationWaitTime(config *transport_tpg.Config, op map[string]interface{}, activity, userAgent string, timeout time.Duration) error { - // project is not necessary for this operation. - return networksecurity.NetworkSecurityAddressGroupOperationWaitTime(config, op, activity, userAgent, timeout) -} diff --git a/google/path_or_contents.go b/google/path_or_contents.go deleted file mode 100644 index 023ce0febfe..00000000000 --- a/google/path_or_contents.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/verify" -) - -// If the argument is a path, pathOrContents loads it and returns the contents, -// otherwise the argument is assumed to be the desired contents and is simply -// returned. -// -// The boolean second return value can be called `wasPath` - it indicates if a -// path was detected and a file loaded. -func pathOrContents(poc string) (string, bool, error) { - return verify.PathOrContents(poc) -} diff --git a/google/provider_test_utils.go b/google/provider_test_utils.go deleted file mode 100644 index 50e37510665..00000000000 --- a/google/provider_test_utils.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "testing" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" -) - -const TestEnvVar = acctest.TestEnvVar - -var TestAccProviders map[string]*schema.Provider - -var CredsEnvVars = acctest.CredsEnvVars - -var projectNumberEnvVars = acctest.ProjectNumberEnvVars - -var ProjectEnvVars = acctest.ProjectEnvVars - -var firestoreProjectEnvVars = acctest.FirestoreProjectEnvVars - -var regionEnvVars = acctest.RegionEnvVars - -var zoneEnvVars = acctest.ZoneEnvVars - -var orgEnvVars = acctest.OrgEnvVars - -// This value is the Customer ID of the GOOGLE_ORG_DOMAIN workspace. -// See https://admin.google.com/ac/accountsettings when logged into an org admin for the value. -var custIdEnvVars = acctest.CustIdEnvVars - -// This value is the username of an identity account within the GOOGLE_ORG_DOMAIN workspace. -// For example in the org example.com with a user "foo@example.com", this would be set to "foo". -// See https://admin.google.com/ac/users when logged into an org admin for a list. -var identityUserEnvVars = acctest.IdentityUserEnvVars - -var orgEnvDomainVars = acctest.OrgEnvDomainVars - -var serviceAccountEnvVars = acctest.ServiceAccountEnvVars - -var orgTargetEnvVars = acctest.OrgTargetEnvVars - -// This is the billing account that will be charged for the infrastructure used during testing. For -// that reason, it is also the billing account used for creating new projects. -var billingAccountEnvVars = acctest.BillingAccountEnvVars - -// This is the billing account that will be modified to test billing-related functionality. It is -// expected to have more permissions granted to the test user and support subaccounts. -var masterBillingAccountEnvVars = acctest.MasterBillingAccountEnvVars - -// This value is the description used for test PublicAdvertisedPrefix setup to avoid required DNS -// setup. This is only used during integration tests and would be invalid to surface to users -var papDescriptionEnvVars = acctest.PapDescriptionEnvVars - -func init() { - TestAccProviders = acctest.TestAccProviders -} - -func GoogleProviderConfig(t *testing.T) *transport_tpg.Config { - return acctest.GoogleProviderConfig(t) -} - -func AccTestPreCheck(t *testing.T) { - acctest.AccTestPreCheck(t) -} - -// GetTestRegion has the same logic as the provider's GetRegion, to be used in tests. -func GetTestRegion(is *terraform.InstanceState, config *transport_tpg.Config) (string, error) { - return acctest.GetTestRegion(is, config) -} - -// GetTestProject has the same logic as the provider's GetProject, to be used in tests. -func GetTestProject(is *terraform.InstanceState, config *transport_tpg.Config) (string, error) { - return acctest.GetTestProject(is, config) -} - -// AccTestPreCheck ensures at least one of the project env variables is set. -func GetTestProjectNumberFromEnv() string { - return acctest.GetTestProjectNumberFromEnv() -} - -// AccTestPreCheck ensures at least one of the project env variables is set. -func GetTestProjectFromEnv() string { - return acctest.GetTestProjectFromEnv() -} - -// AccTestPreCheck ensures at least one of the credentials env variables is set. -func GetTestCredsFromEnv() string { - return acctest.GetTestCredsFromEnv() -} - -// AccTestPreCheck ensures at least one of the region env variables is set. -func GetTestRegionFromEnv() string { - return acctest.GetTestRegionFromEnv() -} - -func GetTestZoneFromEnv() string { - return acctest.GetTestZoneFromEnv() -} - -func GetTestCustIdFromEnv(t *testing.T) string { - return acctest.GetTestCustIdFromEnv(t) -} - -func GetTestIdentityUserFromEnv(t *testing.T) string { - return acctest.GetTestIdentityUserFromEnv(t) -} - -// Firestore can't be enabled at the same time as Datastore, so we need a new -// project to manage it until we can enable Firestore programmatically. -func GetTestFirestoreProjectFromEnv(t *testing.T) string { - return acctest.GetTestFirestoreProjectFromEnv(t) -} - -// Returns the raw organization id like 1234567890, skipping the test if one is -// not found. -func GetTestOrgFromEnv(t *testing.T) string { - return acctest.GetTestOrgFromEnv(t) -} - -// Alternative to GetTestOrgFromEnv that doesn't need *testing.T -// If using this, you need to process unset values at the call site -func UnsafeGetTestOrgFromEnv() string { - return acctest.UnsafeGetTestOrgFromEnv() -} - -func GetTestOrgDomainFromEnv(t *testing.T) string { - return acctest.GetTestOrgDomainFromEnv(t) -} - -func GetTestOrgTargetFromEnv(t *testing.T) string { - return acctest.GetTestOrgTargetFromEnv(t) -} - -// This is the billing account that will be charged for the infrastructure used during testing. For -// that reason, it is also the billing account used for creating new projects. -func GetTestBillingAccountFromEnv(t *testing.T) string { - return acctest.GetTestBillingAccountFromEnv(t) -} - -// This is the billing account that will be modified to test billing-related functionality. It is -// expected to have more permissions granted to the test user and support subaccounts. -func GetTestMasterBillingAccountFromEnv(t *testing.T) string { - return acctest.GetTestMasterBillingAccountFromEnv(t) -} - -func GetTestServiceAccountFromEnv(t *testing.T) string { - return acctest.GetTestServiceAccountFromEnv(t) -} - -func GetTestPublicAdvertisedPrefixDescriptionFromEnv(t *testing.T) string { - return acctest.GetTestPublicAdvertisedPrefixDescriptionFromEnv(t) -} - -// Some tests fail during VCR. One common case is race conditions when creating resources. -// If a test config adds two fine-grained resources with the same parent it is undefined -// which will be created first, causing VCR to fail ~50% of the time -func SkipIfVcr(t *testing.T) { - acctest.SkipIfVcr(t) -} - -func SleepInSecondsForTest(t int) resource.TestCheckFunc { - return acctest.SleepInSecondsForTest(t) -} - -func SkipIfEnvNotSet(t *testing.T, envs ...string) { - acctest.SkipIfEnvNotSet(t, envs...) -} diff --git a/google/pubsub_utils.go b/google/pubsub_utils.go deleted file mode 100644 index 0f0d9bbe6db..00000000000 --- a/google/pubsub_utils.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/pubsub" -) - -const PubsubTopicRegex = pubsub.PubsubTopicRegex - -func getComputedSubscriptionName(project, subscription string) string { - return pubsub.GetComputedSubscriptionName(project, subscription) -} - -func getComputedTopicName(project, topic string) string { - return pubsub.GetComputedTopicName(project, topic) -} diff --git a/google/regional_utils.go b/google/regional_utils.go deleted file mode 100644 index 4dff164c8f1..00000000000 --- a/google/regional_utils.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -//These functions are used by both the `resource_container_node_pool` and `resource_container_cluster` for handling regional clusters - -// Deprecated: For backward compatibility isZone is still working, -// but all new code should use IsZone in the tpgresource package instead. -func isZone(location string) bool { - return tpgresource.IsZone(location) -} - -// getLocation attempts to get values in this order (if they exist): -// - location argument in the resource config -// - region argument in the resource config -// - zone argument in the resource config -// - zone argument set in the provider config -// -// Deprecated: For backward compatibility getLocation is still working, -// but all new code should use GetLocation in the tpgresource package instead. -func getLocation(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (string, error) { - return tpgresource.GetLocation(d, config) -} - -// getZone reads the "zone" value from the given resource data and falls back -// to provider's value if not given. If neither is provided, returns an error. -// -// Deprecated: For backward compatibility getZone is still working, -// but all new code should use GetZone in the tpgresource package instead. -func getZone(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (string, error) { - return tpgresource.GetZone(d, config) -} diff --git a/google/resource_bigtable_gc_policy.go b/google/resource_bigtable_gc_policy.go deleted file mode 100644 index ca9722ece38..00000000000 --- a/google/resource_bigtable_gc_policy.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "cloud.google.com/go/bigtable" - tpgbigtable "github.com/hashicorp/terraform-provider-google/google/services/bigtable" -) - -// Recursively convert Bigtable GC policy to JSON format in a map. -func gcPolicyToGCRuleString(gc bigtable.GCPolicy, topLevel bool) (map[string]interface{}, error) { - return tpgbigtable.GcPolicyToGCRuleString(gc, topLevel) -} diff --git a/google/resource_bigtable_table.go b/google/resource_bigtable_table.go deleted file mode 100644 index acbb5dbd8a2..00000000000 --- a/google/resource_bigtable_table.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/bigtable" -) - -func flattenColumnFamily(families []string) []map[string]interface{} { - return bigtable.FlattenColumnFamily(families) -} diff --git a/google/resource_cloudfunctions_function.go b/google/resource_cloudfunctions_function.go deleted file mode 100644 index b55976f1d8f..00000000000 --- a/google/resource_cloudfunctions_function.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/cloudfunctions" -) - -type cloudFunctionId = cloudfunctions.CloudFunctionId diff --git a/google/resource_compute_attached_disk.go b/google/resource_compute_attached_disk.go deleted file mode 100644 index cd80d4f0de0..00000000000 --- a/google/resource_compute_attached_disk.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - tpgcompute "github.com/hashicorp/terraform-provider-google/google/services/compute" - "google.golang.org/api/compute/v1" -) - -func findDiskByName(disks []*compute.AttachedDisk, id string) *compute.AttachedDisk { - return tpgcompute.FindDiskByName(disks, id) -} diff --git a/google/resource_dataflow_job.go b/google/resource_dataflow_job.go deleted file mode 100644 index 2d39e15aac5..00000000000 --- a/google/resource_dataflow_job.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/dataflow" -) - -var dataflowTerminatingStatesMap = dataflow.DataflowTerminatingStatesMap - -var dataflowTerminalStatesMap = dataflow.DataflowTerminalStatesMap diff --git a/google/resource_google_organization_policy.go b/google/resource_google_organization_policy.go deleted file mode 100644 index ebf4aaa4db6..00000000000 --- a/google/resource_google_organization_policy.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/resourcemanager" -) - -func canonicalOrgPolicyConstraint(constraint string) string { - return resourcemanager.CanonicalOrgPolicyConstraint(constraint) -} diff --git a/google/resource_google_project.go b/google/resource_google_project.go deleted file mode 100644 index c5b40f202cf..00000000000 --- a/google/resource_google_project.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/resourcemanager" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - "google.golang.org/api/cloudresourcemanager/v1" -) - -func PrefixedProject(pid string) string { - return resourcemanager.PrefixedProject(pid) -} - -func parseFolderId(v interface{}) string { - return resourcemanager.ParseFolderId(v) -} - -func EnableServiceUsageProjectServices(services []string, project, billingProject, userAgent string, config *transport_tpg.Config, timeout time.Duration) error { - return resourcemanager.EnableServiceUsageProjectServices(services, project, billingProject, userAgent, config, timeout) -} - -func ListCurrentlyEnabledServices(project, billingProject, userAgent string, config *transport_tpg.Config, timeout time.Duration) (map[string]struct{}, error) { - return resourcemanager.ListCurrentlyEnabledServices(project, billingProject, userAgent, config, timeout) -} - -// Retrieve the existing IAM Policy for a Project -func getProjectIamPolicy(project string, config *transport_tpg.Config) (*cloudresourcemanager.Policy, error) { - return resourcemanager.GetProjectIamPolicy(project, config) -} diff --git a/google/resource_iam_audit_config.go b/google/resource_iam_audit_config.go deleted file mode 100644 index c0bd50cf127..00000000000 --- a/google/resource_iam_audit_config.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" -) - -// Deprecated: For backward compatibility ResourceIamAuditConfig is still working, -// but all new code should use ResourceIamAuditConfig in the tpgiamresource package instead. -func ResourceIamAuditConfig(parentSpecificSchema map[string]*schema.Schema, newUpdaterFunc tpgiamresource.NewResourceIamUpdaterFunc, resourceIdParser tpgiamresource.ResourceIdParserFunc, options ...func(*tpgiamresource.IamSettings)) *schema.Resource { - return tpgiamresource.ResourceIamAuditConfig(parentSpecificSchema, newUpdaterFunc, resourceIdParser, options...) -} diff --git a/google/resource_iam_binding.go b/google/resource_iam_binding.go deleted file mode 100644 index ef0cb0018c5..00000000000 --- a/google/resource_iam_binding.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" - "google.golang.org/api/cloudresourcemanager/v1" -) - -// Deprecated: For backward compatibility ResourceIamBinding is still working, -// but all new code should use ResourceIamBinding in the tpgiamresource package instead. -func ResourceIamBinding(parentSpecificSchema map[string]*schema.Schema, newUpdaterFunc tpgiamresource.NewResourceIamUpdaterFunc, resourceIdParser tpgiamresource.ResourceIdParserFunc, options ...func(*tpgiamresource.IamSettings)) *schema.Resource { - return tpgiamresource.ResourceIamBinding(parentSpecificSchema, newUpdaterFunc, resourceIdParser, options...) -} - -// Deprecated: For backward compatibility expandIamCondition is still working, -// but all new code should use ExpandIamCondition in the tpgiamresource package instead. -func expandIamCondition(v interface{}) *cloudresourcemanager.Expr { - return tpgiamresource.ExpandIamCondition(v) -} - -// Deprecated: For backward compatibility flattenIamCondition is still working, -// but all new code should use FlattenIamCondition in the tpgiamresource package instead. -func flattenIamCondition(condition *cloudresourcemanager.Expr) []map[string]interface{} { - return tpgiamresource.FlattenIamCondition(condition) -} diff --git a/google/resource_iam_member.go b/google/resource_iam_member.go deleted file mode 100644 index 1737bea7dab..00000000000 --- a/google/resource_iam_member.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" -) - -// Deprecated: For backward compatibility ResourceIamMember is still working, -// but all new code should use ResourceIamMember in the tpgiamresource package instead. -func ResourceIamMember(parentSpecificSchema map[string]*schema.Schema, newUpdaterFunc tpgiamresource.NewResourceIamUpdaterFunc, resourceIdParser tpgiamresource.ResourceIdParserFunc, options ...func(*tpgiamresource.IamSettings)) *schema.Resource { - return tpgiamresource.ResourceIamMember(parentSpecificSchema, newUpdaterFunc, resourceIdParser, options...) -} diff --git a/google/resource_iam_policy.go b/google/resource_iam_policy.go deleted file mode 100644 index 3bc82543351..00000000000 --- a/google/resource_iam_policy.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-google/google/tpgiamresource" -) - -// Deprecated: For backward compatibility ResourceIamPolicy is still working, -// but all new code should use ResourceIamPolicy in the tpgiamresource package instead. -func ResourceIamPolicy(parentSpecificSchema map[string]*schema.Schema, newUpdaterFunc tpgiamresource.NewResourceIamUpdaterFunc, resourceIdParser tpgiamresource.ResourceIdParserFunc, options ...func(*tpgiamresource.IamSettings)) *schema.Resource { - return tpgiamresource.ResourceIamPolicy(parentSpecificSchema, newUpdaterFunc, resourceIdParser, options...) -} diff --git a/google/resource_logging_exclusion.go b/google/resource_logging_exclusion.go deleted file mode 100644 index 963a50ccabd..00000000000 --- a/google/resource_logging_exclusion.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import "github.com/hashicorp/terraform-provider-google/google/services/logging" - -// parseLoggingExclusionId parses a canonical id into a LoggingExclusionId, or returns an error on failure. -func parseLoggingExclusionId(id string) (*logging.LoggingExclusionId, error) { - return logging.ParseLoggingExclusionId(id) -} diff --git a/google/resource_manager_operation.go b/google/resource_manager_operation.go deleted file mode 100644 index 3149f4243a8..00000000000 --- a/google/resource_manager_operation.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/resourcemanager" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// nolint: deadcode,unused -func ResourceManagerOperationWaitTimeWithResponse(config *transport_tpg.Config, op map[string]interface{}, response *map[string]interface{}, activity, userAgent string, timeout time.Duration) error { - return resourcemanager.ResourceManagerOperationWaitTimeWithResponse(config, op, response, activity, userAgent, timeout) -} - -func ResourceManagerOperationWaitTime(config *transport_tpg.Config, op map[string]interface{}, activity, userAgent string, timeout time.Duration) error { - return resourcemanager.ResourceManagerOperationWaitTime(config, op, activity, userAgent, timeout) -} diff --git a/google/resource_service_networking_connection.go b/google/resource_service_networking_connection.go deleted file mode 100644 index 42719b6f3bd..00000000000 --- a/google/resource_service_networking_connection.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/servicenetworking" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -// NOTE(craigatgoogle): An out of band aspect of this API is that it uses a unique formatting of network -// different from the standard self_link URI. It requires a call to the resource manager to get the project -// number for the current project. -func retrieveServiceNetworkingNetworkName(d *schema.ResourceData, config *transport_tpg.Config, network, userAgent string) (string, error) { - return servicenetworking.RetrieveServiceNetworkingNetworkName(d, config, network, userAgent) - -} diff --git a/google/resource_storage_bucket_acl.go b/google/resource_storage_bucket_acl.go deleted file mode 100644 index 79133918307..00000000000 --- a/google/resource_storage_bucket_acl.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/storage" -) - -func getRoleEntityPair(role_entity string) (*storage.RoleEntity, error) { - return storage.GetRoleEntityPair(role_entity) -} diff --git a/google/resource_storage_notification.go b/google/resource_storage_notification.go deleted file mode 100644 index 2bbab65420f..00000000000 --- a/google/resource_storage_notification.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/services/storage" -) - -func resourceStorageNotificationParseID(id string) (string, string) { - return storage.ResourceStorageNotificationParseID(id) -} diff --git a/google/retry_utils.go b/google/retry_utils.go deleted file mode 100644 index 332f9bc452a..00000000000 --- a/google/retry_utils.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Deprecated: For backward compatibility retry is still working, -// but all new code should use Retry in the transport_tpg package instead. -func retry(retryFunc func() error) error { - return transport_tpg.Retry(transport_tpg.RetryOptions{ - RetryFunc: retryFunc, - }) -} - -// Deprecated: For backward compatibility retryTime is still working, -// but all new code should use RetryTime in the transport_tpg package instead. -func retryTime(retryFunc func() error, minutes int) error { - return RetryTimeDuration(retryFunc, time.Duration(minutes)*time.Minute) -} - -// Deprecated: For backward compatibility RetryTimeDuration is still working, -// but all new code should use RetryTimeDuration in the transport_tpg package instead. -func RetryTimeDuration(retryFunc func() error, duration time.Duration, errorRetryPredicates ...transport_tpg.RetryErrorPredicateFunc) error { - return transport_tpg.Retry(transport_tpg.RetryOptions{ - RetryFunc: retryFunc, - Timeout: duration, - ErrorRetryPredicates: errorRetryPredicates, - }) -} - -// Deprecated: For backward compatibility isRetryableError is still working, -// but all new code should use IsRetryableError in the transport_tpg package instead. -func isRetryableError(topErr error, customPredicates ...transport_tpg.RetryErrorPredicateFunc) bool { - return transport_tpg.IsRetryableError(topErr, customPredicates, nil) -} - -// The polling overrides the default backoff logic with max backoff of 10s. The poll interval can be greater than 10s. -// -// Deprecated: For backward compatibility retryWithPolling is still working, -// but all new code should use RetryWithPolling in the transport_tpg package instead. -func retryWithPolling(retryFunc func() (interface{}, error), timeout time.Duration, pollInterval time.Duration, errorRetryPredicates ...transport_tpg.RetryErrorPredicateFunc) (interface{}, error) { - return "", transport_tpg.Retry(transport_tpg.RetryOptions{ - RetryFunc: func() error { - _, err := retryFunc() - return err - }, - Timeout: timeout, - PollInterval: pollInterval, - ErrorRetryPredicates: errorRetryPredicates, - }) -} diff --git a/google/runadminv3_operation.go b/google/runadminv3_operation.go deleted file mode 100644 index 2d76d284b54..00000000000 --- a/google/runadminv3_operation.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/cloudrunv2" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - - "google.golang.org/api/run/v2" -) - -// Deprecated: For backward compatibility runAdminV2OperationWaitTimeWithResponse is still working, -// but all new code should use RunAdminV2OperationWaitTimeWithResponse in the cloudrunv2 package instead. -func runAdminV2OperationWaitTimeWithResponse(config *transport_tpg.Config, op *run.GoogleLongrunningOperation, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error { - return cloudrunv2.RunAdminV2OperationWaitTimeWithResponse(config, op, response, project, activity, userAgent, timeout) -} - -// Deprecated: For backward compatibility runAdminV2OperationWaitTime is still working, -// but all new code should use RunAdminV2OperationWaitTime in the cloudrunv2 package instead. -func runAdminV2OperationWaitTime(config *transport_tpg.Config, op *run.GoogleLongrunningOperation, project, activity, userAgent string, timeout time.Duration) error { - return cloudrunv2.RunAdminV2OperationWaitTime(config, op, project, activity, userAgent, timeout) -} diff --git a/google/self_link_helpers.go b/google/self_link_helpers.go deleted file mode 100644 index f790927d281..00000000000 --- a/google/self_link_helpers.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -// Compare only the resource name of two self links/paths. -// -// Deprecated: For backward compatibility compareResourceNames is still working, -// but all new code should use CompareResourceNames in the tpgresource package instead. -func compareResourceNames(_, old, new string, _ *schema.ResourceData) bool { - return tpgresource.CompareResourceNames("", old, new, nil) -} - -// Compare only the relative path of two self links. -// -// Deprecated: For backward compatibility compareSelfLinkRelativePaths is still working, -// but all new code should use CompareSelfLinkRelativePaths in the tpgresource package instead. -func compareSelfLinkRelativePaths(_, old, new string, _ *schema.ResourceData) bool { - return tpgresource.CompareSelfLinkRelativePaths("", old, new, nil) -} - -// compareSelfLinkOrResourceName checks if two resources are the same resource -// -// Use this method when the field accepts either a name or a self_link referencing a resource. -// The value we store (i.e. `old` in this method), must be a self_link. -// -// Deprecated: For backward compatibility compareSelfLinkOrResourceName is still working, -// but all new code should use CompareSelfLinkOrResourceName in the tpgresource package instead. -func compareSelfLinkOrResourceName(_, old, new string, _ *schema.ResourceData) bool { - return tpgresource.CompareSelfLinkOrResourceName("", old, new, nil) -} - -// Hash the relative path of a self link. -// -// Deprecated: For backward compatibility selfLinkRelativePathHash is still working, -// but all new code should use SelfLinkRelativePathHash in the tpgresource package instead. -func selfLinkRelativePathHash(selfLink interface{}) int { - return tpgresource.SelfLinkRelativePathHash(selfLink) -} - -// Deprecated: For backward compatibility getRelativePath is still working, -// but all new code should use GetRelativePath in the tpgresource package instead. -func getRelativePath(selfLink string) (string, error) { - return tpgresource.GetRelativePath(selfLink) -} - -// Hash the name path of a self link. -// -// Deprecated: For backward compatibility selfLinkNameHash is still working, -// but all new code should use SelfLinkNameHash in the tpgresource package instead. -func selfLinkNameHash(selfLink interface{}) int { - return tpgresource.SelfLinkNameHash(selfLink) -} - -// Deprecated: For backward compatibility ConvertSelfLinkToV1 is still working, -// but all new code should use ConvertSelfLinkToV1 in the tpgresource package instead. -func ConvertSelfLinkToV1(link string) string { - return tpgresource.ConvertSelfLinkToV1(link) -} - -// Deprecated: For backward compatibility GetResourceNameFromSelfLink is still working, -// but all new code should use Hashcode in the GetResourceNameFromSelfLink package instead. -func GetResourceNameFromSelfLink(link string) string { - return tpgresource.GetResourceNameFromSelfLink(link) -} - -// Deprecated: For backward compatibility NameFromSelfLinkStateFunc is still working, -// but all new code should use NameFromSelfLinkStateFunc in the tpgresource package instead. -func NameFromSelfLinkStateFunc(v interface{}) string { - return tpgresource.NameFromSelfLinkStateFunc(v) -} - -// Deprecated: For backward compatibility StoreResourceName is still working, -// but all new code should use StoreResourceName in the tpgresource package instead. -func StoreResourceName(resourceLink interface{}) string { - return tpgresource.StoreResourceName(resourceLink) -} - -// Deprecated: For backward compatibility GetZonalResourcePropertiesFromSelfLinkOrSchema is still working, -// but all new code should use GetZonalResourcePropertiesFromSelfLinkOrSchema in the tpgresource package instead. -func GetZonalResourcePropertiesFromSelfLinkOrSchema(d *schema.ResourceData, config *transport_tpg.Config) (string, string, string, error) { - return tpgresource.GetZonalResourcePropertiesFromSelfLinkOrSchema(d, config) -} - -// Deprecated: For backward compatibility GetRegionalResourcePropertiesFromSelfLinkOrSchema is still working, -// but all new code should use GetRegionalResourcePropertiesFromSelfLinkOrSchema in the tpgresource package instead. -func GetRegionalResourcePropertiesFromSelfLinkOrSchema(d *schema.ResourceData, config *transport_tpg.Config) (string, string, string, error) { - return tpgresource.GetRegionalResourcePropertiesFromSelfLinkOrSchema(d, config) -} - -// given a full locational (non-global) self link, returns the project + region/zone + name or an error -// -// Deprecated: For backward compatibility GetLocationalResourcePropertiesFromSelfLinkString is still working, -// but all new code should use GetLocationalResourcePropertiesFromSelfLinkString in the tpgresource package instead. -func GetLocationalResourcePropertiesFromSelfLinkString(selfLink string) (string, string, string, error) { - return tpgresource.GetLocationalResourcePropertiesFromSelfLinkString(selfLink) -} - -// This function supports selflinks that have regions and locations in their paths -// -// Deprecated: For backward compatibility GetRegionFromRegionalSelfLink is still working, -// but all new code should use GetRegionFromRegionalSelfLink in the tpgresource package instead. -func GetRegionFromRegionalSelfLink(selfLink string) string { - return tpgresource.GetRegionFromRegionalSelfLink(selfLink) -} diff --git a/google/service_account_waiter.go b/google/service_account_waiter.go deleted file mode 100644 index d24b44d72c6..00000000000 --- a/google/service_account_waiter.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/resourcemanager" - "google.golang.org/api/iam/v1" -) - -func serviceAccountKeyWaitTime(client *iam.ProjectsServiceAccountsKeysService, keyName, publicKeyType, activity string, timeout time.Duration) error { - return resourcemanager.ServiceAccountKeyWaitTime(client, keyName, publicKeyType, activity, timeout) -} diff --git a/google/service_networking_operation.go b/google/service_networking_operation.go deleted file mode 100644 index c8b1be73958..00000000000 --- a/google/service_networking_operation.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - tpgservicenetworking "github.com/hashicorp/terraform-provider-google/google/services/servicenetworking" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - "google.golang.org/api/servicenetworking/v1" -) - -// Deprecated: For backward compatibility ServiceNetworkingOperationWaitTime is still working, -// but all new code should use ServiceNetworkingOperationWaitTime in the tpgservicenetworking package instead. -func ServiceNetworkingOperationWaitTime(config *transport_tpg.Config, op *servicenetworking.Operation, activity, userAgent, project string, timeout time.Duration) error { - return tpgservicenetworking.ServiceNetworkingOperationWaitTime(config, op, activity, userAgent, project, timeout) -} diff --git a/google/service_scope.go b/google/service_scope.go deleted file mode 100644 index 7fd9a9e5afc..00000000000 --- a/google/service_scope.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-provider-google/google/tpgresource" -) - -func canonicalizeServiceScope(scope string) string { - return tpgresource.CanonicalizeServiceScope(scope) -} - -func canonicalizeServiceScopes(scopes []string) []string { - return tpgresource.CanonicalizeServiceScopes(scopes) -} - -func stringScopeHashcode(v interface{}) int { - return tpgresource.StringScopeHashcode(v) -} diff --git a/google/serviceman_operation.go b/google/serviceman_operation.go deleted file mode 100644 index e59920f10ac..00000000000 --- a/google/serviceman_operation.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - tpgservicemanagement "github.com/hashicorp/terraform-provider-google/google/services/servicemanagement" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - "google.golang.org/api/googleapi" - "google.golang.org/api/servicemanagement/v1" -) - -// Deprecated: For backward compatibility ServiceManagementOperationWaitTime is still working, -// but all new code should use ServiceManagementOperationWaitTime in the tpgservicemanagement package instead. -func ServiceManagementOperationWaitTime(config *transport_tpg.Config, op *servicemanagement.Operation, activity, userAgent string, timeout time.Duration) (googleapi.RawMessage, error) { - return tpgservicemanagement.ServiceManagementOperationWaitTime(config, op, activity, userAgent, timeout) -} diff --git a/google/services/dataplex/resource_dataplex_task_test.go b/google/services/dataplex/resource_dataplex_task_test.go index 4eb8ef88516..52eda3d98d4 100644 --- a/google/services/dataplex/resource_dataplex_task_test.go +++ b/google/services/dataplex/resource_dataplex_task_test.go @@ -1,22 +1,5 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** Type: MMv1 *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Magic Modules and manual -// changes will be clobbered when the file is regenerated. -// -// Please read more about how to change this file in -// .github/CONTRIBUTING.md. -// -// ---------------------------------------------------------------------------- - package dataplex_test import ( @@ -25,13 +8,14 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-provider-google/google/acctest" + "github.com/hashicorp/terraform-provider-google/google/envvar" ) func TestAccDataplexTaskDataplexTask_update(t *testing.T) { t.Parallel() context := map[string]interface{}{ - "project_name": acctest.GetTestProjectFromEnv(), + "project_name": envvar.GetTestProjectFromEnv(), "random_suffix": acctest.RandString(t, 10), } diff --git a/google/services/resourcemanager/resource_google_project_iam_member_test.go b/google/services/resourcemanager/resource_google_project_iam_member_test.go index 6dbd4bd6861..0a390a73e59 100644 --- a/google/services/resourcemanager/resource_google_project_iam_member_test.go +++ b/google/services/resourcemanager/resource_google_project_iam_member_test.go @@ -57,7 +57,7 @@ func TestAccProjectIamMember_multiple(t *testing.T) { t.Parallel() org := envvar.GetTestOrgFromEnv(t) - acctest.SkipIfEnvNotSet(t, "GOOGLE_ORG") + envvar.SkipIfEnvNotSet(t, "GOOGLE_ORG") pid := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) resourceName := "google_project_iam_member.acceptance" @@ -100,7 +100,7 @@ func TestAccProjectIamMember_remove(t *testing.T) { t.Parallel() org := envvar.GetTestOrgFromEnv(t) - acctest.SkipIfEnvNotSet(t, "GOOGLE_ORG") + envvar.SkipIfEnvNotSet(t, "GOOGLE_ORG") pid := fmt.Sprintf("tf-test-%d", acctest.RandInt(t)) resourceName := "google_project_iam_member.acceptance" diff --git a/google/services/resourcemanager/resource_google_project_test.go b/google/services/resourcemanager/resource_google_project_test.go index 37e7e1e8f9b..77fc4975ae2 100644 --- a/google/services/resourcemanager/resource_google_project_test.go +++ b/google/services/resourcemanager/resource_google_project_test.go @@ -77,7 +77,7 @@ func TestAccProject_billing(t *testing.T) { org := envvar.GetTestOrgFromEnv(t) // This is a second billing account that can be charged, which is used only in this test to // verify that a project can update its billing account. - acctest.SkipIfEnvNotSet(t, "GOOGLE_BILLING_ACCOUNT_2") + envvar.SkipIfEnvNotSet(t, "GOOGLE_BILLING_ACCOUNT_2") billingId2 := os.Getenv("GOOGLE_BILLING_ACCOUNT_2") billingId := envvar.GetTestBillingAccountFromEnv(t) pid := fmt.Sprintf("%s-%d", TestPrefix, acctest.RandInt(t)) diff --git a/google/services/storage/resource_storage_bucket_acl_test.go b/google/services/storage/resource_storage_bucket_acl_test.go index 4bf7deee5e3..4b71480d378 100644 --- a/google/services/storage/resource_storage_bucket_acl_test.go +++ b/google/services/storage/resource_storage_bucket_acl_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/hashicorp/terraform-provider-google/google/acctest" + "github.com/hashicorp/terraform-provider-google/google/envvar" "github.com/hashicorp/terraform-provider-google/google/services/storage" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -30,7 +31,7 @@ func TestAccStorageBucketAcl_basic(t *testing.T) { t.Parallel() bucketName := acctest.TestBucketName(t) - acctest.SkipIfEnvNotSet(t, "GOOGLE_PROJECT_NUMBER") + envvar.SkipIfEnvNotSet(t, "GOOGLE_PROJECT_NUMBER") acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), @@ -51,7 +52,7 @@ func TestAccStorageBucketAcl_upgrade(t *testing.T) { t.Parallel() bucketName := acctest.TestBucketName(t) - acctest.SkipIfEnvNotSet(t, "GOOGLE_PROJECT_NUMBER") + envvar.SkipIfEnvNotSet(t, "GOOGLE_PROJECT_NUMBER") acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), @@ -89,7 +90,7 @@ func TestAccStorageBucketAcl_upgradeSingleUser(t *testing.T) { t.Parallel() bucketName := acctest.TestBucketName(t) - acctest.SkipIfEnvNotSet(t, "GOOGLE_PROJECT_NUMBER") + envvar.SkipIfEnvNotSet(t, "GOOGLE_PROJECT_NUMBER") acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), @@ -127,7 +128,7 @@ func TestAccStorageBucketAcl_downgrade(t *testing.T) { t.Parallel() bucketName := acctest.TestBucketName(t) - acctest.SkipIfEnvNotSet(t, "GOOGLE_PROJECT_NUMBER") + envvar.SkipIfEnvNotSet(t, "GOOGLE_PROJECT_NUMBER") acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), @@ -182,7 +183,7 @@ func TestAccStorageBucketAcl_unordered(t *testing.T) { t.Parallel() bucketName := acctest.TestBucketName(t) - acctest.SkipIfEnvNotSet(t, "GOOGLE_PROJECT_NUMBER") + envvar.SkipIfEnvNotSet(t, "GOOGLE_PROJECT_NUMBER") acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), diff --git a/google/services/storage/resource_storage_notification_test.go b/google/services/storage/resource_storage_notification_test.go index 95beb97904a..fa07ead4d1d 100644 --- a/google/services/storage/resource_storage_notification_test.go +++ b/google/services/storage/resource_storage_notification_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/hashicorp/terraform-provider-google/google/acctest" + "github.com/hashicorp/terraform-provider-google/google/envvar" tpgstorage "github.com/hashicorp/terraform-provider-google/google/services/storage" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -23,7 +24,7 @@ var ( func TestAccStorageNotification_basic(t *testing.T) { t.Parallel() - acctest.SkipIfEnvNotSet(t, "GOOGLE_PROJECT") + envvar.SkipIfEnvNotSet(t, "GOOGLE_PROJECT") var notification storage.Notification bucketName := acctest.TestBucketName(t) @@ -67,7 +68,7 @@ func TestAccStorageNotification_basic(t *testing.T) { func TestAccStorageNotification_withEventsAndAttributes(t *testing.T) { t.Parallel() - acctest.SkipIfEnvNotSet(t, "GOOGLE_PROJECT") + envvar.SkipIfEnvNotSet(t, "GOOGLE_PROJECT") var notification storage.Notification bucketName := acctest.TestBucketName(t) diff --git a/google/sqladmin_operation.go b/google/sqladmin_operation.go deleted file mode 100644 index 8676d5d5919..00000000000 --- a/google/sqladmin_operation.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/sql" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Deprecated: For backward compatibility SqlAdminOperationWaitTime is still working, -// but all new code should use SqlAdminOperationWaitTime in the sql package instead. -func SqlAdminOperationWaitTime(config *transport_tpg.Config, res interface{}, project, activity, userAgent string, timeout time.Duration) error { - return sql.SqlAdminOperationWaitTime(config, res, project, activity, userAgent, timeout) -} - -// Retry if Cloud SQL operation returns a 429 with a specific message for -// concurrent operations. -// -// Deprecated: For backward compatibility IsSqlInternalError is still working, -// but all new code should use IsSqlInternalError in the sql package instead. -func IsSqlInternalError(err error) (bool, string) { - return sql.IsSqlInternalError(err) -} diff --git a/google/stateful_mig_polling.go b/google/stateful_mig_polling.go deleted file mode 100644 index 24ab5c5192c..00000000000 --- a/google/stateful_mig_polling.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - tpgcompute "github.com/hashicorp/terraform-provider-google/google/services/compute" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Deprecated: For backward compatibility PollCheckInstanceConfigDeleted is still working, -// but all new code should use PollCheckInstanceConfigDeleted in the tpgcompute package instead. -func PollCheckInstanceConfigDeleted(resp map[string]interface{}, respErr error) transport_tpg.PollResult { - return tpgcompute.PollCheckInstanceConfigDeleted(resp, respErr) -} diff --git a/google/tags_location_operation.go b/google/tags_location_operation.go deleted file mode 100644 index 42c1ae124d5..00000000000 --- a/google/tags_location_operation.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/tags" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// Deprecated: For backward compatibility TagsLocationOperationWaitTimeWithResponse is still working, -// but all new code should use TagsLocationOperationWaitTimeWithResponse in the tags package instead. -func TagsLocationOperationWaitTimeWithResponse(config *transport_tpg.Config, op map[string]interface{}, response *map[string]interface{}, activity, userAgent string, timeout time.Duration) error { - return tags.TagsLocationOperationWaitTimeWithResponse(config, op, response, activity, userAgent, timeout) -} - -// Deprecated: For backward compatibility TagsLocationOperationWaitTime is still working, -// but all new code should use TagsLocationOperationWaitTime in the tags package instead. -func TagsLocationOperationWaitTime(config *transport_tpg.Config, op map[string]interface{}, activity, userAgent string, timeout time.Duration) error { - return tags.TagsLocationOperationWaitTime(config, op, activity, userAgent, timeout) -} - -// Deprecated: For backward compatibility GetLocationFromOpName is still working, -// but all new code should use GetLocationFromOpName in the tags package instead. -func GetLocationFromOpName(opName string) string { - return tags.GetLocationFromOpName(opName) -} diff --git a/google/test-fixtures/apigateway/api_descriptor.pb b/google/test-fixtures/apigateway/api_descriptor.pb deleted file mode 100644 index c288275adb193b331103a0cd42361e99ffcbcb8a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7924 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 diff --git a/google/test-fixtures/apigee/apigee_sharedflow_bundle2.zip b/google/test-fixtures/apigee/apigee_sharedflow_bundle2.zip deleted file mode 100644 index 6e15c11140339b09aeff8b62ba4c29eaa24b964d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2645 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 - See logs for full stacktrace. - """.format(e), 500 - - -if __name__ == '__main__': - # This is used when running locally. Gunicorn is used to run the - # application on Google App Engine. See entrypoint in app.yaml. - app.run(host='127.0.0.1', port=8080, debug=True) \ No newline at end of file diff --git a/google/test-fixtures/appengine/hello-world-flask/requirements.txt b/google/test-fixtures/appengine/hello-world-flask/requirements.txt deleted file mode 100644 index f358d0ad8e4..00000000000 --- a/google/test-fixtures/appengine/hello-world-flask/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Flask==1.1.1 -gunicorn==20.0.4 \ No newline at end of file diff --git a/google/test-fixtures/appengine/hello-world.zip b/google/test-fixtures/appengine/hello-world.zip deleted file mode 100644 index 658a65aed10922ea917facd4569026b3020ee423..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2418 zcmaKuc{r47AIHbo1`j3~PU@f-`%LzVO!g&)u^ao?hsH9(8^+RDDmjj|S2T8wB}I{4 zBPo%VT994wsFMhw0NW!z&h7)Cfr`U`VE^{cm z%ko|vBKA0`L{hwS>R-7-Ds>ubVFEnzX(dsbKl~d9E+_sWaAyvIWEqMZgcXv>Iru7K- z`^js_NvhQXkxq(N=pZl3O-jZMWjT}6P-fd;6YCTQbT;hLZIJ(0Ku}Ahvd0)X`lVUN zZ_Ev_n~HlpV3|Lm%a1^ypo zOWIjhC1~4M`A*SC&jJHvtuQij9}E&iTe*}DMOfFF82h}+8HzoTNg(i3GFmUJPUQ8( zbUNS+I3H!eI-~BSHeeduugb?dD^@m2UAZVjUZ>uGzjut707V@Y`6ezB70SIKRVPE7 zA7x+vk$-jOWW=;&&OJVQn6vL`Co9fFW0T|MM?b2BIxn)T z6hn+{{BiRELqrSN10KjQ^M;Gr@N;U);3|1@PRrdaSgD(>ds#aGb`ld8z(n_No~H#N zHIp94=GD0cVwYqK3Z}Xy^iF!8^;awKuI<6C@a*w%@6hbAWAbtTTRvP&K2`=g`e*|r z!RxPZ%B=hL64<&bFSG=gl{?V3m2=YYt={-Zh{Z*|dyP4{n9^P&o?X(lEO?(z6rPPoQHF1V*yVI&RuZ7Yy5yo$07ANsdV6NE= zm{vEtiMZR9^mf`(t|Z-0B$4uhLCkIMyUNy+96h@RGAqn405($wS?>|); zIIZk?+*sNbdoW+4OZ!=~|9dyVBrGN;n7in!X}?M={r!{d)P;?gYTTK#p3{v*Kzn3( z>f)KuC9z@tu5OY-k;19*;quoD8}_w!iPopRav4Tg_}Xnpwl_Wz=`tCCN|KLP$qk$n zTw(*uFRv}c+`q8hK6$Pn^J&nYRXhYk4^14@bTn-fBYU1y<(_Njjl`%4;w1Tgd@7 zKE*jFGUK)7CmU9$2G$A%RgTN#!w#YGas2EfLX8Q!gaBHu0@N|^#5jdgmKib{O3n6W z^Hs$RzuH1T{|Tq+4d1P8_%866Fltymd|1}ykw=>9vbRRA&*m2i{Ab^qGHp-ocLhlS zD=lwWs!XhDcBM9Vgt9p7@TC-6^U$iMnL2J7wVse`Xk<3Rxq znDF6IaX}`O_eBy-Cc?9KKeCTWu3pGM4B`3io-*^HW1EeA50Oa8k}ZiTs+v43vWjoW z{Pp2{#!?YD4?6ssgs8DYRhy)>C+$_MctD-MLn5Xk>P5y8oz%#_R81Q_u&I&6MvjwD z%g~wjvEtXO(Gku4F1VfA*+)v-y}~`wEU<@VHgKd%v)?BHv0qHOCS7%+*KN1vO}FDG zuSGZOYF#oXgGgGzVU_x@HxJTwpkNVR`~<-GB7Zva?SxhY?3iBX;e$ug3?H_~)dAa~ zg1U(Va){oDm`UQVQ!%2Sd8c#mEzfz>9t{UHT~DvFrq;_D1H9u#F7xwT=7!QGA=2mp zlM=w0Jl)ny1kSok+Q7!(UjAvJO~WKAY$0lQE{U=@wmS=2bPGF$t`-uL`YdAQsJ;?K zLoVUN*9#ikZpj^tE`or7{|*@1 zrSW^8e-0Rs{|y)z(;pS~cT3<01qL%1Ki*(JSJ@vVt{+t5SwZ{z?9V0km&x&iL^b=r ZOWDic{`2e{dquJ_7Z3ASEg^fmKLDn;+_(S$ diff --git a/google/test-fixtures/bigquerytable/avro-generated.avro b/google/test-fixtures/bigquerytable/avro-generated.avro deleted file mode 100644 index c10ee312e51001511bf88887fb5fbf07e89489ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 285 zcmeZI%3@>@Nh~YM*GtY%NloU+E6vFf1M`cMGg5OC*D+Tsl~fj_Dp@HNr6%VWr6}nr zDlqQ3WB|~dwaw?|AoP2CH#?~?<&)e|ZxcWy$!-wl4tJKc7 IGGK@R0J`61nE(I) diff --git a/google/test-fixtures/bigquerytable/simple/data/00000-0-4e4a11ad-368c-496b-97ae-e3ac28051a4d-00001.parquet b/google/test-fixtures/bigquerytable/simple/data/00000-0-4e4a11ad-368c-496b-97ae-e3ac28051a4d-00001.parquet deleted file mode 100644 index 3d7d5cecd196e3c3f090ddf0dbdbfd22b00a28f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 524 zcmY+C&q~8U5XPrzjYX;;xN8>n5Efb#YH5|;2owd!GaXJ&u%@eRBE!&8R=lgwrx&+nh>l9ebmnF+AbFaRLW^V$BgwknIivW2!KDZ zEq=}v5NKA4ytkEEwl+eI0mj$0MBm`Zw_bBkDt){~)m2FvPj#xQ>icRh9H?%+s)iv( zgG6;No>W$Gs%q?yGXCF?)E492G>nlL62j_2b}66DP1IuIxw^Yd7jo#2{~*7DLqAGz zHoKgGb$si`cT-IFMzMX5aS~3(wo`N5nrrU_(=Zy?trmK9-L7{$uf31D>1t08{eA5< af))-v&viW4)t$z!kdofyEeFu2fA9q)k%2q_ diff --git a/google/test-fixtures/bigquerytable/simple/metadata/00000-1114da6b-bb88-4b5a-94bd-370f286c858a.metadata.json b/google/test-fixtures/bigquerytable/simple/metadata/00000-1114da6b-bb88-4b5a-94bd-370f286c858a.metadata.json deleted file mode 100644 index 732b1ef7af8..00000000000 --- a/google/test-fixtures/bigquerytable/simple/metadata/00000-1114da6b-bb88-4b5a-94bd-370f286c858a.metadata.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "format-version": 1, - "table-uuid": "20f6c20d-d535-4c0c-be82-cb25d31e9250", - "location": "/home/iceberg/warehouse/simple", - "last-updated-ms": 1686356696798, - "last-column-id": 2, - "schema": { - "type": "struct", - "schema-id": 0, - "fields": [ - { - "id": 1, - "name": "one", - "required": false, - "type": "string" - }, - { - "id": 2, - "name": "two", - "required": false, - "type": "long" - } - ] - }, - "current-schema-id": 0, - "schemas": [ - { - "type": "struct", - "schema-id": 0, - "fields": [ - { - "id": 1, - "name": "one", - "required": false, - "type": "string" - }, - { - "id": 2, - "name": "two", - "required": false, - "type": "long" - } - ] - } - ], - "partition-spec": [], - "default-spec-id": 0, - "partition-specs": [ - { - "spec-id": 0, - "fields": [] - } - ], - "last-partition-id": 999, - "default-sort-order-id": 0, - "sort-orders": [ - { - "order-id": 0, - "fields": [] - } - ], - "properties": { - "owner": "root" - }, - "current-snapshot-id": -1, - "refs": {}, - "snapshots": [], - "snapshot-log": [], - "metadata-log": [] -} \ No newline at end of file diff --git a/google/test-fixtures/bigquerytable/test.parquet.gzip b/google/test-fixtures/bigquerytable/test.parquet.gzip deleted file mode 100644 index b0681f33d75ba44228d87856e97ae63d9c08d377..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 909 zcmb7Dv2NQi5T#wh&<~K1P`4F07%AWgmXLNRytGrspy*blGHud{8i`UVs)%72@SZ=( zHw5{H%>9cFo!g^iI8xyvCiIV@MF0k`H5oAs7$`p;tHXvFrC@KAX+B z5L+}Fd_pL^kAJ>|{L_r(7E#Oi@%-1iX7s)3>7ZO(%8V0?Kx^A0eHSnCH0&4d?8}7(L=9Ik6QE;=y*qRoo5H> z^sYxS^m7LVSAv)BEnYLQT4gFul#ti5WbgdXYqm^eDq_Vm342wg>DXtPG+c1QA2VHC zRavo$&8n~*me0S+g<-&Jr1n6TTuX7BC?hYVW}9=UXdE1pwoquB{8M~i(Uph(Z%+=W zH~G!j|LcslP4uKtUGZN+_3^aiCf6{PHA|DZ=6Yo(wB)5Jxc*kjdQ9J?E|XkYB$`A~ z5Jtg-fl*dpOx&5#736H8=ITOP*WH^a4c7+n2_U7B1%zQ8<~EG#neT3;r5Xlrg8G19 r$|MH7v_;Q1$PHSSkBgPL%$2`u;O{;ANAoI4g+F { - let message = req.query.message || req.body.message || "Secret: " + process.env.MY_SECRET; - res.status(200).send(message); -}; \ No newline at end of file diff --git a/google/test-fixtures/cloudfunctions/secret_volumes_mount.js b/google/test-fixtures/cloudfunctions/secret_volumes_mount.js deleted file mode 100644 index 3b100a8237b..00000000000 --- a/google/test-fixtures/cloudfunctions/secret_volumes_mount.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * HTTP Cloud Function for testing volume mount Secrets. - */ -const fs = require('fs') -exports.echoSecret = (req, res) => { - const path = '/etc/secrets/test-secret' - fs.access(path, fs.F_OK, (err) => { - if (err) { - console.error(err) - res.status(200).send(err) - return - } - fs.readFile(path, 'utf8', function (err, data) { - res.status(200).send("Secret: " + data) - - }); - }) -}; \ No newline at end of file diff --git a/google/test-fixtures/cloudfunctions2/function-source-eventarc-gcs.zip b/google/test-fixtures/cloudfunctions2/function-source-eventarc-gcs.zip deleted file mode 100644 index 5c731f5f5a9e81ad220866d94d95d85166a50eaa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 597 zcmWIWW@Zs#-~d8&020Z}OG&NJ%PLNpaM16tfq={Ve_f7FURqmU&RxZ^a#4)n2gcGl zy~$U%9*h%Swd#N0oQ^FAO3S~UJ)`wrX|b>0#*cbQy$jCvP41FXB;MyLRcV#pZV!tq+wI-TbF;U~bBnW4Cx# zaei^tGBkZ*U3B=W!(_+C=8LnKly<5)J#sMg@|`+kQE1jCeeNQezVr7i^q%d|*|6`p zCkMlcyL*?Os)~Jg&&|qoMgRV;GY5~C?>hYUCDY1JFZP`NYkXph#`Spn~NvnTmzV(2ALdC5;Ni6?54fxsxW>$$kzv)%O&cN{he}FeT zM|u3~n|zE64CjG30B0ET0K>2#F*!RiJrx*=`FX3J1qA?sm#41BS#Qs?-sgOD!!`vq zbTp;PT>AX^a&b`U!Cx+WeV*iP^!amF>E$k=;^5PtyEjc;BQoVt&sUx=JW~$r z%G#O52(%dDlm?mevjTw@g#vMaHzSh>10q6^orxL6u;@kCg=`|o3kcu>v=!My0p6@^ QAXz3LECAA=;9y_?02l7oF#rGn diff --git a/google/test-fixtures/cloudfunctions2/function-source-pubsub.zip b/google/test-fixtures/cloudfunctions2/function-source-pubsub.zip deleted file mode 100644 index 0d6860aa6e3ac35fcc2bcfdbca4e98b1078c1f54..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 696 zcmWIWW@Zs#U|`^2VDh~k68d!ePJKoOhCe{e!63tsnU|7Up_f%08p6rIoP2j@QVI~4 zR&X;gvh23zU|t? z6>)Ii!EN)a{8KmjsJi6$CQkH-UVU?^+wQ{$W=ZonN=~_%5cuk#o1Roj-;5T^BO=H6 z&d5KQz_{Vv^VTz+yg3bPxf`E`A&UeW=p$Bfyo>u-?#$EO1 z!lyUW!VB`A&lIkbdCGS{*=G4JH~nn?*)=(Sj(^0Hl$3QXCtrIqx$X(y5%J3K&c-=1 zUhZn~drJj<9{#!zD6>B7PrkcdeE>Ybzxdn^c@)_g<_!#fKOp7-26#bYa&}^RDlo|N z^T2`b0}OBwMho=S&w>I1ygYS1&U$;E^*-mL8@4HE1zQ)RtL&xEpDz~&l};}Hi55-JWp{keNnqu10&Jzsgg@Jwm2%G#N=lOe#Hkx7mjR~nE2I*fq< zm>d|EG=f-&6u}Bf5oiuWHVxB*$fgwn4Mp`X&_pa=4e(}V1KG?3gbP446Nm=@OdI`} diff --git a/google/test-fixtures/cloudfunctions2/index-js b/google/test-fixtures/cloudfunctions2/index-js deleted file mode 100644 index 70723fa354c..00000000000 --- a/google/test-fixtures/cloudfunctions2/index-js +++ /dev/null @@ -1,5 +0,0 @@ -const functions = require('@google-cloud/functions-framework'); - -functions.http('helloHttp', (req, res) => { - res.send(`Hello ${req.query.name || req.body.name || 'World'}!`); -}); \ No newline at end of file diff --git a/google/test-fixtures/deploymentmanager/service_account.yml.tmpl b/google/test-fixtures/deploymentmanager/service_account.yml.tmpl deleted file mode 100644 index dc8dbb2a40b..00000000000 --- a/google/test-fixtures/deploymentmanager/service_account.yml.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -resources: -- name: "%{account_id}" - type: iam.v1.serviceAccount - properties: - accountId: "%{account_id}" - displayName: "Test service account created by Terraform-created Deployment" diff --git a/google/test-fixtures/dlp/words.txt b/google/test-fixtures/dlp/words.txt deleted file mode 100644 index 3bffd2820b0..00000000000 --- a/google/test-fixtures/dlp/words.txt +++ /dev/null @@ -1,3 +0,0 @@ -word -word2 -custom \ No newline at end of file diff --git a/google/test-fixtures/fake_account.json b/google/test-fixtures/fake_account.json index f3362d6d2ae..52214ea66b1 100644 --- a/google/test-fixtures/fake_account.json +++ b/google/test-fixtures/fake_account.json @@ -4,4 +4,4 @@ "client_email": "foo@bar.com", "client_id": "id@foo.com", "type": "service_account" -} +} \ No newline at end of file diff --git a/google/test-fixtures/fake_client.json b/google/test-fixtures/fake_client.json deleted file mode 100644 index d88fe4cd7e0..00000000000 --- a/google/test-fixtures/fake_client.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "web": { - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "client_secret": "foo", - "token_uri": "https://accounts.google.com/o/oauth2/token", - "client_email": "foo@developer.gserviceaccount.com", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/foo@developer.gserviceaccount.com", - "client_id": "foo.apps.googleusercontent.com", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs" - } -} diff --git a/google/test-fixtures/header-logo.png b/google/test-fixtures/header-logo.png deleted file mode 100644 index 7d65c7a1554ac20ed40231fc67ae5d5a1f46d123..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3368 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 diff --git a/google/test-fixtures/rsa_cert.pem b/google/test-fixtures/rsa_cert.pem deleted file mode 100644 index d8a834633c9..00000000000 --- a/google/test-fixtures/rsa_cert.pem +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICoDCCAYgCCQDzZ6R7RYs0sTANBgkqhkiG9w0BAQsFADARMQ8wDQYDVQQDDAZ1 -bnVzZWQwIBcNMTgwMTIwMTA0OTIzWhgPNDc1NTEyMTgxMDQ5MjNaMBExDzANBgNV -BAMMBnVudXNlZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMXX/5jI -tvxpst1mFVKVXfyu5S5AOQF+i/ny6Ef+h8py8y42XfsE2AAPSTE3JCIgWemw7NQ/ -xnTQ3f6b7/6+ZsdM4/hoiedwYV8X3LVPB9NRnKe82OHUhzo1psVMJVvHtE3GsD/V -i40ki/L4Xs64E2GJqQfrkgeNfIyCeKev64fR5aMazqOw1cNrVe34mY3L1hgXpn7e -SnO0oqnV86pTh+jTT8EKgo9AI7/QuJbPWpJhnj1/Fm8i3DdCdpQqloX9Fc4f6whA -XlZ2tkma0PsBraxMua5GPglJ7m3RabQIoyAW+4hEYAcu7U0wIhCK+C8WTNgEYZaK -zvp8vK6vOgBIjE0CAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAvVXus7dLikEAM6+I -6xeN7aHEMJRR0h2rigLiYjfl8R9zG/zxUPUunWPAYaKvWOFviXcX/KqpjDqIIeWx -Gm0yNfyalHq476nRCf/0t9AH5X4Qy0KJSW5KfhQLG9X2z/UiJxwHKCwaWZtEEzPu -mGqvwhNXUOL/GuAZCJWPdWrUGM4kHHz3kw5v3UPNS2xA7yMtN9N1b8/pkTQ77XNk -DA4wngA5zc7Ae72SJDrY8XXqLfL4Nagkrn6AOhGK3/Ewvca6hkThMcHI0WF2AqFo -mo3iGUJzR5lOUx+4RiEBC5NNEZsE9GMNEiu8kYvCAS0FMKYmxFPGx1U/kiOeeuIw -W3sOEA== ------END CERTIFICATE----- diff --git a/google/test-fixtures/rsa_csr.pem b/google/test-fixtures/rsa_csr.pem deleted file mode 100644 index acb70eb670e..00000000000 --- a/google/test-fixtures/rsa_csr.pem +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIDETCCAfkCAQAwVDELMAkGA1UEBhMCVVMxDzANBgNVBAoMBkdvb2dsZTETMBEG -A1UECwwKRW50ZXJwcmlzZTEfMB0GA1UEAwwWc2VydmVyLmVzb2RlbW9hcHAyLmNv -bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMZThbWkUvD8wxzP/v/t -918Z0fhDYgSrow75G1kIbUf5Z3qG+l0AyLadIo3SqN3ENQYf2+O1VP9Hk90tyvCS -iGqjXJLCLXdrwLLqHoqFDxwm3bQ0/AlOIpmilS++BdHUew0HfqZq9lJOFPAF3EtL -LPaE0eRbA2HguHe4q/7jIIr999vYuafCtetrzIBI8ke9+S2VvPPw+ni2KZvmTb1+ -DnIqq7QX/t92Y9RW1UgeXqvc/LbYwnIfSyCpea1IvHILup+eQ/R2aeIgzFrDbuS4 -ULrxdJrMu4UXXPJMbw7xSOAdhJoX+uky08bR3pbUbt6wNwwjuDLNLBIdlYZK6seL -QRsCAwEAAaB4MHYGCSqGSIb3DQEJDjFpMGcwDgYDVR0PAQH/BAQDAgeAMBMGA1Ud -JQQMMAoGCCsGAQUFBwMBMB0GA1UdDgQWBBQ/ZBWqbeL7spn5xkS9awVgZ5L1ITAh -BgNVHREEGjAYghZzZXJ2ZXIuZXNvZGVtb2FwcDIuY29tMA0GCSqGSIb3DQEBBQUA -A4IBAQAJoFccsGUrdoPRuhjvhrtjnj2D8hEAA0bt+numzT5E26Cte7HHRg2Jn2f7 -5qxNunesf86FBjOtg/dr3tKIAPAQ7H6yojq/XFFrKkbDpYodigdxeD4pQ2NaZxPU -2FJZoGyoxoUMb7wozROTJDRI0hAmkVUtUgta3UHtDuVXLYTwpKCBHqFi6Nshv8jO -XTHsr7G/a0ky0nnbzYvhilyzZQS7k1F2pQIhzTFZtvwzM9JvpWyzS7I8W8QX5YqG -bqDgRvIy7MHu0sWjOPvSKtU5ivW+wawEytspDxdEapivIAzY7wvMH27ixm0sfCxN -tRlgsGSzkSXGk9c4MHDtmGFFfD0U ------END CERTIFICATE REQUEST----- diff --git a/google/test-fixtures/rsa_private_4096.pem b/google/test-fixtures/rsa_private_4096.pem deleted file mode 100644 index 14be2aca825..00000000000 --- a/google/test-fixtures/rsa_private_4096.pem +++ /dev/null @@ -1,52 +0,0 @@ ------BEGIN PRIVATE KEY----- -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 -4xmS3YG5FDvzS9GmJK0YvstxZHMb28ii ------END PRIVATE KEY----- diff --git a/google/test-fixtures/rsa_public.pem b/google/test-fixtures/rsa_public.pem deleted file mode 100644 index 2b2acadf676..00000000000 --- a/google/test-fixtures/rsa_public.pem +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAv6weC1aT16l2qS6qdYcy -7BOjzP7TwT9zUAiFhWpL256GRqC8yQRdqMsi68Q//762IUyu/qaHbEgQ8WRmQdVV -GDlxkBfrA/iXB2dgujq8jh0HWIV2ev3TerV3aUwvYUlrowhq027SX9U1hbufdGCM -uKsHiF05ErgNvEuR8XAkeJ/YV2DV2+sRq+Wg9y4RwUYbdchdFty1d5SX/s0Yqswg -yOG9VoCdR7baF22ughVR44aRm+83mgtqAZ4M+Rpe7JGRsUGY/pR391Toi0s8En15 -JGiAhqX2W0Uo/FZZry3yuqRfdHYENB+ADuyTMTrUaKZv7eua0lTBz5oom3jSF3gv -I7SQoLdK/jhEVOOq41IjB8D60Sgd69bD7yTI516yvZ/s3AyKzW6f6KnjdbCcZKKT -0GAePNLNhDYfSlA9bwJ8HQS2FenSpSTArKvGiVrsinJuNjbQdPuQHcpWf9x1m3GR -TMvF+TNYM/lp7IL2VMbJRfWPy1iWxm9F1Yr6dkHVoLP7ocYkNRHoPLut5E6IFJtK -lVI2NneUYJGnYSO+1xPV9TqlJeMNwr3uFMAN8N/oB3f4WWwuRYgR0L5g2A+Lvx+g -bbdl+Tb/0CNfslfSuDrFV8Z4n6gVwb9ZPGlNHCvnqRfLUpRFJwmR7UYvzi/E7rXJ -EDkK+tcnPkz2JtjdLKR7qVcCAwEAAQ== ------END PUBLIC KEY----- diff --git a/google/test-fixtures/serviceaccount/public_key.pem b/google/test-fixtures/serviceaccount/public_key.pem deleted file mode 100644 index 033abb61632..00000000000 --- a/google/test-fixtures/serviceaccount/public_key.pem +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICnjCCAYYCCQD6STTBmcOGNTANBgkqhkiG9w0BAQsFADARMQ8wDQYDVQQDDAZ1 -bnVzZWQwHhcNMjAwODEwMTExNzU0WhcNMzAwODA4MTExNzU0WjARMQ8wDQYDVQQD -DAZ1bnVzZWQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAGCUQbs0l -yyalBW4rBgWvU2awMXiVyQMOhWMQVMd99CgtY4Rzktj7qWnPiKe/daegyz40FXuq -2Is8RThit4hx0RrdRFm8XXYpJjhHbIpCD/e5ukVMLNDIBqiMuFQI9naKcppuzOtL -htj3zOQ54qXwe183lrg60RHoVR95Z1QqnCGkZcyECGJMuQBEaYyTnzf/nFba05uP -LcZS1RHtdu5xfdDCrS9vDYA7R/3tvQ2erRvETSUFpMyIOxSMgZEBKhDhVfYqVh5T -gSo3fJ5oXHozdqno2nf+MkE71moP4LbwqUGrSWK19kLcOGnGxWzLwcJWDTDlnU1S -MC1y1T7GG+4dAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAKZXsIoQ7CZhtb7GL7m6 -tVO/Q4WuL2D3sL0EYHpHWMUDFZ9aXeiNEaTJLYeaAkVQ80y+i1D2xaK42S/m94sd -mq4UKy0sRN25brVXFGjhBNwk2iJlWPj9/ibttMLKMT2nxPWS+YQOCZXg5B60wUFD -mmKkdsbZmrLe2VX2lHGvWuZF2ZFpx9wKcrLmQBhQ/1tZV7k8bf/JiWlGkQqDzwBZ -m+xUNAUpu32QQwkNGUNte562KK9nzsbVD0qDBFcmh3sEirOgiU4ezEWdmbFhtcfH -Q1lTZZ1oD38RmMNPnJUHY+b7W57TrsYO5inFjBwjYJ4plTUG12RSZ8nPz6whZTK6 -Gys= ------END CERTIFICATE----- diff --git a/google/test-fixtures/ssh_rsa.pub b/google/test-fixtures/ssh_rsa.pub deleted file mode 100644 index c3f21e84492..00000000000 --- a/google/test-fixtures/ssh_rsa.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-rsa AAAAB3NzaC1yc2EXYZTDAQABAAABAQDK/Mq0qy+O5AaNc1Ag5SGb+toqGiMu9cnLA5irVDsuAIs+HACy7z+T8QnN6z/q3TtgWs5jZG4JPGQ4xj+ai3esM+hRIwGWmvxkNfJWAVzK61yBTUHh6p1PrS12h3tLmupDTBVtOzzcbszo9eD+3kXtKsNoxiRPGFhzGa20fBlVRwJkb22LAlXbrtdKWiyozjRA5DBiXmLbUQmF9PkyYwAHUvp6g6I0lgJioxvVLLdp6h6uThAtIudsbKXG5s9Vr2hJ0mlcnVa/la0bUqBEcxfECs6b2CXsWRBNVEjodSJ4cI4rtwKxuZgRXWflnQtDN5PJyPqhtynSTXYnRohXekUr diff --git a/google/test-fixtures/ssl_cert/test.crt b/google/test-fixtures/ssl_cert/test.crt deleted file mode 100644 index 122d22d85ca..00000000000 --- a/google/test-fixtures/ssl_cert/test.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDgjCCAmoCCQCPrrFCwXharzANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMC -VVMxETAPBgNVBAgMCE5ldy1Zb3JrMQwwCgYDVQQHDANOWUMxFTATBgNVBAoMDE9y -Z2FuaXphdGlvbjEQMA4GA1UECwwHU2VjdGlvbjEQMA4GA1UEAwwHTXkgTmFtZTEX -MBUGCSqGSIb3DQEJARYIbWVAbWUubWUwHhcNMTUxMTIwMTM0MTIwWhcNMTYxMTE5 -MTM0MTIwWjCBgjELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE5ldy1Zb3JrMQwwCgYD -VQQHDANOWUMxFTATBgNVBAoMDE9yZ2FuaXphdGlvbjEQMA4GA1UECwwHU2VjdGlv -bjEQMA4GA1UEAwwHTXkgTmFtZTEXMBUGCSqGSIb3DQEJARYIbWVAbWUubWUwggEi -MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDbTuIV7EySLAijNAnsXG7HO/m4 -pu1Yy2sWWcqIifaSq0pL3JUGmWRKFRTb4msFIuKrkvsMLxWy6zIOnx0okRb7sTKb -XLBiN7zjSLCD6k31zlllO0GHkPu923VeGZ52xlIWxo22R2yoRuddD0YkQPctV7q9 -H7sKJq2141Ut9reMT2LKVRPlzf8wTcv+F+cAc3/i9Tib90GqclGrwk6XE59RBgzT -m9V7b/V+uusDtj6T3/ne5MHnq4g6lUz4mE7FneDVealjx7fHXtWSmR7dfbJilJj1 -foR/wPBeopdR5wAZS26bHjFIBMqAc7AgxbXdMorEDIY4i2OFjPTu22YYtmFZAgMB -AAEwDQYJKoZIhvcNAQELBQADggEBAHmgedgYDSIPiyaZnCWG56jFqYtHYS5xMOFS -T4FBEPsqgjbSYgjiugeQ37+nsbg/NQf4Z/Ca9CS20f7et8pjZWYqbqdGbifHSUAP -MsR3MK/8EsNVskioufvgExNrqHbcJD8aKrBHAyA6NbjaTnnBPrwdfcXxnWdpPNOh -yG6xSdi807t2e7dX59Nr6Fg6DHd9XPEM7VL/k5RBQyBf1ZgrO9cwA2jl8UtWKpaa -fO24S7Acwggi9TjJnyHOhWh21DEUEQG+czXAd5/LSjynTcI7xmuyfEgqJPIrskPv -OqM8II/iNr9Zglvp6hlmzIWnhgwLZiEljYGuMRNhr21jlHsCCYY= ------END CERTIFICATE----- diff --git a/google/test-fixtures/ssl_cert/test.csr b/google/test-fixtures/ssl_cert/test.csr deleted file mode 100644 index dee9945edff..00000000000 --- a/google/test-fixtures/ssl_cert/test.csr +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICyDCCAbACAQAwgYIxCzAJBgNVBAYTAlVTMREwDwYDVQQIDAhOZXctWW9yazEM -MAoGA1UEBwwDTllDMRUwEwYDVQQKDAxPcmdhbml6YXRpb24xEDAOBgNVBAsMB1Nl -Y3Rpb24xEDAOBgNVBAMMB015IE5hbWUxFzAVBgkqhkiG9w0BCQEWCG1lQG1lLm1l -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA207iFexMkiwIozQJ7Fxu -xzv5uKbtWMtrFlnKiIn2kqtKS9yVBplkShUU2+JrBSLiq5L7DC8VsusyDp8dKJEW -+7Eym1ywYje840iwg+pN9c5ZZTtBh5D7vdt1XhmedsZSFsaNtkdsqEbnXQ9GJED3 -LVe6vR+7CiatteNVLfa3jE9iylUT5c3/ME3L/hfnAHN/4vU4m/dBqnJRq8JOlxOf -UQYM05vVe2/1frrrA7Y+k9/53uTB56uIOpVM+JhOxZ3g1XmpY8e3x17Vkpke3X2y -YpSY9X6Ef8DwXqKXUecAGUtumx4xSATKgHOwIMW13TKKxAyGOItjhYz07ttmGLZh -WQIDAQABoAAwDQYJKoZIhvcNAQELBQADggEBAGtNMtOtE7gUP5DbkZNxPsoGazkM -c3//gjH3MsTFzQ39r1uNq3fnbBBoYeQnsI05Bf7kSEVeT6fzdl5aBhOWxFF6uyTI -TZzcH9kvZ2IwFDbsa6vqrIJ6jIkpCIfPR8wN5LlBca9oZwJnt4ejF3RB5YBfnmeo -t5JXTbxGRvPBVRZCfJgcxcn731m1Rc8c9wud2IaNWiLob2J/92BJhSt/aiYps/TJ -ww5dRi6zhpxhR+RjlstG3C6oeYeQlSgzeBjhRcxtPHQWfcVfRLCtubqvuUQPcpw2 -YqMujh4vyKo+JEtqI8gqp4Bu0HVI1vr1vhblntFrQb0kueqV94HarE0uH+c= ------END CERTIFICATE REQUEST----- diff --git a/google/test-fixtures/ssl_cert/test.key b/google/test-fixtures/ssl_cert/test.key deleted file mode 100644 index 92dd451371a..00000000000 --- a/google/test-fixtures/ssl_cert/test.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEA207iFexMkiwIozQJ7Fxuxzv5uKbtWMtrFlnKiIn2kqtKS9yV -BplkShUU2+JrBSLiq5L7DC8VsusyDp8dKJEW+7Eym1ywYje840iwg+pN9c5ZZTtB -h5D7vdt1XhmedsZSFsaNtkdsqEbnXQ9GJED3LVe6vR+7CiatteNVLfa3jE9iylUT -5c3/ME3L/hfnAHN/4vU4m/dBqnJRq8JOlxOfUQYM05vVe2/1frrrA7Y+k9/53uTB -56uIOpVM+JhOxZ3g1XmpY8e3x17Vkpke3X2yYpSY9X6Ef8DwXqKXUecAGUtumx4x -SATKgHOwIMW13TKKxAyGOItjhYz07ttmGLZhWQIDAQABAoIBABEjzyOrfiiGbH5k -2MmyR64mj9PQqAgijdIHXn7hWXYJERtwt+z2HBJ2J1UwEvEp0tFaAWjoXSfInfbq -lJrRDBzLsorV6asjdA3HZpRIwaMOZ4oz4WE5AZPLDRc3pVzfDxdcmUK/vkxAjmCF -ixPWR/sxOhUB39phP35RsByRhbLfdGQkSspmD41imASqdqG96wsuc9Rk1Qjx9szr -kUxZkQGKUkRz4yQCwTR4+w2I21/cT5kxwM/KZG5f62tqB9urtFuTONrm7Z7xJv1T -BkHxQJxtsGhG8Dp8RB3t5PLou39xaBrjS5lpzJYtzrja25XGNEuONiQlWEDmk7li -acJWPQECgYEA98hjLlSO2sudUI36kJWc9CBqFznnUD2hIWRBM/Xc7mBhFGWxoxGm -f2xri91XbfH3oICIIBs52AdCyfjYbpF0clq8pSL+gHzRQTLcLUKVz3BxnxJAxyIG -QYPxmtMLVSzB5eZh+bPvcCyzd2ALDE1vFClQI/BcK/2dsJcXP2gSqdECgYEA4pTA -3okbdWOutnOwakyfVAbXjMx81D9ii2ZGHbuPY4PSD/tAe8onkEzHJgvinjddbi9p -oGwFhPqgfdWX7YNz5qsj9HP6Ehy7dw/EwvmX49yHsere85LiPMn/T9KkK0Pbn+HY -+0Q+ov/2wV3J7zPo8fffyQYizUKexGUN3XspGQkCgYEArFsMeobBE/q8g/MuzvHz -SnFduqhBebRU59hH7q/gLUSHYtvWM7ssWMh/Crw9e7HrcQ7XIZYup1FtqPZa/pZZ -LM5nGGt+IrwwBq0tMKJ3eOMbde4Jdzr4pQv1vJ9+65GFkritgDckn5/IeoopRTZ7 -xMd0AnvIcaUp0lNXDXkEOnECgYAk2C2YwlDdwOzrLFrWnkkWX9pzQdlWpkv/AQ2L -zjEd7JSfFqtAtfnDBEkqDaq3MaeWwEz70jT/j8XDUJVZARQ6wT+ig615foSZcs37 -Kp0hZ34FV30TvKHfYrWKpGUfx/QRxqcDDPDmjprwjLDGnflWR4lzZfUIzbmFlC0y -A9IGCQKBgH3ieP6nYCJexppvdxoycFkp3bSPr26MOCvACNsa+wJxBo59Zxs0YAmJ -9f6OOdUExueRY5iZCy0KPSgjYj96RuR0gV3cKc/WdOot4Ypgc/TK+r/UPDM2VAHk -yJuxkyXdOrstesxZIxpourS3kONtQUqMFmdqQeBngZl4v7yBtiRW ------END RSA PRIVATE KEY----- diff --git a/google/test-fixtures/test_api_descriptor.pb b/google/test-fixtures/test_api_descriptor.pb deleted file mode 100644 index 4b98d9f1435619b17749cf57ef52f88ad5ec7639..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8752 zcmb_hO?MN?6_r}DB$ol(jUgZ=oicfpdR6t_8}_#g?8=_& z?sc7|zUKz+&R}=RIp_y(3&PYV<)E}Mm`k%UgT_m*+4+`xP&hVTVq&yTSoQeN=Jz_m z{$QtonM-?a*Y52dxdBMu@ujza#^b-!66^KSAGO(aL8l-f;IXjfbh|(4xre@R0n{EVKMjp@sOI>W^WEw{@{gWX-n^Z6o|Q1d=-+kwqHy}#2B}ncE=CA&dwm{xIJ$7+I-+Upu>H4;I$m_%TA|fdv66V zKhF;#8+SeNUv~hW2X4Ew+iBT^kmt7NaCkoG1cB4$@cFva#vj4H9pGQIx^CA!?DY0{ z%k8y0^pQ^=0mljMgA)C7^B6IoySpKymfLpt!N3o&^1udDLbZ3?*A5VsVvP6Ppwn{l z80`4Gi!~C$ut%(Pln#Vwb?wf9<3Y)jNx<2V79k0&u|0rP5f64m~Kuz z-U)nKQBQ`6i|9SD-|`)YA_XG4-08LPD}X#Aao`4s0HH~M=mt9kC*Q>Y11@&McXxwB z3KJrV2;zRs}2R0N3qkBQRMpwkOIP@xnVYVqqf%EDq04|-*v0@%q$yaUfRZ> z!B=bbZOdHWX!4C(rEFLYUaXe!Yqe>arOjr|YA~KFHt=aqj1;Te+<0EMj7EdkEN(un zS4^M*-YQm`rqRfAv$|T@ESuH!JO=`=)|!l0%%^4(^P081aQoqRytc-l8rJFtV2UNP zVm7yh!!@&6C1-0ji}50_7p+e&yuNAGYYl_b%F1SAwNf;n8s!4~!zVYM8Pz6l zY!oY%(S`snIl>n@xkS*J@=UcEhlq znX5+Q0k70Z{x!bYFhHbSY!-!UU_dU6V*#bjhAD(It4+hQHtS8ZR=t5;-hwh%dJ*52 zg~GKet(IcNs9Dg4;S_lFVC0I7OhqF-0VJVTIpLBq$CjM(piO=Bt$YLB1|BXttNxa-1o04#QE4&g*c`s$dHr9 zfH2DDg)78`*p~`1r6 z>@542#a2Gu2|YhS-;1U z{*IDILOh5j=(F%)3>#jvaq zXNU?harm-#PFHUTB8<^oOy6Y_Lt&=hJ{@Cds@m=B=R`I9ykwa$`t-%qorLrLLl4_* zVkm4swUVK!p`VZF3i3TR9>uO+IGueoF@#oq$iR;b>;KhL3JW=>eM`YHyr&rIyY`XQ(dQ9#8&ym3kCY zvG3yS_hX_*F@+w*Z^lO24R`L1l!Vl6u&5K^qb?7-4Jd{1(&Bwa%b^u;N!azy8tq|ND(F(9d+qK`WKs*D zWFe~2F+p@-q9V0aY?uucMO$WbgQ|+7%2X9+Ws@o)Q9e=i@e@>cd9JE^=M7~jsNazz zk$|E<)No{%B6LrA3kek!;M4^hPy)Dzc8VvGJkiS$RXEx-J!E>_4thJH6X6eSe6%HO z>HqpqSo-LhYbqU{iBfjtv1G^$mr9?RC}odnG#I7qFp+kVttKNKo{3WS3$Z1YU}F*) zauSt37oxI4ls;t21Y4FqWUI+Y*)Pl%6vvCP#|jY`WXMTW`dl0>eaMuEvh*QaO$Oq{ zi$7-LOiN%fm($nSFPWB#QG;CYyQm zs3NFke-FudLk&`ghuUd7G(je-DN=1VGtC~cWJ*ZNH8Xn$mw?Qe?WnV6 zQstXJ_eE#{GCzNd-4c*EGzD!fJ3FL3krVyL57wOqY$0Nr25cc>ng(oPvBbU<1#@ya z_QQDgJe@h(m+1U}VOZ2HXU?*#ESVJNWJR0I&S3VS*Fj03KI))Hj|RXPO-bs>6>V8a zP9}6+(bBXcvOsGkBjS!M5Lr2Ujy(|A7`msO&x)Fw%DM2Zle8AlMU`#%zUu_uTRaCr z3vsEu#^Lpzwi0@c!|OdQqrB4Txi>E28(!(W+?&?fES4YFllNoAcvi=PgqY#&p;k{{ z-p`z291O)Z`4Foot<>tpH__rT12i6L_oXYCpz%;GUS6vY)#71+#zQRrx`2kCN7_vG z5-%c#MR^)7Uj-nE8`o%=kFNG%f1i)j6I~lGspz2ns z7uPhvKGq)12)$qe_HhJDx5Hzl9>xIs80y`EdYYar$JXQ7FA?QoL&HT16V=OTvUIyj zN`fh8uCN905v{Q`?fcm)(H(vA)k-sQ?AJ6IGO%#4)+WRWq%mNwO^eRzFUg2Yz111GAvNGK$*lH z)059)+aD8msQMaZO}FPWh`R{ZqD}Z5toezop>A8WDHK&q2i51=GpR02P<^hb${yo$ zMHLpPJ_psipo)Uv+t@GScyCXNgQ%VxB}#Ylx0y=-NG3)1@db#^@#E4S?sr=I;Zx^| zghA28N1*#c`&MLSgaNuQ6kXZCe4*&V0^JviZdy<7#2iUiov5gBDNj~OBsr>4D1(;n z`kl;WHV3+C4GC3S%VsYNUFq^brYzGI5fETVF^G9MS8a8!U?E!D6Y}nW1;qB$g>WVa zwl7^q0;44}dU8K@5YH~0sOM3+Ix1)ec>7@Z4H#yK;VTGw`^23GSE*}s!0@&W-GTTV z(!SF6MS4nTkoJ|578X3cQqsZ#^H-1-T_ViHP*{mI^IGO;3at9Cpu5vOAD!Tu=66gSg07KD>fd-94()IKcXui>wH~K>v3jL{g z9~T-0nkO}a2}eQXh#sZ@uP6l`#^5NJoD$*0^yC}V>mLcHqt3yoObmE$5Kcb^RYo$s zgG|fEsLJbaR3>?+jEV#Ri1bc-BLfO1xW7}}VZqlsB@!%fe+QB1eP9$&?;(_evs+!Oi>0sj!p&Z|c-o0{{R3 diff --git a/google/test-fixtures/workflow.yaml b/google/test-fixtures/workflow.yaml deleted file mode 100644 index 07d6c6ff1f2..00000000000 --- a/google/test-fixtures/workflow.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# This is a sample workflow that simply logs the incoming Pub/Sub event -# Note that $$ is needed for Terraform - -main: - params: [event] - steps: - - log_event: - call: sys.log - args: - text: $${event} - severity: INFO - - decode_pubsub_message: - assign: - - base64: $${base64.decode(event.data.data)} - - message: $${text.decode(base64)} - - return_pubsub_message: - return: $${message} diff --git a/google/test_utils.go b/google/test_utils.go deleted file mode 100644 index 575351074e3..00000000000 --- a/google/test_utils.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-go/tfprotov5" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - "github.com/hashicorp/terraform-provider-google/google/envvar" -) - -// Deprecated: For backward compatibility CheckDataSourceStateMatchesResourceState is still working, -// but all new code should use CheckDataSourceStateMatchesResourceState in the acctest package instead. -func CheckDataSourceStateMatchesResourceState(dataSourceName, resourceName string) func(*terraform.State) error { - return acctest.CheckDataSourceStateMatchesResourceState(dataSourceName, resourceName) -} - -// Deprecated: For backward compatibility CheckDataSourceStateMatchesResourceStateWithIgnores is still working, -// but all new code should use CheckDataSourceStateMatchesResourceStateWithIgnores in the acctest package instead. -func CheckDataSourceStateMatchesResourceStateWithIgnores(dataSourceName, resourceName string, ignoreFields map[string]struct{}) func(*terraform.State) error { - return acctest.CheckDataSourceStateMatchesResourceStateWithIgnores(dataSourceName, resourceName, ignoreFields) -} - -// General test utils - -func RandString(t *testing.T, length int) string { - return acctest.RandString(t, length) -} - -func RandInt(t *testing.T) int { - return acctest.RandInt(t) -} - -// ProtoV5ProviderFactories returns a muxed ProviderServer that uses the provider code from this repo (SDK and plugin-framework). -// Used to set ProtoV5ProviderFactories in a resource.TestStep within an acceptance test. -func ProtoV5ProviderFactories(t *testing.T) map[string]func() (tfprotov5.ProviderServer, error) { - return acctest.ProtoV5ProviderFactories(t) -} - -// ProtoV5ProviderBetaFactories returns the same as ProtoV5ProviderFactories only the provider is mapped with -// "google-beta" to ensure that registry examples use `google-beta` if the example is versioned as beta; -// normal beta tests should continue to use ProtoV5ProviderFactories -func ProtoV5ProviderBetaFactories(t *testing.T) map[string]func() (tfprotov5.ProviderServer, error) { - return acctest.ProtoV5ProviderBetaFactories(t) -} - -func serviceAccountCanonicalEmail(account string) string { - return envvar.ServiceAccountCanonicalEmail(account) -} - -func getResourceAttributes(n string, s *terraform.State) (map[string]string, error) { - return tpgresource.GetResourceAttributes(n, s) -} - -// Deprecated: For backward compatibility testBucketName is still working, -// but all new code should use TestBucketName in the acctest package instead. -func testBucketName(t *testing.T) string { - return acctest.TestBucketName(t) -} - -// Deprecated: For backward compatibility createZIPArchiveForCloudFunctionSource is still working, -// but all new code should use CreateZIPArchiveForCloudFunctionSource in the acctest package instead. -func createZIPArchiveForCloudFunctionSource(t *testing.T, sourcePath string) string { - return acctest.CreateZIPArchiveForCloudFunctionSource(t, sourcePath) -} diff --git a/google/tpgresource/utils_test.go b/google/tpgresource/utils_test.go index 4a68a92882f..139c6b9f2b3 100644 --- a/google/tpgresource/utils_test.go +++ b/google/tpgresource/utils_test.go @@ -1,8 +1,9 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -package tpgresource +package tpgresource_test import ( + "fmt" "reflect" "strings" "testing" @@ -10,6 +11,8 @@ import ( "github.com/hashicorp/errwrap" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-google/google/acctest" + "github.com/hashicorp/terraform-provider-google/google/tpgresource" transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" "google.golang.org/api/googleapi" @@ -43,7 +46,7 @@ func TestConvertStringArr(t *testing.T) { input[2] = "aaa" expected := []string{"aaa", "bbb", "ccc"} - actual := ConvertStringArr(input) + actual := tpgresource.ConvertStringArr(input) if reflect.DeepEqual(expected, actual) { t.Fatalf("(%s) did not match expected value: %s", actual, expected) @@ -57,7 +60,7 @@ func TestConvertAndMapStringArr(t *testing.T) { input[2] = "aaa" expected := []string{"AAA", "BBB", "CCC"} - actual := ConvertAndMapStringArr(input, strings.ToUpper) + actual := tpgresource.ConvertAndMapStringArr(input, strings.ToUpper) if reflect.DeepEqual(expected, actual) { t.Fatalf("(%s) did not match expected value: %s", actual, expected) @@ -71,7 +74,7 @@ func TestConvertStringMap(t *testing.T) { input["three"] = "3" expected := map[string]string{"one": "1", "two": "2", "three": "3"} - actual := ConvertStringMap(input) + actual := tpgresource.ConvertStringMap(input) if !reflect.DeepEqual(expected, actual) { t.Fatalf("%s did not match expected value: %s", actual, expected) @@ -116,7 +119,7 @@ func TestIpCidrRangeDiffSuppress(t *testing.T) { } for tn, tc := range cases { - if IpCidrRangeDiffSuppress("ip_cidr_range", tc.Old, tc.New, nil) != tc.ExpectDiffSuppress { + if tpgresource.IpCidrRangeDiffSuppress("ip_cidr_range", tc.Old, tc.New, nil) != tc.ExpectDiffSuppress { t.Fatalf("bad: %s, '%s' => '%s' expect %t", tn, tc.Old, tc.New, tc.ExpectDiffSuppress) } } @@ -159,7 +162,7 @@ func TestRfc3339TimeDiffSuppress(t *testing.T) { }, } for tn, tc := range cases { - if Rfc3339TimeDiffSuppress("time", tc.Old, tc.New, nil) != tc.ExpectDiffSuppress { + if tpgresource.Rfc3339TimeDiffSuppress("time", tc.Old, tc.New, nil) != tc.ExpectDiffSuppress { t.Errorf("bad: %s, '%s' => '%s' expect DiffSuppress to return %t", tn, tc.Old, tc.New, tc.ExpectDiffSuppress) } } @@ -203,10 +206,10 @@ func TestGetProject(t *testing.T) { // Create resource config // Here use a fictional schema that includes a project field - d := SetupTestResourceDataFromConfigMap(t, fictionalSchema, tc.ResourceConfig) + d := tpgresource.SetupTestResourceDataFromConfigMap(t, fictionalSchema, tc.ResourceConfig) // Act - project, err := GetProject(d, &config) + project, err := tpgresource.GetProject(d, &config) // Assert if err != nil { @@ -352,10 +355,10 @@ func TestGetLocation(t *testing.T) { // Here use a fictional schema as example because we need to have all of // location, region, and zone fields present in the schema for the test, // and no real resources would contain all of these - d := SetupTestResourceDataFromConfigMap(t, fictionalSchema, tc.ResourceConfig) + d := tpgresource.SetupTestResourceDataFromConfigMap(t, fictionalSchema, tc.ResourceConfig) // Act - location, err := GetLocation(d, &config) + location, err := tpgresource.GetLocation(d, &config) // Assert if err != nil { @@ -445,10 +448,10 @@ func TestGetZone(t *testing.T) { // Here use a fictional schema as example because we need to have all of // location, region, and zone fields present in the schema for the test, // and no real resources would contain all of these - d := SetupTestResourceDataFromConfigMap(t, fictionalSchema, tc.ResourceConfig) + d := tpgresource.SetupTestResourceDataFromConfigMap(t, fictionalSchema, tc.ResourceConfig) // Act - zone, err := GetZone(d, &config) + zone, err := tpgresource.GetZone(d, &config) // Assert if err != nil { @@ -570,10 +573,10 @@ func TestGetRegion(t *testing.T) { // Here use a fictional schema as example because we need to have all of // location, region, and zone fields present in the schema for the test, // and no real resources would contain all of these - d := SetupTestResourceDataFromConfigMap(t, fictionalSchema, tc.ResourceConfig) + d := tpgresource.SetupTestResourceDataFromConfigMap(t, fictionalSchema, tc.ResourceConfig) // Act - region, err := GetRegion(d, &config) + region, err := tpgresource.GetRegion(d, &config) // Assert if err != nil { @@ -592,7 +595,7 @@ func TestGetRegion(t *testing.T) { func TestGetRegionFromZone(t *testing.T) { expected := "us-central1" - actual := GetRegionFromZone("us-central1-f") + actual := tpgresource.GetRegionFromZone("us-central1-f") if expected != actual { t.Fatalf("Region (%s) did not match expected value: %s", actual, expected) } @@ -811,7 +814,7 @@ func TestDatasourceSchemaFromResourceSchema(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := DatasourceSchemaFromResourceSchema(tt.args.rs); !reflect.DeepEqual(got, tt.want) { + if got := tpgresource.DatasourceSchemaFromResourceSchema(tt.args.rs); !reflect.DeepEqual(got, tt.want) { t.Errorf("DatasourceSchemaFromResourceSchema() = %#v, want %#v", got, tt.want) } }) @@ -819,7 +822,7 @@ func TestDatasourceSchemaFromResourceSchema(t *testing.T) { } func TestEmptyOrDefaultStringSuppress(t *testing.T) { - testFunc := EmptyOrDefaultStringSuppress("default value") + testFunc := tpgresource.EmptyOrDefaultStringSuppress("default value") cases := map[string]struct { Old, New string @@ -880,7 +883,7 @@ func TestServiceAccountFQN(t *testing.T) { for tn, tc := range cases { config := &transport_tpg.Config{Project: tc.project} d := &schema.ResourceData{} - serviceAccountName, err := ServiceAccountFQN(tc.serviceAccount, d, config) + serviceAccountName, err := tpgresource.ServiceAccountFQN(tc.serviceAccount, d, config) if err != nil { t.Fatalf("unexpected error for service account FQN: %s", err) } @@ -894,19 +897,19 @@ func TestConflictError(t *testing.T) { confErr := &googleapi.Error{ Code: 409, } - if !IsConflictError(confErr) { + if !tpgresource.IsConflictError(confErr) { t.Error("did not find that a 409 was a conflict error.") } - if !IsConflictError(errwrap.Wrapf("wrap", confErr)) { + if !tpgresource.IsConflictError(errwrap.Wrapf("wrap", confErr)) { t.Error("did not find that a wrapped 409 was a conflict error.") } confErr = &googleapi.Error{ Code: 412, } - if !IsConflictError(confErr) { + if !tpgresource.IsConflictError(confErr) { t.Error("did not find that a 412 was a conflict error.") } - if !IsConflictError(errwrap.Wrapf("wrap", confErr)) { + if !tpgresource.IsConflictError(errwrap.Wrapf("wrap", confErr)) { t.Error("did not find that a wrapped 412 was a conflict error.") } // skipping negative tests as other cases may be added later. @@ -914,15 +917,15 @@ func TestConflictError(t *testing.T) { func TestIsNotFoundGrpcErrort(t *testing.T) { error_status := status.New(codes.FailedPrecondition, "FailedPrecondition error") - if IsNotFoundGrpcError(error_status.Err()) { + if tpgresource.IsNotFoundGrpcError(error_status.Err()) { t.Error("found FailedPrecondition as a NotFound error") } error_status = status.New(codes.OK, "OK") - if IsNotFoundGrpcError(error_status.Err()) { + if tpgresource.IsNotFoundGrpcError(error_status.Err()) { t.Error("found OK as a NotFound error") } error_status = status.New(codes.NotFound, "NotFound error") - if !IsNotFoundGrpcError(error_status.Err()) { + if !tpgresource.IsNotFoundGrpcError(error_status.Err()) { t.Error("expect a NotFound error") } } @@ -930,7 +933,7 @@ func TestIsNotFoundGrpcErrort(t *testing.T) { func TestSnakeToPascalCase(t *testing.T) { input := "boot_disk" expected := "BootDisk" - actual := SnakeToPascalCase(input) + actual := tpgresource.SnakeToPascalCase(input) if actual != expected { t.Fatalf("(%s) did not match expected value: %s", actual, expected) @@ -953,7 +956,7 @@ func TestCheckGoogleIamPolicy(t *testing.T) { } for _, tc := range cases { - err := CheckGoogleIamPolicy(tc.json) + err := tpgresource.CheckGoogleIamPolicy(tc.json) if tc.valid && err != nil { t.Errorf("The JSON is marked as valid but triggered an error: %s", tc.json) } else if !tc.valid && err == nil { @@ -1063,7 +1066,7 @@ func TestReplaceVars(t *testing.T) { for tn, tc := range cases { t.Run(tn, func(t *testing.T) { - d := &ResourceDataMock{ + d := &tpgresource.ResourceDataMock{ FieldsInSchema: tc.SchemaValues, } @@ -1072,7 +1075,7 @@ func TestReplaceVars(t *testing.T) { config = &transport_tpg.Config{} } - v, err := ReplaceVars(d, config, tc.Template) + v, err := tpgresource.ReplaceVars(d, config, tc.Template) if err != nil { if !tc.ExpectedError { @@ -1091,3 +1094,44 @@ func TestReplaceVars(t *testing.T) { }) } } + +func TestCheckGCSName(t *testing.T) { + valid63 := acctest.RandString(t, 63) + cases := map[string]bool{ + // Valid + "foobar": true, + "foobar1": true, + "12345": true, + "foo_bar_baz": true, + "foo-bar-baz": true, + "foo-bar_baz1": true, + "foo--bar": true, + "foo__bar": true, + "foo-goog": true, + "foo.goog": true, + valid63: true, + fmt.Sprintf("%s.%s.%s", valid63, valid63, valid63): true, + + // Invalid + "goog-foobar": false, + "foobar-google": false, + "-foobar": false, + "foobar-": false, + "_foobar": false, + "foobar_": false, + "fo": false, + "foo$bar": false, + "foo..bar": false, + acctest.RandString(t, 64): false, + fmt.Sprintf("%s.%s.%s.%s", valid63, valid63, valid63, valid63): false, + } + + for bucketName, valid := range cases { + err := tpgresource.CheckGCSName(bucketName) + if valid && err != nil { + t.Errorf("The bucket name %s was expected to pass validation and did not pass.", bucketName) + } else if !valid && err == nil { + t.Errorf("The bucket name %s was NOT expected to pass validation and passed.", bucketName) + } + } +} diff --git a/google/transport_test_utils.go b/google/transport_test_utils.go deleted file mode 100644 index 7e2a23e49e6..00000000000 --- a/google/transport_test_utils.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// This function isn't a test of transport.go; instead, it is used as an alternative -// to ReplaceVars inside tests. -// -// Deprecated: For backward compatibility replaceVarsForTest is still working, -// but all new code should use ReplaceVarsForTest in the tpgresource package instead. -func replaceVarsForTest(config *transport_tpg.Config, rs *terraform.ResourceState, linkTmpl string) (string, error) { - return tpgresource.ReplaceVarsForTest(config, rs, linkTmpl) -} diff --git a/google/utils.go b/google/utils.go deleted file mode 100644 index f17de9a97d9..00000000000 --- a/google/utils.go +++ /dev/null @@ -1,389 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -// Contains functions that don't really belong anywhere else. - -package google - -import ( - "reflect" - "regexp" - "time" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" - - fwDiags "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "google.golang.org/api/googleapi" -) - -// getRegionFromZone returns the region from a zone for Google cloud. -// This is by removing the last two chars from the zone name to leave the region -// If there aren't enough characters in the input string, an empty string is returned -// e.g. southamerica-west1-a => southamerica-west1 -// -// Deprecated: For backward compatibility getRegionFromZone is still working, -// but all new code should use GetRegionFromZone in the tpgresource package instead. -func getRegionFromZone(zone string) string { - return tpgresource.GetRegionFromZone(zone) -} - -// Infers the region based on the following (in order of priority): -// - `region` field in resource schema -// - region extracted from the `zone` field in resource schema -// - provider-level region -// - region extracted from the provider-level zone -// -// Deprecated: For backward compatibility getRegion is still working, -// but all new code should use GetRegion in the tpgresource package instead. -func getRegion(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (string, error) { - return tpgresource.GetRegion(d, config) -} - -// getProject reads the "project" field from the given resource data and falls -// back to the provider's value if not given. If the provider's value is not -// given, an error is returned. -// -// Deprecated: For backward compatibility getProject is still working, -// but all new code should use GetProject in the tpgresource package instead. -func getProject(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (string, error) { - return tpgresource.GetProject(d, config) -} - -// getBillingProject reads the "billing_project" field from the given resource data and falls -// back to the provider's value if not given. If no value is found, an error is returned. -// -// Deprecated: For backward compatibility getBillingProject is still working, -// but all new code should use GetBillingProject in the tpgresource package instead. -func getBillingProject(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (string, error) { - return tpgresource.GetBillingProject(d, config) -} - -// getProjectFromDiff reads the "project" field from the given diff and falls -// back to the provider's value if not given. If the provider's value is not -// given, an error is returned. -// -// Deprecated: For backward compatibility getProjectFromDiff is still working, -// but all new code should use GetProjectFromDiff in the tpgresource package instead. -func getProjectFromDiff(d *schema.ResourceDiff, config *transport_tpg.Config) (string, error) { - return tpgresource.GetProjectFromDiff(d, config) -} - -// Deprecated: For backward compatibility getRouterLockName is still working, -// but all new code should use GetRouterLockName in the tpgresource package instead. -func getRouterLockName(region string, router string) string { - return tpgresource.GetRouterLockName(region, router) -} - -// Deprecated: For backward compatibility isFailedPreconditionError is still working, -// but all new code should use IsFailedPreconditionError in the tpgresource package instead. -func isFailedPreconditionError(err error) bool { - return tpgresource.IsFailedPreconditionError(err) -} - -// Deprecated: For backward compatibility isConflictError is still working, -// but all new code should use IsConflictError in the tpgresource package instead. -func isConflictError(err error) bool { - return tpgresource.IsConflictError(err) -} - -// gRPC does not return errors of type *googleapi.Error. Instead the errors returned are *status.Error. -// See the types of codes returned here (https://pkg.go.dev/google.golang.org/grpc/codes#Code). -// -// Deprecated: For backward compatibility isNotFoundGrpcError is still working, -// but all new code should use IsNotFoundGrpcError in the tpgresource package instead. -func isNotFoundGrpcError(err error) bool { - return tpgresource.IsNotFoundGrpcError(err) -} - -// expandLabels pulls the value of "labels" out of a TerraformResourceData as a map[string]string. -// -// Deprecated: For backward compatibility expandLabels is still working, -// but all new code should use ExpandLabels in the tpgresource package instead. -func expandLabels(d tpgresource.TerraformResourceData) map[string]string { - return tpgresource.ExpandLabels(d) -} - -// expandEnvironmentVariables pulls the value of "environment_variables" out of a schema.ResourceData as a map[string]string. -// -// Deprecated: For backward compatibility expandEnvironmentVariables is still working, -// but all new code should use ExpandEnvironmentVariables in the tpgresource package instead. -func expandEnvironmentVariables(d *schema.ResourceData) map[string]string { - return tpgresource.ExpandEnvironmentVariables(d) -} - -// expandBuildEnvironmentVariables pulls the value of "build_environment_variables" out of a schema.ResourceData as a map[string]string. -// -// Deprecated: For backward compatibility expandBuildEnvironmentVariables is still working, -// but all new code should use ExpandBuildEnvironmentVariables in the tpgresource package instead. -func expandBuildEnvironmentVariables(d *schema.ResourceData) map[string]string { - return tpgresource.ExpandBuildEnvironmentVariables(d) -} - -// expandStringMap pulls the value of key out of a TerraformResourceData as a map[string]string. -// -// Deprecated: For backward compatibility expandStringMap is still working, -// but all new code should use ExpandStringMap in the tpgresource package instead. -func expandStringMap(d tpgresource.TerraformResourceData, key string) map[string]string { - return tpgresource.ExpandStringMap(d, key) -} - -// Deprecated: For backward compatibility convertStringMap is still working, -// but all new code should use ConvertStringMap in the tpgresource package instead. -func convertStringMap(v map[string]interface{}) map[string]string { - return tpgresource.ConvertStringMap(v) -} - -// Deprecated: For backward compatibility convertStringArr is still working, -// but all new code should use ConvertStringArr in the tpgresource package instead. -func convertStringArr(ifaceArr []interface{}) []string { - return tpgresource.ConvertStringArr(ifaceArr) -} - -// Deprecated: For backward compatibility convertAndMapStringArr is still working, -// but all new code should use ConvertAndMapStringArr in the tpgresource package instead. -func convertAndMapStringArr(ifaceArr []interface{}, f func(string) string) []string { - return tpgresource.ConvertAndMapStringArr(ifaceArr, f) -} - -// Deprecated: For backward compatibility mapStringArr is still working, -// but all new code should use MapStringArr in the tpgresource package instead. -func mapStringArr(original []string, f func(string) string) []string { - return tpgresource.MapStringArr(original, f) -} - -// Deprecated: For backward compatibility convertStringArrToInterface is still working, -// but all new code should use ConvertStringArrToInterface in the tpgresource package instead. -func convertStringArrToInterface(strs []string) []interface{} { - return tpgresource.ConvertStringArrToInterface(strs) -} - -// Deprecated: For backward compatibility convertStringSet is still working, -// but all new code should use ConvertStringSet in the tpgresource package instead. -func convertStringSet(set *schema.Set) []string { - return tpgresource.ConvertStringSet(set) -} - -// Deprecated: For backward compatibility golangSetFromStringSlice is still working, -// but all new code should use GolangSetFromStringSlice in the tpgresource package instead. -func golangSetFromStringSlice(strings []string) map[string]struct{} { - return tpgresource.GolangSetFromStringSlice(strings) -} - -// Deprecated: For backward compatibility stringSliceFromGolangSet is still working, -// but all new code should use StringSliceFromGolangSet in the tpgresource package instead. -func stringSliceFromGolangSet(sset map[string]struct{}) []string { - return tpgresource.StringSliceFromGolangSet(sset) -} - -// Deprecated: For backward compatibility reverseStringMap is still working, -// but all new code should use ReverseStringMap in the tpgresource package instead. -func reverseStringMap(m map[string]string) map[string]string { - return tpgresource.ReverseStringMap(m) -} - -// Deprecated: For backward compatibility mergeStringMaps is still working, -// but all new code should use MergeStringMaps in the tpgresource package instead. -func mergeStringMaps(a, b map[string]string) map[string]string { - return tpgresource.MergeStringMaps(a, b) -} - -// Deprecated: For backward compatibility mergeSchemas is still working, -// but all new code should use MergeSchemas in the tpgresource package instead. -func mergeSchemas(a, b map[string]*schema.Schema) map[string]*schema.Schema { - return tpgresource.MergeSchemas(a, b) -} - -// Deprecated: For backward compatibility StringToFixed64 is still working, -// but all new code should use StringToFixed64 in the tpgresource package instead. -func StringToFixed64(v string) (int64, error) { - return tpgresource.StringToFixed64(v) -} - -// Deprecated: For backward compatibility extractFirstMapConfig is still working, -// but all new code should use ExtractFirstMapConfig in the tpgresource package instead. -func extractFirstMapConfig(m []interface{}) map[string]interface{} { - return tpgresource.ExtractFirstMapConfig(m) -} - -// Deprecated: For backward compatibility lockedCall is still working, -// but all new code should use LockedCall in the tpgresource package instead. -func lockedCall(lockKey string, f func() error) error { - return transport_tpg.LockedCall(lockKey, f) -} - -// This is a Printf sibling (Nprintf; Named Printf), which handles strings like -// Nprintf("Hello %{target}!", map[string]interface{}{"target":"world"}) == "Hello world!". -// This is particularly useful for generated tests, where we don't want to use Printf, -// since that would require us to generate a very particular ordering of arguments. -// -// Deprecated: For backward compatibility Nprintf is still working, -// but all new code should use Nprintf in the acctest package instead. -func Nprintf(format string, params map[string]interface{}) string { - return acctest.Nprintf(format, params) -} - -// serviceAccountFQN will attempt to generate the fully qualified name in the format of: -// "projects/(-|)/serviceAccounts/@.iam.gserviceaccount.com" -// A project is required if we are trying to build the FQN from a service account id and -// and error will be returned in this case if no project is set in the resource or the -// provider-level config -// -// Deprecated: For backward compatibility serviceAccountFQN is still working, -// but all new code should use ServiceAccountFQN in the tpgresource package instead. -func serviceAccountFQN(serviceAccount string, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (string, error) { - return tpgresource.ServiceAccountFQN(serviceAccount, d, config) -} - -// Deprecated: For backward compatibility paginatedListRequest is still working, -// but all new code should use PaginatedListRequest in the tpgresource package instead. -func paginatedListRequest(project, baseUrl, userAgent string, config *transport_tpg.Config, flattener func(map[string]interface{}) []interface{}) ([]interface{}, error) { - return tpgresource.PaginatedListRequest(project, baseUrl, userAgent, config, flattener) -} - -// Deprecated: For backward compatibility getInterconnectAttachmentLink is still working, -// but all new code should use GetInterconnectAttachmentLink in the tpgresource package instead. -func getInterconnectAttachmentLink(config *transport_tpg.Config, project, region, ic, userAgent string) (string, error) { - return tpgresource.GetInterconnectAttachmentLink(config, project, region, ic, userAgent) -} - -// Given two sets of references (with "from" values in self link form), -// determine which need to be added or removed // during an update using -// addX/removeX APIs. -// -// Deprecated: For backward compatibility calcAddRemove is still working, -// but all new code should use CalcAddRemove in the tpgresource package instead. -func calcAddRemove(from []string, to []string) (add, remove []string) { - return tpgresource.CalcAddRemove(from, to) -} - -// Deprecated: For backward compatibility stringInSlice is still working, -// but all new code should use StringInSlice in the tpgresource package instead. -func stringInSlice(arr []string, str string) bool { - return tpgresource.StringInSlice(arr, str) -} - -// Deprecated: For backward compatibility migrateStateNoop is still working, -// but all new code should use MigrateStateNoop in the tpgresource package instead. -func migrateStateNoop(v int, is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) { - return tpgresource.MigrateStateNoop(v, is, meta) -} - -// Deprecated: For backward compatibility expandString is still working, -// but all new code should use ExpandString in the tpgresource package instead. -func expandString(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (string, error) { - return tpgresource.ExpandString(v, d, config) -} - -// Deprecated: For backward compatibility changeFieldSchemaToForceNew is still working, -// but all new code should use ChangeFieldSchemaToForceNew in the tpgresource package instead. -func changeFieldSchemaToForceNew(sch *schema.Schema) { - tpgresource.ChangeFieldSchemaToForceNew(sch) -} - -// Deprecated: For backward compatibility generateUserAgentString is still working, -// but all new code should use GenerateUserAgentString in the tpgresource package instead. -func generateUserAgentString(d tpgresource.TerraformResourceData, currentUserAgent string) (string, error) { - return tpgresource.GenerateUserAgentString(d, currentUserAgent) -} - -// Deprecated: For backward compatibility snakeToPascalCase is still working, -// but all new code should use SnakeToPascalCase in the tpgresource package instead. -func snakeToPascalCase(s string) string { - return tpgresource.SnakeToPascalCase(s) -} - -// Deprecated: For backward compatibility checkStringMap is still working, -// but all new code should use CheckStringMap in the tpgresource package instead. -func checkStringMap(v interface{}) map[string]string { - return tpgresource.CheckStringMap(v) -} - -// return a fake 404 so requests get retried or nested objects are considered deleted -// -// Deprecated: For backward compatibility fake404 is still working, -// but all new code should use Fake404 in the tpgresource package instead. -func fake404(reasonResourceType, resourceName string) *googleapi.Error { - return tpgresource.Fake404(reasonResourceType, resourceName) -} - -// validate name of the gcs bucket. Guidelines are located at https://cloud.google.com/storage/docs/naming-buckets -// this does not attempt to check for IP addresses or close misspellings of "google" -// -// Deprecated: For backward compatibility checkGCSName is still working, -// but all new code should use CheckGCSName in the tpgresource package instead. -func checkGCSName(name string) error { - return tpgresource.CheckGCSName(name) -} - -// checkGoogleIamPolicy makes assertions about the contents of a google_iam_policy data source's policy_data attribute -// -// Deprecated: For backward compatibility checkGoogleIamPolicy is still working, -// but all new code should use CheckGoogleIamPolicy in the tpgresource package instead. -func checkGoogleIamPolicy(value string) error { - return tpgresource.CheckGoogleIamPolicy(value) -} - -// Retries an operation while the canonical error code is FAILED_PRECONDTION -// which indicates there is an incompatible operation already running on the -// cluster. This error can be safely retried until the incompatible operation -// completes, and the newly requested operation can begin. -func retryWhileIncompatibleOperation(timeout time.Duration, lockKey string, f func() error) error { - return tpgresource.RetryWhileIncompatibleOperation(timeout, lockKey, f) -} - -// Deprecated: For backward compatibility frameworkDiagsToSdkDiags is still working, -// but all new code should use FrameworkDiagsToSdkDiags in the tpgresource package instead. -func frameworkDiagsToSdkDiags(fwD fwDiags.Diagnostics) *diag.Diagnostics { - return tpgresource.FrameworkDiagsToSdkDiags(fwD) -} - -// Deprecated: For backward compatibility isEmptyValue is still working, -// but all new code should use IsEmptyValue in the tpgresource package instead. -func isEmptyValue(v reflect.Value) bool { - return tpgresource.IsEmptyValue(v) -} - -// Deprecated: For backward compatibility replaceVars is still working, -// but all new code should use ReplaceVars in the tpgresource package instead. -func ReplaceVars(d tpgresource.TerraformResourceData, config *transport_tpg.Config, linkTmpl string) (string, error) { - return tpgresource.ReplaceVars(d, config, linkTmpl) -} - -// relaceVarsForId shortens variables by running them through GetResourceNameFromSelfLink -// this allows us to use long forms of variables from configs without needing -// custom id formats. For instance: -// accessPolicies/{{access_policy}}/accessLevels/{{access_level}} -// with values: -// access_policy: accessPolicies/foo -// access_level: accessPolicies/foo/accessLevels/bar -// becomes accessPolicies/foo/accessLevels/bar -// -// Deprecated: For backward compatibility replaceVarsForId is still working, -// but all new code should use ReplaceVarsForId in the tpgresource package instead. -func replaceVarsForId(d tpgresource.TerraformResourceData, config *transport_tpg.Config, linkTmpl string) (string, error) { - return tpgresource.ReplaceVarsForId(d, config, linkTmpl) -} - -// ReplaceVars must be done recursively because there are baseUrls that can contain references to regions -// (eg cloudrun service) there aren't any cases known for 2+ recursion but we will track a run away -// substitution as 10+ calls to allow for future use cases. -// -// Deprecated: For backward compatibility replaceVarsRecursive is still working, -// but all new code should use ReplaceVarsRecursive in the tpgresource package instead. -func replaceVarsRecursive(d tpgresource.TerraformResourceData, config *transport_tpg.Config, linkTmpl string, shorten bool, depth int) (string, error) { - return tpgresource.ReplaceVarsRecursive(d, config, linkTmpl, shorten, depth) -} - -// This function replaces references to Terraform properties (in the form of {{var}}) with their value in Terraform -// It also replaces {{project}}, {{project_id_or_project}}, {{region}}, and {{zone}} with their appropriate values -// This function supports URL-encoding the result by prepending '%' to the field name e.g. {{%var}} -// -// Deprecated: For backward compatibility buildReplacementFunc is still working, -// but all new code should use BuildReplacementFunc in the tpgresource package instead. -func buildReplacementFunc(re *regexp.Regexp, d tpgresource.TerraformResourceData, config *transport_tpg.Config, linkTmpl string, shorten bool) (func(string) string, error) { - return tpgresource.BuildReplacementFunc(re, d, config, linkTmpl, shorten) -} diff --git a/google/utils_test.go b/google/utils_test.go deleted file mode 100644 index ee345ac85f0..00000000000 --- a/google/utils_test.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "fmt" - "testing" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - "github.com/hashicorp/terraform-provider-google/google/tpgresource" -) - -func TestCheckGCSName(t *testing.T) { - valid63 := acctest.RandString(t, 63) - cases := map[string]bool{ - // Valid - "foobar": true, - "foobar1": true, - "12345": true, - "foo_bar_baz": true, - "foo-bar-baz": true, - "foo-bar_baz1": true, - "foo--bar": true, - "foo__bar": true, - "foo-goog": true, - "foo.goog": true, - valid63: true, - fmt.Sprintf("%s.%s.%s", valid63, valid63, valid63): true, - - // Invalid - "goog-foobar": false, - "foobar-google": false, - "-foobar": false, - "foobar-": false, - "_foobar": false, - "foobar_": false, - "fo": false, - "foo$bar": false, - "foo..bar": false, - acctest.RandString(t, 64): false, - fmt.Sprintf("%s.%s.%s.%s", valid63, valid63, valid63, valid63): false, - } - - for bucketName, valid := range cases { - err := tpgresource.CheckGCSName(bucketName) - if valid && err != nil { - t.Errorf("The bucket name %s was expected to pass validation and did not pass.", bucketName) - } else if !valid && err == nil { - t.Errorf("The bucket name %s was NOT expected to pass validation and passed.", bucketName) - } - } -} diff --git a/google/validation.go b/google/validation.go deleted file mode 100644 index 2eaa1b7b6bd..00000000000 --- a/google/validation.go +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-google/google/verify" -) - -const ( - // Deprecated: For backward compatibility ProjectRegex is still working, - // but all new code should use ProjectRegex in the verify package instead. - // Copied from the official Google Cloud auto-generated client. - ProjectRegex = verify.ProjectRegex - // Deprecated: For backward compatibility ProjectRegexWildCard is still working, - // but all new code should use ProjectRegexWildCard in the verify package instead. - ProjectRegexWildCard = verify.ProjectRegexWildCard - // Deprecated: For backward compatibility RegionRegex is still working, - // but all new code should use RegionRegex in the verify package instead. - RegionRegex = verify.RegionRegex - // Deprecated: For backward compatibility SubnetworkRegex is still working, - // but all new code should use SubnetworkRegex in the verify package instead. - SubnetworkRegex = verify.SubnetworkRegex - - // Deprecated: For backward compatibility SubnetworkLinkRegex is still working, - // but all new code should use SubnetworkLinkRegex in the verify package instead. - SubnetworkLinkRegex = verify.SubnetworkLinkRegex - - // Deprecated: For backward compatibility RFC1035NameTemplate is still working, - // but all new code should use RFC1035NameTemplate in the verify package instead. - RFC1035NameTemplate = verify.RFC1035NameTemplate - // Deprecated: For backward compatibility CloudIoTIdRegex is still working, - // but all new code should use CloudIoTIdRegex in the verify package instead. - CloudIoTIdRegex = verify.CloudIoTIdRegex - - // Deprecated: For backward compatibility ComputeServiceAccountNameRegex is still working, - // but all new code should use ComputeServiceAccountNameRegex in the verify package instead. - // Format of default Compute service accounts created by Google - // ${PROJECT_ID}-compute@developer.gserviceaccount.com where PROJECT_ID is an int64 (max 20 digits) - ComputeServiceAccountNameRegex = verify.ComputeServiceAccountNameRegex - - // Deprecated: For backward compatibility IAMCustomRoleIDRegex is still working, - // but all new code should use IAMCustomRoleIDRegex in the verify package instead. - // https://cloud.google.com/iam/docs/understanding-custom-roles#naming_the_role - IAMCustomRoleIDRegex = verify.IAMCustomRoleIDRegex - - // Deprecated: For backward compatibility ADDomainNameRegex is still working, - // but all new code should use ADDomainNameRegex in the verify package instead. - // https://cloud.google.com/managed-microsoft-ad/reference/rest/v1/projects.locations.global.domains/create#query-parameters - ADDomainNameRegex = verify.ADDomainNameRegex -) - -var ( - // Deprecated: For backward compatibility ServiceAccountNameRegex is still working, - // but all new code should use ServiceAccountNameRegex in the verify package instead. - // Service account name must have a length between 6 and 30. - // The first and last characters have different restrictions, than - // the middle characters. The middle characters length must be between - // 4 and 28 since the first and last character are excluded. - ServiceAccountNameRegex = verify.ServiceAccountNameRegex - - // Deprecated: For backward compatibility ServiceAccountLinkRegexPrefix is still working, - // but all new code should use ServiceAccountLinkRegexPrefix in the verify package instead. - ServiceAccountLinkRegexPrefix = verify.ServiceAccountLinkRegexPrefix - // Deprecated: For backward compatibility PossibleServiceAccountNames is still working, - // but all new code should use PossibleServiceAccountNames in the verify package instead. - PossibleServiceAccountNames = verify.PossibleServiceAccountNames - // Deprecated: For backward compatibility ServiceAccountLinkRegex is still working, - // but all new code should use ServiceAccountLinkRegex in the verify package instead. - ServiceAccountLinkRegex = verify.ServiceAccountLinkRegex - - // Deprecated: For backward compatibility ServiceAccountKeyNameRegex is still working, - // but all new code should use ServiceAccountKeyNameRegex in the verify package instead. - ServiceAccountKeyNameRegex = verify.ServiceAccountKeyNameRegex - - // Deprecated: For backward compatibility CreatedServiceAccountNameRegex is still working, - // but all new code should use CreatedServiceAccountNameRegex in the verify package instead. - // Format of service accounts created through the API - CreatedServiceAccountNameRegex = verify.CreatedServiceAccountNameRegex - - // Deprecated: For backward compatibility ServiceDefaultAccountNameRegex is still working, - // but all new code should use ServiceDefaultAccountNameRegex in the verify package instead. - // Format of service-created service account - // examples are: - // $PROJECTID@cloudbuild.gserviceaccount.com - // $PROJECTID@cloudservices.gserviceaccount.com - // $PROJECTID@appspot.gserviceaccount.com - ServiceDefaultAccountNameRegex = verify.ServiceDefaultAccountNameRegex - - // Deprecated: For backward compatibility ProjectNameInDNSFormRegex is still working, - // but all new code should use ProjectNameInDNSFormRegex in the verify package instead. - ProjectNameInDNSFormRegex = verify.ProjectNameInDNSFormRegex - // Deprecated: For backward compatibility ProjectNameRegex is still working, - // but all new code should use ProjectNameRegex in the verify package instead. - ProjectNameRegex = verify.ProjectNameRegex - - // Valid range for Cloud Router ASN values as per RFC6996 - // https://tools.ietf.org/html/rfc6996 - // Must be explicitly int64 to avoid overflow when building Terraform for 32bit architectures - // Deprecated: For backward compatibility Rfc6996Asn16BitMin is still working, - // but all new code should use Rfc6996Asn16BitMin in the verify package instead. - Rfc6996Asn16BitMin = verify.Rfc6996Asn16BitMin - // Deprecated: For backward compatibility Rfc6996Asn16BitMax is still working, - // but all new code should use Rfc6996Asn16BitMax in the verify package instead. - Rfc6996Asn16BitMax = verify.Rfc6996Asn16BitMax - // Deprecated: For backward compatibility Rfc6996Asn32BitMin is still working, - // but all new code should use Rfc6996Asn32BitMin in the verify package instead. - Rfc6996Asn32BitMin = verify.Rfc6996Asn32BitMin - // Deprecated: For backward compatibility Rfc6996Asn32BitMax is still working, - // but all new code should use Rfc6996Asn32BitMax in the verify package instead. - Rfc6996Asn32BitMax = verify.Rfc6996Asn32BitMax - // Deprecated: For backward compatibility GcpRouterPartnerAsn is still working, - // but all new code should use Rfc6996Asn16BitMin in the verify package instead. - GcpRouterPartnerAsn = verify.GcpRouterPartnerAsn -) - -// Deprecated: For backward compatibility rfc1918Networks is still working, -// but all new code should use Rfc1918Networks in the verify package instead. -var rfc1918Networks = verify.Rfc1918Networks - -// Deprecated: For backward compatibility validateGCEName is still working, -// but all new code should use ValidateGCEName in the verify package instead. -// validateGCEName ensures that a field matches the requirements for Compute Engine resource names -// https://cloud.google.com/compute/docs/naming-resources#resource-name-format -func validateGCEName(v interface{}, k string) (ws []string, errors []error) { - return verify.ValidateGCEName(v, k) -} - -// Deprecated: For backward compatibility validateRFC6996Asn is still working, -// but all new code should use ValidateRFC6996Asn in the verify package instead. -// Ensure that the BGP ASN value of Cloud Router is a valid value as per RFC6996 or a value of 16550 -func validateRFC6996Asn(v interface{}, k string) (ws []string, errors []error) { - return verify.ValidateRFC6996Asn(v, k) -} - -// Deprecated: For backward compatibility validateRegexp is still working, -// but all new code should use ValidateRegexp in the verify package instead. -func validateRegexp(re string) schema.SchemaValidateFunc { - return verify.ValidateRegexp(re) -} - -// Deprecated: For backward compatibility validateEnum is still working, -// but all new code should use ValidateEnum in the verify package instead. -func validateEnum(values []string) schema.SchemaValidateFunc { - return verify.ValidateEnum(values) -} - -// Deprecated: For backward compatibility validateRFC1918Network is still working, -// but all new code should use ValidateRFC1918Network in the verify package instead. -func validateRFC1918Network(min, max int) schema.SchemaValidateFunc { - return verify.ValidateRFC1918Network(min, max) -} - -// Deprecated: For backward compatibility validateRFC3339Time is still working, -// but all new code should use ValidateRFC3339Time in the verify package instead. -func validateRFC3339Time(v interface{}, k string) (warnings []string, errors []error) { - return verify.ValidateRFC3339Time(v, k) -} - -// Deprecated: For backward compatibility validateRFC1035Name is still working, -// but all new code should use ValidateRFC1035Name in the verify package instead. -func validateRFC1035Name(min, max int) schema.SchemaValidateFunc { - return verify.ValidateRFC1035Name(min, max) -} - -// Deprecated: For backward compatibility validateIpCidrRange is still working, -// but all new code should use ValidateIpCidrRange in the verify package instead. -func validateIpCidrRange(v interface{}, k string) (warnings []string, errors []error) { - return verify.ValidateIpCidrRange(v, k) -} - -// Deprecated: For backward compatibility validateIAMCustomRoleID is still working, -// but all new code should use ValidateIAMCustomRoleID in the verify package instead. -func validateIAMCustomRoleID(v interface{}, k string) (warnings []string, errors []error) { - return verify.ValidateIAMCustomRoleID(v, k) -} - -// Deprecated: For backward compatibility orEmpty is still working, -// but all new code should use OrEmpty in the verify package instead. -func orEmpty(f schema.SchemaValidateFunc) schema.SchemaValidateFunc { - return verify.OrEmpty(f) -} - -// Deprecated: For backward compatibility validateProjectID is still working, -// but all new code should use ValidateProjectID in the verify package instead. -func validateProjectID() schema.SchemaValidateFunc { - return verify.ValidateProjectID() -} - -// Deprecated: For backward compatibility validateDSProjectID is still working, -// but all new code should use ValidateDSProjectID in the verify package instead. -func validateDSProjectID() schema.SchemaValidateFunc { - return verify.ValidateDSProjectID() -} - -// Deprecated: For backward compatibility validateProjectName is still working, -// but all new code should use ValidateProjectName in the verify package instead. -func validateProjectName() schema.SchemaValidateFunc { - return verify.ValidateProjectName() -} - -// Deprecated: For backward compatibility validateDuration is still working, -// but all new code should use ValidateDuration in the verify package instead. -func validateDuration() schema.SchemaValidateFunc { - return verify.ValidateDuration() -} - -// Deprecated: For backward compatibility validateNonNegativeDuration is still working, -// but all new code should use ValidateNonNegativeDuration in the verify package instead. -func validateNonNegativeDuration() schema.SchemaValidateFunc { - return verify.ValidateNonNegativeDuration() -} - -// Deprecated: For backward compatibility validateIpAddress is still working, -// but all new code should use ValidateIpAddress in the verify package instead. -func validateIpAddress(i interface{}, val string) ([]string, []error) { - return verify.ValidateIpAddress(i, val) -} - -// Deprecated: For backward compatibility validateBase64String is still working, -// but all new code should use ValidateBase64String in the verify package instead. -func validateBase64String(i interface{}, val string) ([]string, []error) { - return verify.ValidateBase64String(i, val) -} - -// Deprecated: For backward compatibility StringNotInSlice is still working, -// but all new code should use StringNotInSlice in the verify package instead. -// StringNotInSlice returns a SchemaValidateFunc which tests if the provided value -// is of type string and that it matches none of the element in the invalid slice. -// if ignorecase is true, case is ignored. -func StringNotInSlice(invalid []string, ignoreCase bool) schema.SchemaValidateFunc { - return verify.StringNotInSlice(invalid, ignoreCase) -} - -// Deprecated: For backward compatibility validateHourlyOnly is still working, -// but all new code should use ValidateHourlyOnly in the verify package instead. -// Ensure that hourly timestamp strings "HH:MM" have the minutes zeroed out for hourly only inputs -func validateHourlyOnly(val interface{}, key string) (warns []string, errs []error) { - return verify.ValidateHourlyOnly(val, key) -} - -// Deprecated: For backward compatibility validateRFC3339Date is still working, -// but all new code should use ValidateRFC3339Date in the verify package instead. -func validateRFC3339Date(v interface{}, k string) (warnings []string, errors []error) { - return verify.ValidateRFC3339Date(v, k) -} - -// Deprecated: For backward compatibility validateADDomainName is still working, -// but all new code should use ValidateADDomainName in the verify package instead. -func validateADDomainName() schema.SchemaValidateFunc { - return verify.ValidateADDomainName() -} diff --git a/google/vcr_utils.go b/google/vcr_utils.go deleted file mode 100644 index 01f8b3cc272..00000000000 --- a/google/vcr_utils.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "testing" - - "github.com/hashicorp/terraform-provider-google/google/acctest" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -func isVcrEnabled() bool { - return acctest.IsVcrEnabled() -} - -// VcrTest is a wrapper for resource.Test to swap out providers for VCR providers and handle VCR specific things -// Can be called when VCR is not enabled, and it will behave as normal -func VcrTest(t *testing.T, c resource.TestCase) { - acctest.VcrTest(t, c) -} diff --git a/google/vertex_ai_operation.go b/google/vertex_ai_operation.go deleted file mode 100644 index d446d750477..00000000000 --- a/google/vertex_ai_operation.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 -package google - -import ( - "time" - - "github.com/hashicorp/terraform-provider-google/google/services/vertexai" - transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" -) - -// nolint: deadcode,unused -// -// Deprecated: For backward compatibility VertexAIOperationWaitTimeWithResponse is still working, -// but all new code should use VertexAIOperationWaitTimeWithResponse in the vertexai package instead. -func VertexAIOperationWaitTimeWithResponse(config *transport_tpg.Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error { - return vertexai.VertexAIOperationWaitTimeWithResponse(config, op, response, project, activity, userAgent, timeout) -} - -// Deprecated: For backward compatibility VertexAIOperationWaitTime is still working, -// but all new code should use VertexAIOperationWaitTime in the vertexai package instead. -func VertexAIOperationWaitTime(config *transport_tpg.Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error { - return vertexai.VertexAIOperationWaitTime(config, op, project, activity, userAgent, timeout) -} diff --git a/scripts/diff.go b/scripts/diff.go index 9b9ba3bbfba..bc824100976 100644 --- a/scripts/diff.go +++ b/scripts/diff.go @@ -9,8 +9,8 @@ import ( "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - googleOld "github.com/hashicorp/terraform-provider-clean-google/google" - google "github.com/hashicorp/terraform-provider-google/google" + googleOld "github.com/hashicorp/terraform-provider-clean-google/google/provider" + google "github.com/hashicorp/terraform-provider-google/google/provider" ) var verbose bool