From 6feaad9a2ec4b422511e2e32602193c0d61c6ce8 Mon Sep 17 00:00:00 2001 From: Agustin Bettati Date: Thu, 10 Aug 2023 09:07:25 +0200 Subject: [PATCH] feat: new framework provider, main and acceptance tests to use mux server with existing sdk v2 provider (#1366) * feat: define new framework provider, configure main and acceptance tests to use mux server with existing sdk v2 provider * fix ConflictsWith attribute validation and parsing of list values in assume role schema * refactor: addressing PR comments for linting and code cleanup * fix: define provider version in framework provider Metadata function * doc: add description for AWS Secrets Manager provider config attributes * refactor mux provider fractory method name and comments * doc: inlcude terraform version requirement in docs * refactor: remove redundant else statement * refactor: improve readability of methods in fw_provider + comments --- README.md | 4 +- examples/Atlas_Database_Users/versions.tf | 2 +- examples/Federated-Settings/versions.tf | 2 +- .../MongoDB-Atlas-AWS-VPC-Peering/versions.tf | 2 +- .../MongoDB-Atlas-GCP-VPC-Peering/versions.tf | 2 +- .../global-cluster/versions.tf | 2 +- .../multi-cloud/versions.tf | 2 +- .../tenant-upgrade/versions.tf | 2 +- .../atlas-alert-configurations/versions.tf | 2 +- .../versions.tf | 2 +- .../versions.tf | 2 +- .../versions.tf | 2 +- .../point-in-time-advance-cluster/versions.tf | 2 +- .../point-in-time/versions.tf | 2 +- .../aws/versions.tf | 2 +- .../atlas-cluster/nvme-upgrade/versions.tf | 2 +- .../atlas-cluster/tenant-upgrade/versions.tf | 2 +- .../atlas-dataLake-roles/import/versions.tf | 2 +- examples/atlas-dataLake-roles/versions.tf | 2 +- examples/atlas-datalake-pipeline/versions.tf | 2 +- .../aws/atlas-cluster/versions.tf | 2 +- .../modules/multi-region-cluster/versions.tf | 2 +- .../aws/multi-region-cluster/versions.tf | 2 +- examples/atlas-ip-access-list/versions.tf | 2 +- .../organization-step-1/versions.tf | 2 +- .../organization-step-2/versions.tf | 2 +- examples/atlas-project-limits/versions.tf | 2 +- .../versions.tf | 2 +- .../versions.tf | 2 +- .../versions.tf | 2 +- .../cluster-geosharded/versions.tf | 2 +- .../cluster/versions.tf | 2 +- .../versions.tf | 2 +- .../serverless-instance/versions.tf | 2 +- .../versions.tf | 2 +- examples/azure-atlas-privatelink/versions.tf | 2 +- .../cluster-outage-simulation/versions.tf | 2 +- .../federated-database-instance/versions.tf | 2 +- .../versions.tf | 2 +- examples/gcp-atlas-privatelink/versions.tf | 2 +- .../versions.tf | 2 +- examples/online-archives/versions.tf | 2 +- examples/starter/versions.tf | 2 +- .../encryption-at-rest/aws/v091/versions.tf | 2 +- .../encryption-at-rest/aws/v101/versions.tf | 2 +- .../encryption-at-rest/azure/v091/versions.tf | 2 +- .../encryption-at-rest/azure/v101/versions.tf | 2 +- .../encryption-at-rest/gcp/v091/versions.tf | 2 +- .../encryption-at-rest/gcp/v101/versions.tf | 2 +- .../v090/cluster/v082/versions.tf | 2 +- .../v090/cluster/v090/versions.tf | 2 +- .../v090/database-user/v082/versions.tf | 2 +- .../v090/database-user/v090/versions.tf | 2 +- .../v090/private-endpoint/v080/versions.tf | 2 +- .../v090/private-endpoint/v090/versions.tf | 2 +- .../cloud-backup-policies/v091/versions.tf | 2 +- .../cloud-backup-policies/v100/versions.tf | 2 +- .../alert-configuration/versions.tf | 2 +- .../design-id-reference/network/versions.tf | 2 +- .../privatelink/versions.tf | 2 +- .../design-id-reference/project/versions.tf | 2 +- .../ip-whitelist-accestList/v091/versions.tf | 2 +- .../ip-whitelist-accestList/v100/versions.tf | 2 +- .../privatelink-endpoint/v091/versions.tf | 2 +- .../privatelink-endpoint/v100/versions.tf | 2 +- .../cloud-backup-snapshot/v102/versions.tf | 2 +- .../cloud-backup-snapshot/v110/versions.tf | 2 +- .../datadog/versions.tf | 2 +- .../prometheus-and-teams/versions.tf | 2 +- go.mod | 18 +- go.sum | 135 ++++++ main.go | 23 +- mongodbatlas/config.go | 9 +- ...ce_mongodbatlas_accesslist_api_key_test.go | 6 +- ...e_mongodbatlas_accesslist_api_keys_test.go | 6 +- ...e_mongodbatlas_alert_configuration_test.go | 18 +- ..._mongodbatlas_alert_configurations_test.go | 6 +- .../data_source_mongodbatlas_api_key_test.go | 6 +- .../data_source_mongodbatlas_api_keys_test.go | 6 +- .../data_source_mongodbatlas_auditing_test.go | 4 +- ...godbatlas_backup_compliance_policy_test.go | 4 +- ...loud_backup_snapshot_export_bucket_test.go | 4 +- ...oud_backup_snapshot_export_buckets_test.go | 4 +- ...s_cloud_backup_snapshot_export_job_test.go | 4 +- ..._cloud_backup_snapshot_export_jobs_test.go | 4 +- ...batlas_cloud_provider_access_setup_test.go | 4 +- ...mongodbatlas_cloud_provider_access_test.go | 4 +- ...odbatlas_cluster_outage_simulation_test.go | 12 +- ...source_mongodbatlas_custom_db_role_test.go | 6 +- ...ource_mongodbatlas_custom_db_roles_test.go | 6 +- ...stom_dns_configuration_cluster_aws_test.go | 4 +- ...ongodbatlas_data_lake_pipeline_run_test.go | 4 +- ...ngodbatlas_data_lake_pipeline_runs_test.go | 4 +- ...ce_mongodbatlas_data_lake_pipeline_test.go | 6 +- ...e_mongodbatlas_data_lake_pipelines_test.go | 6 +- ...data_source_mongodbatlas_data_lake_test.go | 4 +- ...ata_source_mongodbatlas_data_lakes_test.go | 4 +- ..._source_mongodbatlas_database_user_test.go | 4 +- ...source_mongodbatlas_database_users_test.go | 4 +- ..._source_mongodbatlas_event_trigger_test.go | 6 +- ...source_mongodbatlas_event_triggers_test.go | 4 +- ...batlas_federated_database_instance_test.go | 10 +- ...atlas_federated_database_instances_test.go | 4 +- ...mongodbatlas_federated_query_limit_test.go | 6 +- ...ongodbatlas_federated_query_limits_test.go | 4 +- ...ed_settings_connected_organization_test.go | 6 +- ...d_settings_connected_organizations_test.go | 6 +- ...derated_settings_identity_provider_test.go | 4 +- ...erated_settings_identity_providers_test.go | 6 +- ...settings_organization_role_mapping_test.go | 4 +- ...ettings_organization_role_mappings_test.go | 6 +- ...ce_mongodbatlas_federated_settings_test.go | 6 +- ...mongodbatlas_global_cluster_config_test.go | 6 +- ...ce_mongodbatlas_ldap_configuration_test.go | 6 +- ...ta_source_mongodbatlas_ldap_verify_test.go | 6 +- ...ce_mongodbatlas_maintenance_window_test.go | 4 +- ...ource_mongodbatlas_network_peering_test.go | 6 +- ...urce_mongodbatlas_network_peerings_test.go | 6 +- .../data_source_mongodbatlas_org_id_test.go | 6 +- ...source_mongodbatlas_org_invitation_test.go | 6 +- ...a_source_mongodbatlas_organization_test.go | 2 +- ..._source_mongodbatlas_organizations_test.go | 4 +- ...las_private_endpoint_regional_mode_test.go | 6 +- ...s_privatelink_endpoint_service_adl_test.go | 4 +- ...ice_data_federation_online_archive_test.go | 6 +- ...ce_data_federation_online_archives_test.go | 6 +- ...atlas_privatelink_endpoint_service_test.go | 4 +- ..._mongodbatlas_privatelink_endpoint_test.go | 4 +- ..._privatelink_endpoints_service_adl_test.go | 4 +- ...ource_mongodbatlas_project_api_key_test.go | 6 +- ...urce_mongodbatlas_project_api_keys_test.go | 6 +- ...ce_mongodbatlas_project_invitation_test.go | 6 +- ...ongodbatlas_project_ip_access_list_test.go | 12 +- .../data_source_mongodbatlas_project_test.go | 16 +- .../data_source_mongodbatlas_projects_test.go | 8 +- .../data_source_mongodbatlas_team_test.go | 12 +- ...ngodbatlas_third_party_integration_test.go | 6 +- ...godbatlas_third_party_integrations_test.go | 4 +- .../framework/validator/duration_validator.go | 60 +++ .../validator/json_string_validator.go | 39 ++ mongodbatlas/fw_provider.go | 404 ++++++++++++++++++ mongodbatlas/provider.go | 212 ++++++--- mongodbatlas/provider_test.go | 24 +- ...e_mongodbatlas_access_list_api_key_test.go | 22 +- ...urce_mongodbatlas_advanced_cluster_test.go | 64 +-- ...e_mongodbatlas_alert_configuration_test.go | 82 ++-- .../resource_mongodbatlas_api_key_test.go | 16 +- .../resource_mongodbatlas_auditing_test.go | 16 +- ...godbatlas_backup_compliance_policy_test.go | 22 +- ...mongodbatlas_cloud_backup_schedule_test.go | 38 +- ...loud_backup_snapshot_export_bucket_test.go | 16 +- ...s_cloud_backup_snapshot_export_job_test.go | 16 +- ..._cloud_backup_snapshot_restore_job_test.go | 22 +- ...mongodbatlas_cloud_backup_snapshot_test.go | 10 +- ...loud_provider_access_authorization_test.go | 4 +- ...batlas_cloud_provider_access_setup_test.go | 10 +- ...mongodbatlas_cloud_provider_access_test.go | 12 +- ...odbatlas_cluster_outage_simulation_test.go | 14 +- .../resource_mongodbatlas_cluster_test.go | 166 +++---- ...source_mongodbatlas_custom_db_role_test.go | 40 +- ...stom_dns_configuration_cluster_aws_test.go | 16 +- ...ce_mongodbatlas_data_lake_pipeline_test.go | 8 +- .../resource_mongodbatlas_data_lake_test.go | 16 +- ...esource_mongodbatlas_database_user_test.go | 82 ++-- ...ce_mongodbatlas_encryption_at_rest_test.go | 28 +- ...esource_mongodbatlas_event_trigger_test.go | 46 +- ...batlas_federated_database_instance_test.go | 34 +- ...mongodbatlas_federated_query_limit_test.go | 16 +- ...ed_settings_connected_organization_test.go | 10 +- ...derated_settings_identity_provider_test.go | 10 +- ...settings_organization_role_mapping_test.go | 16 +- ...mongodbatlas_global_cluster_config_test.go | 28 +- ...ce_mongodbatlas_ldap_configuration_test.go | 22 +- .../resource_mongodbatlas_ldap_verify_test.go | 22 +- ...ce_mongodbatlas_maintenance_window_test.go | 14 +- ...rce_mongodbatlas_network_container_test.go | 34 +- ...ource_mongodbatlas_network_peering_test.go | 26 +- ...source_mongodbatlas_online_archive_test.go | 14 +- ...source_mongodbatlas_org_invitation_test.go | 16 +- ...resource_mongodbatlas_organization_test.go | 16 +- ...las_private_endpoint_regional_mode_test.go | 18 +- ...as_privatelink_endpoint_serverless_test.go | 16 +- ...s_privatelink_endpoint_service_adl_test.go | 16 +- ...ice_data_federation_online_archive_test.go | 10 +- ...telink_endpoint_service_serverless_test.go | 16 +- ...atlas_privatelink_endpoint_service_test.go | 16 +- ..._mongodbatlas_privatelink_endpoint_test.go | 34 +- ...ource_mongodbatlas_project_api_key_test.go | 34 +- ...ce_mongodbatlas_project_invitation_test.go | 16 +- ...ongodbatlas_project_ip_access_list_test.go | 34 +- .../resource_mongodbatlas_project_test.go | 64 +-- ...resource_mongodbatlas_search_index_test.go | 28 +- ...e_mongodbatlas_serverless_instance_test.go | 16 +- .../resource_mongodbatlas_team_test.go | 16 +- ...ngodbatlas_third_party_integration_test.go | 20 +- ..._x509_authentication_database_user_test.go | 30 +- terraform-registry-manifest.json | 6 + website/docs/index.html.markdown | 5 + 198 files changed, 1807 insertions(+), 1074 deletions(-) create mode 100644 mongodbatlas/framework/validator/duration_validator.go create mode 100644 mongodbatlas/framework/validator/json_string_validator.go create mode 100644 mongodbatlas/fw_provider.go create mode 100644 terraform-registry-manifest.json diff --git a/README.md b/README.md index 62be64d71d..68c8886f5b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Bugs should be filed under the Issues section of this repo. Feature requests can be submitted at https://feedback.mongodb.com/forums/924145-atlas - just select the Terraform plugin as the category or vote for an already suggested feature. ## Requirements -- [Terraform](https://www.terraform.io/downloads.html) 0.13+ +- [Terraform](https://www.terraform.io/downloads.html) 1.0+ - [Go](https://golang.org/doc/install) 1.20 (to build the provider plugin) ## Using the Provider @@ -112,7 +112,7 @@ terraform { source = "mongodb/mongodbatlas" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } ``` diff --git a/examples/Atlas_Database_Users/versions.tf b/examples/Atlas_Database_Users/versions.tf index d15438132b..1888453805 100644 --- a/examples/Atlas_Database_Users/versions.tf +++ b/examples/Atlas_Database_Users/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/Federated-Settings/versions.tf b/examples/Federated-Settings/versions.tf index 2e613eb5a5..7d50229e5c 100644 --- a/examples/Federated-Settings/versions.tf +++ b/examples/Federated-Settings/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/MongoDB-Atlas-AWS-VPC-Peering/versions.tf b/examples/MongoDB-Atlas-AWS-VPC-Peering/versions.tf index 0cb9e00fdc..bae09faef1 100644 --- a/examples/MongoDB-Atlas-AWS-VPC-Peering/versions.tf +++ b/examples/MongoDB-Atlas-AWS-VPC-Peering/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 5.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/MongoDB-Atlas-GCP-VPC-Peering/versions.tf b/examples/MongoDB-Atlas-GCP-VPC-Peering/versions.tf index 0bcc7af122..6688e8a9e7 100644 --- a/examples/MongoDB-Atlas-GCP-VPC-Peering/versions.tf +++ b/examples/MongoDB-Atlas-GCP-VPC-Peering/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 4.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-advanced-cluster/global-cluster/versions.tf b/examples/atlas-advanced-cluster/global-cluster/versions.tf index dea6253b37..a8f13589d1 100644 --- a/examples/atlas-advanced-cluster/global-cluster/versions.tf +++ b/examples/atlas-advanced-cluster/global-cluster/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.10.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-advanced-cluster/multi-cloud/versions.tf b/examples/atlas-advanced-cluster/multi-cloud/versions.tf index dea6253b37..a8f13589d1 100644 --- a/examples/atlas-advanced-cluster/multi-cloud/versions.tf +++ b/examples/atlas-advanced-cluster/multi-cloud/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.10.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-advanced-cluster/tenant-upgrade/versions.tf b/examples/atlas-advanced-cluster/tenant-upgrade/versions.tf index d15438132b..1888453805 100644 --- a/examples/atlas-advanced-cluster/tenant-upgrade/versions.tf +++ b/examples/atlas-advanced-cluster/tenant-upgrade/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-alert-configurations/versions.tf b/examples/atlas-alert-configurations/versions.tf index d15438132b..1888453805 100644 --- a/examples/atlas-alert-configurations/versions.tf +++ b/examples/atlas-alert-configurations/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-api-key/create-and-assign-pak-seperately/versions.tf b/examples/atlas-api-key/create-and-assign-pak-seperately/versions.tf index d15438132b..1888453805 100644 --- a/examples/atlas-api-key/create-and-assign-pak-seperately/versions.tf +++ b/examples/atlas-api-key/create-and-assign-pak-seperately/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-api-key/create-and-assign-pak-together/versions.tf b/examples/atlas-api-key/create-and-assign-pak-together/versions.tf index d15438132b..1888453805 100644 --- a/examples/atlas-api-key/create-and-assign-pak-together/versions.tf +++ b/examples/atlas-api-key/create-and-assign-pak-together/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-api-key/create-api-key-assign-to-multiple-projects/versions.tf b/examples/atlas-api-key/create-api-key-assign-to-multiple-projects/versions.tf index dea6253b37..a8f13589d1 100644 --- a/examples/atlas-api-key/create-api-key-assign-to-multiple-projects/versions.tf +++ b/examples/atlas-api-key/create-api-key-assign-to-multiple-projects/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.10.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-backup-snapshot-restore-job/point-in-time-advance-cluster/versions.tf b/examples/atlas-backup-snapshot-restore-job/point-in-time-advance-cluster/versions.tf index dea6253b37..a8f13589d1 100644 --- a/examples/atlas-backup-snapshot-restore-job/point-in-time-advance-cluster/versions.tf +++ b/examples/atlas-backup-snapshot-restore-job/point-in-time-advance-cluster/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.10.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-backup-snapshot-restore-job/point-in-time/versions.tf b/examples/atlas-backup-snapshot-restore-job/point-in-time/versions.tf index dea6253b37..a8f13589d1 100644 --- a/examples/atlas-backup-snapshot-restore-job/point-in-time/versions.tf +++ b/examples/atlas-backup-snapshot-restore-job/point-in-time/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.10.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-cloud-provider-access/aws/versions.tf b/examples/atlas-cloud-provider-access/aws/versions.tf index 0cb9e00fdc..bae09faef1 100644 --- a/examples/atlas-cloud-provider-access/aws/versions.tf +++ b/examples/atlas-cloud-provider-access/aws/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 5.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-cluster/nvme-upgrade/versions.tf b/examples/atlas-cluster/nvme-upgrade/versions.tf index 7dfc0a07f6..3cddfa1c45 100644 --- a/examples/atlas-cluster/nvme-upgrade/versions.tf +++ b/examples/atlas-cluster/nvme-upgrade/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.9" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-cluster/tenant-upgrade/versions.tf b/examples/atlas-cluster/tenant-upgrade/versions.tf index d15438132b..1888453805 100644 --- a/examples/atlas-cluster/tenant-upgrade/versions.tf +++ b/examples/atlas-cluster/tenant-upgrade/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-dataLake-roles/import/versions.tf b/examples/atlas-dataLake-roles/import/versions.tf index b912f7acad..6b9f728948 100644 --- a/examples/atlas-dataLake-roles/import/versions.tf +++ b/examples/atlas-dataLake-roles/import/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-dataLake-roles/versions.tf b/examples/atlas-dataLake-roles/versions.tf index b912f7acad..6b9f728948 100644 --- a/examples/atlas-dataLake-roles/versions.tf +++ b/examples/atlas-dataLake-roles/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-datalake-pipeline/versions.tf b/examples/atlas-datalake-pipeline/versions.tf index dea6253b37..a8f13589d1 100644 --- a/examples/atlas-datalake-pipeline/versions.tf +++ b/examples/atlas-datalake-pipeline/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.10.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-encryption-at-rest/aws/atlas-cluster/versions.tf b/examples/atlas-encryption-at-rest/aws/atlas-cluster/versions.tf index 9f3808d211..8b56269fb0 100644 --- a/examples/atlas-encryption-at-rest/aws/atlas-cluster/versions.tf +++ b/examples/atlas-encryption-at-rest/aws/atlas-cluster/versions.tf @@ -9,6 +9,6 @@ terraform { version = "~> 5.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-encryption-at-rest/aws/multi-region-cluster/modules/multi-region-cluster/versions.tf b/examples/atlas-encryption-at-rest/aws/multi-region-cluster/modules/multi-region-cluster/versions.tf index dea6253b37..a8f13589d1 100644 --- a/examples/atlas-encryption-at-rest/aws/multi-region-cluster/modules/multi-region-cluster/versions.tf +++ b/examples/atlas-encryption-at-rest/aws/multi-region-cluster/modules/multi-region-cluster/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.10.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-encryption-at-rest/aws/multi-region-cluster/versions.tf b/examples/atlas-encryption-at-rest/aws/multi-region-cluster/versions.tf index 29940f870f..f97e38b706 100644 --- a/examples/atlas-encryption-at-rest/aws/multi-region-cluster/versions.tf +++ b/examples/atlas-encryption-at-rest/aws/multi-region-cluster/versions.tf @@ -9,6 +9,6 @@ terraform { version = "~> 5.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-ip-access-list/versions.tf b/examples/atlas-ip-access-list/versions.tf index d15438132b..1888453805 100644 --- a/examples/atlas-ip-access-list/versions.tf +++ b/examples/atlas-ip-access-list/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-organization/organization-step-1/versions.tf b/examples/atlas-organization/organization-step-1/versions.tf index d15438132b..1888453805 100644 --- a/examples/atlas-organization/organization-step-1/versions.tf +++ b/examples/atlas-organization/organization-step-1/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-organization/organization-step-2/versions.tf b/examples/atlas-organization/organization-step-2/versions.tf index d15438132b..1888453805 100644 --- a/examples/atlas-organization/organization-step-2/versions.tf +++ b/examples/atlas-organization/organization-step-2/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-project-limits/versions.tf b/examples/atlas-project-limits/versions.tf index b308736d40..c21d1b3028 100644 --- a/examples/atlas-project-limits/versions.tf +++ b/examples/atlas-project-limits/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.11" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-provider-snapshot-export-bucket/versions.tf b/examples/atlas-provider-snapshot-export-bucket/versions.tf index b912f7acad..6b9f728948 100644 --- a/examples/atlas-provider-snapshot-export-bucket/versions.tf +++ b/examples/atlas-provider-snapshot-export-bucket/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/atlas-provider-snapshot-export-job/versions.tf b/examples/atlas-provider-snapshot-export-job/versions.tf index b912f7acad..6b9f728948 100644 --- a/examples/atlas-provider-snapshot-export-job/versions.tf +++ b/examples/atlas-provider-snapshot-export-job/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/aws-atlas-privatelink-serverless/versions.tf b/examples/aws-atlas-privatelink-serverless/versions.tf index b912f7acad..6b9f728948 100644 --- a/examples/aws-atlas-privatelink-serverless/versions.tf +++ b/examples/aws-atlas-privatelink-serverless/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/aws-privatelink-endpoint/cluster-geosharded/versions.tf b/examples/aws-privatelink-endpoint/cluster-geosharded/versions.tf index b912f7acad..6b9f728948 100644 --- a/examples/aws-privatelink-endpoint/cluster-geosharded/versions.tf +++ b/examples/aws-privatelink-endpoint/cluster-geosharded/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/aws-privatelink-endpoint/cluster/versions.tf b/examples/aws-privatelink-endpoint/cluster/versions.tf index b912f7acad..6b9f728948 100644 --- a/examples/aws-privatelink-endpoint/cluster/versions.tf +++ b/examples/aws-privatelink-endpoint/cluster/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/aws-privatelink-endpoint/data-federation-online-archive/versions.tf b/examples/aws-privatelink-endpoint/data-federation-online-archive/versions.tf index 758e35b951..d88a50fa25 100644 --- a/examples/aws-privatelink-endpoint/data-federation-online-archive/versions.tf +++ b/examples/aws-privatelink-endpoint/data-federation-online-archive/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 1.10.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/aws-privatelink-endpoint/serverless-instance/versions.tf b/examples/aws-privatelink-endpoint/serverless-instance/versions.tf index b912f7acad..6b9f728948 100644 --- a/examples/aws-privatelink-endpoint/serverless-instance/versions.tf +++ b/examples/aws-privatelink-endpoint/serverless-instance/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/azure-atlas-privatelink-serverless/versions.tf b/examples/azure-atlas-privatelink-serverless/versions.tf index 2e613eb5a5..7d50229e5c 100644 --- a/examples/azure-atlas-privatelink-serverless/versions.tf +++ b/examples/azure-atlas-privatelink-serverless/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/azure-atlas-privatelink/versions.tf b/examples/azure-atlas-privatelink/versions.tf index 2e613eb5a5..7d50229e5c 100644 --- a/examples/azure-atlas-privatelink/versions.tf +++ b/examples/azure-atlas-privatelink/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/cluster-outage-simulation/versions.tf b/examples/cluster-outage-simulation/versions.tf index d15438132b..1888453805 100644 --- a/examples/cluster-outage-simulation/versions.tf +++ b/examples/cluster-outage-simulation/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/federated-database-instance/versions.tf b/examples/federated-database-instance/versions.tf index 0cb9e00fdc..bae09faef1 100644 --- a/examples/federated-database-instance/versions.tf +++ b/examples/federated-database-instance/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 5.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/federated-database-query-limit/versions.tf b/examples/federated-database-query-limit/versions.tf index d15438132b..1888453805 100644 --- a/examples/federated-database-query-limit/versions.tf +++ b/examples/federated-database-query-limit/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/gcp-atlas-privatelink/versions.tf b/examples/gcp-atlas-privatelink/versions.tf index 1ed53c4bd2..cf8b012f45 100644 --- a/examples/gcp-atlas-privatelink/versions.tf +++ b/examples/gcp-atlas-privatelink/versions.tf @@ -14,5 +14,5 @@ terraform { version = "~> 4.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/mongodbatlas-azure-vnet-peering/versions.tf b/examples/mongodbatlas-azure-vnet-peering/versions.tf index 3b213db54a..ac339d963c 100644 --- a/examples/mongodbatlas-azure-vnet-peering/versions.tf +++ b/examples/mongodbatlas-azure-vnet-peering/versions.tf @@ -13,5 +13,5 @@ terraform { version = "~> 3.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/online-archives/versions.tf b/examples/online-archives/versions.tf index d15438132b..1888453805 100644 --- a/examples/online-archives/versions.tf +++ b/examples/online-archives/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/starter/versions.tf b/examples/starter/versions.tf index d15438132b..1888453805 100644 --- a/examples/starter/versions.tf +++ b/examples/starter/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/encryption-at-rest/aws/v091/versions.tf b/examples/test-upgrade/encryption-at-rest/aws/v091/versions.tf index 6233e19899..a9d38706a7 100644 --- a/examples/test-upgrade/encryption-at-rest/aws/v091/versions.tf +++ b/examples/test-upgrade/encryption-at-rest/aws/v091/versions.tf @@ -9,6 +9,6 @@ terraform { version = "~> 5.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/encryption-at-rest/aws/v101/versions.tf b/examples/test-upgrade/encryption-at-rest/aws/v101/versions.tf index 3465a8e6b1..2134323295 100644 --- a/examples/test-upgrade/encryption-at-rest/aws/v101/versions.tf +++ b/examples/test-upgrade/encryption-at-rest/aws/v101/versions.tf @@ -10,6 +10,6 @@ terraform { version = "~> 5.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/encryption-at-rest/azure/v091/versions.tf b/examples/test-upgrade/encryption-at-rest/azure/v091/versions.tf index 7f9d6969c7..4d06bc63a6 100644 --- a/examples/test-upgrade/encryption-at-rest/azure/v091/versions.tf +++ b/examples/test-upgrade/encryption-at-rest/azure/v091/versions.tf @@ -5,6 +5,6 @@ terraform { version = "0.9.1" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/encryption-at-rest/azure/v101/versions.tf b/examples/test-upgrade/encryption-at-rest/azure/v101/versions.tf index f66e441a6e..23cc6a02af 100644 --- a/examples/test-upgrade/encryption-at-rest/azure/v101/versions.tf +++ b/examples/test-upgrade/encryption-at-rest/azure/v101/versions.tf @@ -5,6 +5,6 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/encryption-at-rest/gcp/v091/versions.tf b/examples/test-upgrade/encryption-at-rest/gcp/v091/versions.tf index 7f9d6969c7..4d06bc63a6 100644 --- a/examples/test-upgrade/encryption-at-rest/gcp/v091/versions.tf +++ b/examples/test-upgrade/encryption-at-rest/gcp/v091/versions.tf @@ -5,6 +5,6 @@ terraform { version = "0.9.1" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/encryption-at-rest/gcp/v101/versions.tf b/examples/test-upgrade/encryption-at-rest/gcp/v101/versions.tf index f66e441a6e..23cc6a02af 100644 --- a/examples/test-upgrade/encryption-at-rest/gcp/v101/versions.tf +++ b/examples/test-upgrade/encryption-at-rest/gcp/v101/versions.tf @@ -5,6 +5,6 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v090/cluster/v082/versions.tf b/examples/test-upgrade/v090/cluster/v082/versions.tf index d15438132b..1888453805 100644 --- a/examples/test-upgrade/v090/cluster/v082/versions.tf +++ b/examples/test-upgrade/v090/cluster/v082/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v090/cluster/v090/versions.tf b/examples/test-upgrade/v090/cluster/v090/versions.tf index d15438132b..1888453805 100644 --- a/examples/test-upgrade/v090/cluster/v090/versions.tf +++ b/examples/test-upgrade/v090/cluster/v090/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v090/database-user/v082/versions.tf b/examples/test-upgrade/v090/database-user/v082/versions.tf index eda845a95c..15084fa197 100644 --- a/examples/test-upgrade/v090/database-user/v082/versions.tf +++ b/examples/test-upgrade/v090/database-user/v082/versions.tf @@ -5,5 +5,5 @@ terraform { version = "0.8.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v090/database-user/v090/versions.tf b/examples/test-upgrade/v090/database-user/v090/versions.tf index 117ffec928..b5f8a7e106 100644 --- a/examples/test-upgrade/v090/database-user/v090/versions.tf +++ b/examples/test-upgrade/v090/database-user/v090/versions.tf @@ -5,6 +5,6 @@ terraform { version = "0.9.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v090/private-endpoint/v080/versions.tf b/examples/test-upgrade/v090/private-endpoint/v080/versions.tf index ad88d90b83..7f7c16e9ee 100644 --- a/examples/test-upgrade/v090/private-endpoint/v080/versions.tf +++ b/examples/test-upgrade/v090/private-endpoint/v080/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 5.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v090/private-endpoint/v090/versions.tf b/examples/test-upgrade/v090/private-endpoint/v090/versions.tf index 365200fe0e..38ae6e1bd5 100644 --- a/examples/test-upgrade/v090/private-endpoint/v090/versions.tf +++ b/examples/test-upgrade/v090/private-endpoint/v090/versions.tf @@ -10,6 +10,6 @@ terraform { version = "~> 5.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v100/cloud-backup-policies/v091/versions.tf b/examples/test-upgrade/v100/cloud-backup-policies/v091/versions.tf index a3fc65c4b0..f79fc01abf 100644 --- a/examples/test-upgrade/v100/cloud-backup-policies/v091/versions.tf +++ b/examples/test-upgrade/v100/cloud-backup-policies/v091/versions.tf @@ -5,5 +5,5 @@ terraform { version = "0.9.1" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v100/cloud-backup-policies/v100/versions.tf b/examples/test-upgrade/v100/cloud-backup-policies/v100/versions.tf index d15438132b..1888453805 100644 --- a/examples/test-upgrade/v100/cloud-backup-policies/v100/versions.tf +++ b/examples/test-upgrade/v100/cloud-backup-policies/v100/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v100/design-id-reference/alert-configuration/versions.tf b/examples/test-upgrade/v100/design-id-reference/alert-configuration/versions.tf index 60c246481f..3bf7045fcf 100644 --- a/examples/test-upgrade/v100/design-id-reference/alert-configuration/versions.tf +++ b/examples/test-upgrade/v100/design-id-reference/alert-configuration/versions.tf @@ -5,5 +5,5 @@ terraform { version = "1.0.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v100/design-id-reference/network/versions.tf b/examples/test-upgrade/v100/design-id-reference/network/versions.tf index 60c246481f..3bf7045fcf 100644 --- a/examples/test-upgrade/v100/design-id-reference/network/versions.tf +++ b/examples/test-upgrade/v100/design-id-reference/network/versions.tf @@ -5,5 +5,5 @@ terraform { version = "1.0.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v100/design-id-reference/privatelink/versions.tf b/examples/test-upgrade/v100/design-id-reference/privatelink/versions.tf index 2e7bbd4aff..b7b5c3890c 100644 --- a/examples/test-upgrade/v100/design-id-reference/privatelink/versions.tf +++ b/examples/test-upgrade/v100/design-id-reference/privatelink/versions.tf @@ -10,6 +10,6 @@ terraform { version = "~> 5.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v100/design-id-reference/project/versions.tf b/examples/test-upgrade/v100/design-id-reference/project/versions.tf index 60c246481f..3bf7045fcf 100644 --- a/examples/test-upgrade/v100/design-id-reference/project/versions.tf +++ b/examples/test-upgrade/v100/design-id-reference/project/versions.tf @@ -5,5 +5,5 @@ terraform { version = "1.0.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v100/ip-whitelist-accestList/v091/versions.tf b/examples/test-upgrade/v100/ip-whitelist-accestList/v091/versions.tf index a3fc65c4b0..f79fc01abf 100644 --- a/examples/test-upgrade/v100/ip-whitelist-accestList/v091/versions.tf +++ b/examples/test-upgrade/v100/ip-whitelist-accestList/v091/versions.tf @@ -5,5 +5,5 @@ terraform { version = "0.9.1" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v100/ip-whitelist-accestList/v100/versions.tf b/examples/test-upgrade/v100/ip-whitelist-accestList/v100/versions.tf index 60c246481f..3bf7045fcf 100644 --- a/examples/test-upgrade/v100/ip-whitelist-accestList/v100/versions.tf +++ b/examples/test-upgrade/v100/ip-whitelist-accestList/v100/versions.tf @@ -5,5 +5,5 @@ terraform { version = "1.0.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v100/privatelink-endpoint/v091/versions.tf b/examples/test-upgrade/v100/privatelink-endpoint/v091/versions.tf index 1dd0c7cd09..9d7283a149 100644 --- a/examples/test-upgrade/v100/privatelink-endpoint/v091/versions.tf +++ b/examples/test-upgrade/v100/privatelink-endpoint/v091/versions.tf @@ -10,5 +10,5 @@ terraform { } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v100/privatelink-endpoint/v100/versions.tf b/examples/test-upgrade/v100/privatelink-endpoint/v100/versions.tf index 362c8f7d36..0ac0488d96 100644 --- a/examples/test-upgrade/v100/privatelink-endpoint/v100/versions.tf +++ b/examples/test-upgrade/v100/privatelink-endpoint/v100/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 5.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v110/cloud-backup-snapshot/v102/versions.tf b/examples/test-upgrade/v110/cloud-backup-snapshot/v102/versions.tf index 9374cf8784..db85e6b351 100644 --- a/examples/test-upgrade/v110/cloud-backup-snapshot/v102/versions.tf +++ b/examples/test-upgrade/v110/cloud-backup-snapshot/v102/versions.tf @@ -5,5 +5,5 @@ terraform { version = "1.0.2" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/test-upgrade/v110/cloud-backup-snapshot/v110/versions.tf b/examples/test-upgrade/v110/cloud-backup-snapshot/v110/versions.tf index 3231904886..150eb9fc27 100644 --- a/examples/test-upgrade/v110/cloud-backup-snapshot/v110/versions.tf +++ b/examples/test-upgrade/v110/cloud-backup-snapshot/v110/versions.tf @@ -5,5 +5,5 @@ terraform { version = "1.1.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/third-party-integration/datadog/versions.tf b/examples/third-party-integration/datadog/versions.tf index 0bcc7af122..6688e8a9e7 100644 --- a/examples/third-party-integration/datadog/versions.tf +++ b/examples/third-party-integration/datadog/versions.tf @@ -9,5 +9,5 @@ terraform { version = "~> 4.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/examples/third-party-integration/prometheus-and-teams/versions.tf b/examples/third-party-integration/prometheus-and-teams/versions.tf index fd7582c2a3..4984f1d681 100644 --- a/examples/third-party-integration/prometheus-and-teams/versions.tf +++ b/examples/third-party-integration/prometheus-and-teams/versions.tf @@ -10,5 +10,5 @@ terraform { version = "2.2.0" } } - required_version = ">= 0.13" + required_version = ">= 1.0" } diff --git a/go.mod b/go.mod index 4c9b960515..a473587215 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,11 @@ require ( github.com/gruntwork-io/terratest v0.43.10 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/hcl/v2 v2.17.0 + github.com/hashicorp/terraform-plugin-framework v1.3.3 + github.com/hashicorp/terraform-plugin-framework-validators v0.10.0 + github.com/hashicorp/terraform-plugin-go v0.18.0 + github.com/hashicorp/terraform-plugin-mux v0.11.2 + github.com/hashicorp/terraform-plugin-sdk v1.17.2 github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0 github.com/hashicorp/terraform-plugin-testing v1.4.0 github.com/mongodb-forks/digest v1.0.4 @@ -26,10 +31,16 @@ require ( cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v0.13.0 // indirect cloud.google.com/go/storage v1.28.1 // indirect + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver/v3 v3.1.1 // indirect + github.com/Masterminds/sprig/v3 v3.2.1 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect github.com/agext/levenshtein v1.2.3 // indirect + github.com/apparentlymart/go-cidr v1.1.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect + github.com/armon/go-radix v1.0.0 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect + github.com/bgentry/speakeasy v0.1.0 // indirect github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect github.com/cloudflare/circl v1.3.3 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect @@ -67,11 +78,11 @@ require ( github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.18.1 // indirect github.com/hashicorp/terraform-json v0.17.1 // indirect - github.com/hashicorp/terraform-plugin-go v0.18.0 // indirect github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.1 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect + github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/jhump/protoreflect v1.6.1 // indirect github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect @@ -83,6 +94,7 @@ require ( github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 // indirect + github.com/mitchellh/cli v1.1.5 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -95,8 +107,11 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oklog/run v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/posener/complete v1.2.1 // indirect github.com/pquerna/otp v1.3.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/shopspring/decimal v1.2.0 // indirect + github.com/spf13/afero v1.2.2 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/testify v1.8.1 // indirect github.com/tmccombs/hcl2json v0.3.3 // indirect @@ -105,6 +120,7 @@ require ( github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + github.com/zclconf/go-cty-yaml v1.0.2 // indirect go.opencensus.io v0.24.0 // indirect golang.org/x/crypto v0.11.0 // indirect golang.org/x/mod v0.10.0 // indirect diff --git a/go.sum b/go.sum index fc4f70b88d..f8421fb57a 100644 --- a/go.sum +++ b/go.sum @@ -188,26 +188,53 @@ cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoIS dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Masterminds/sprig/v3 v3.2.1 h1:n6EPaDyLSvCEa3frruQvAiHuNp2dhBlMSmkEr+HuzGc= +github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= +github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= +github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= +github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= +github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.44.308 h1:XKu+76UHsD5LaiU2Zb1q42uWakw80Az7x39jJXXahos= github.com/aws/aws-sdk-go v1.44.308/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= +github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= @@ -242,6 +269,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -257,13 +285,20 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0 h1:skJKxRtNmevLqnayafdLe2AsenqRupVmzZSqrvb5caU= github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.1.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= +github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= +github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw= github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -321,6 +356,7 @@ github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -369,6 +405,7 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -400,61 +437,99 @@ github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= +github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= +github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hc-install v0.5.2 h1:SfwMFnEXVVirpwkDuSF5kymUOhrUxrTq3udEseZdOD0= github.com/hashicorp/hc-install v0.5.2/go.mod h1:9QISwe6newMWIfEiXpzuu1k9HAGtQYgnSH8H9T8wmoI= +github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws= +github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= +github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= +github.com/hashicorp/hcl/v2 v2.8.2/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= github.com/hashicorp/hcl/v2 v2.9.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= github.com/hashicorp/hcl/v2 v2.17.0 h1:z1XvSUyXd1HP10U4lrLg5e0JMVz6CPaJvAgxM0KNZVY= github.com/hashicorp/hcl/v2 v2.17.0/go.mod h1:gJyW2PTShkJqQBKpAmPO3yxMxIuoXkOF2TpqXzrQyx4= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 h1:Pc5TCv9mbxFN6UVX0LH6CpQrdTM5YjbVI2w15237Pjk= +github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= +github.com/hashicorp/terraform-exec v0.13.3/go.mod h1:SSg6lbUsVB3DmFyCPjBPklqf6EYGX0TlQ6QTxOlikDU= github.com/hashicorp/terraform-exec v0.18.1 h1:LAbfDvNQU1l0NOQlTuudjczVhHj061fNX5H8XZxHlH4= github.com/hashicorp/terraform-exec v0.18.1/go.mod h1:58wg4IeuAJ6LVsLUeD2DWZZoc/bYi6dzhLHzxM41980= +github.com/hashicorp/terraform-json v0.10.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= github.com/hashicorp/terraform-json v0.17.1 h1:eMfvh/uWggKmY7Pmb3T85u86E2EQg6EQHgyRwf3RkyA= github.com/hashicorp/terraform-json v0.17.1/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o= +github.com/hashicorp/terraform-plugin-framework v1.3.3 h1:D18BlA8gdV4+W8WKhUqxudiYomPZHv94FFzyoSCKC8Q= +github.com/hashicorp/terraform-plugin-framework v1.3.3/go.mod h1:2gGDpWiTI0irr9NSTLFAKlTi6KwGti3AoU19rFqU30o= +github.com/hashicorp/terraform-plugin-framework-validators v0.10.0 h1:4L0tmy/8esP6OcvocVymw52lY0HyQ5OxB7VNl7k4bS0= +github.com/hashicorp/terraform-plugin-framework-validators v0.10.0/go.mod h1:qdQJCdimB9JeX2YwOpItEu+IrfoJjWQ5PhLpAOMDQAE= github.com/hashicorp/terraform-plugin-go v0.18.0 h1:IwTkOS9cOW1ehLd/rG0y+u/TGLK9y6fGoBjXVUquzpE= github.com/hashicorp/terraform-plugin-go v0.18.0/go.mod h1:l7VK+2u5Kf2y+A+742GX0ouLut3gttudmvMgN0PA74Y= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= +github.com/hashicorp/terraform-plugin-mux v0.11.2 h1:XMkAmWQN+6F+l4jwNeqdPom/8Vly6ZNDxHoKjiRHx5c= +github.com/hashicorp/terraform-plugin-mux v0.11.2/go.mod h1:qjoF/pI49rILSNQzKIuDtU+ZX9mpQD0B8YNE1GceLPc= +github.com/hashicorp/terraform-plugin-sdk v1.17.2 h1:V7DUR3yBWFrVB9z3ddpY7kiYVSsq4NYR67NiTs93NQo= +github.com/hashicorp/terraform-plugin-sdk v1.17.2/go.mod h1:wkvldbraEMkz23NxkkAsFS88A1R9eUiooiaUZyS6TLw= github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0 h1:I8efBnjuDrgPjNF1MEypHy48VgcTIUY4X6rOFunrR3Y= github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0/go.mod h1:cUEP4ly/nxlHy5HzD6YRrHydtlheGvGRJDhiWqqVik4= +github.com/hashicorp/terraform-plugin-test/v2 v2.2.1/go.mod h1:eZ9JL3O69Cb71Skn6OhHyj17sLmHRb+H6VrDcJjKrYU= github.com/hashicorp/terraform-plugin-testing v1.4.0 h1:DVIXxw7VHZvnwWVik4HzhpC2yytaJ5FpiHxz5debKmE= github.com/hashicorp/terraform-plugin-testing v1.4.0/go.mod h1:b7Bha24iGrbZQjT+ZE8m9crck1YjdVOZ8mfGCQ19OxA= github.com/hashicorp/terraform-registry-address v0.2.1 h1:QuTf6oJ1+WSflJw6WYOHhLgwUiQ0FrROpHPYFtwTYWM= github.com/hashicorp/terraform-registry-address v0.2.1/go.mod h1:BSE9fIFzp0qWsJUUyGquo4ldV9k2n+psif6NYkBRS3Y= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= +github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jhump/protoreflect v1.6.1 h1:4/2yi5LyDPP7nN+Hiird1SAJ6YoxUm13/oxHGRnbPd8= github.com/jhump/protoreflect v1.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4= github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a h1:zPPuIq2jAWWPTrGt70eK/BSch+gFAGrNzecsoENgu2o= github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a/go.mod h1:yL958EeXv8Ylng6IfnvG4oflryUi3vgA3xPs9hmII1s= +github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -465,9 +540,12 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -485,11 +563,14 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -499,17 +580,30 @@ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 h1:ofNAzWCcyTALn2Zv40+8XitdzCgXY6e9qvXwN9W0YXg= github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= +github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= +github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= +github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.4/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= @@ -525,16 +619,22 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwielbut/pointy v1.1.0 h1:U5/YEfoIkaGCHv0St3CgjduqXID4FNRoyZgLM1kY9vg= github.com/mwielbut/pointy v1.1.0/go.mod h1:MvvO+uMFj9T5DMda33HlvogsFBX7pWWKAkFIn4teYwY= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= github.com/openlyinc/pointy v1.1.2 h1:LywVV2BWC5Sp5v7FoP4bUD+2Yn5k0VNeRbU5vq9jUMY= github.com/openlyinc/pointy v1.1.2/go.mod h1:w2Sytx+0FVuMKn37xpXIAyBNhFNBIJGR/v2m7ik1WtM= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6DI= +github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= github.com/pquerna/otp v1.3.0 h1:oJV/SkzR33anKXwQU3Of42rL4wbrffP4uvUf1SvS5Xs= github.com/pquerna/otp v1.3.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -545,14 +645,23 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/skeema/knownhosts v1.1.0 h1:Wvr9V0MxhjRbl3f9nMnKnFfiWTJmtECJ9Njkea3ysW0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= @@ -573,6 +682,7 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tmccombs/hcl2json v0.3.3 h1:+DLNYqpWE0CsOQiEZu+OZm5ZBImake3wtITYxQ8uLFQ= github.com/tmccombs/hcl2json v0.3.3/go.mod h1:Y2chtz2x9bAeRTvSibVRVgbLJhLJXKlUeIvjeVdnm4w= +github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= @@ -586,6 +696,7 @@ github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -593,12 +704,19 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= +github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty v1.8.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty v1.8.2/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0= github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= +github.com/zclconf/go-cty-yaml v1.0.2 h1:dNyg4QLTrv2IfJpm7Wtxi55ed5gLGOlPrZ6kMd51hY0= +github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= go.mongodb.org/atlas v0.12.0/go.mod h1:wVCnHcm/7/IfTjEB6K8K35PLG70yGz8BdkRwX0oK9/M= go.mongodb.org/atlas v0.31.0 h1:NgLqsNYm6wDYeDUO90etw1sl8T1U2DUKu36eUdnrFSI= go.mongodb.org/atlas v0.31.0/go.mod h1:L4BKwVx/OeEhOVjCSdgo90KJm4469iv7ZLzQms/EPTg= @@ -616,12 +734,16 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= @@ -665,6 +787,7 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -678,6 +801,7 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -699,6 +823,7 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -757,6 +882,7 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -768,6 +894,7 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -796,6 +923,7 @@ golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -893,6 +1021,7 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -931,6 +1060,7 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.34.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= @@ -1092,6 +1222,7 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= @@ -1137,6 +1268,7 @@ google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= @@ -1144,9 +1276,12 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go index 4866d26212..3958723ad1 100644 --- a/main.go +++ b/main.go @@ -1,11 +1,10 @@ package main import ( - "context" "flag" "log" - "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server" "github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas" ) @@ -15,17 +14,17 @@ func main() { flag.BoolVar(&debugMode, "debug", false, "set to true to run the provider with support for debuggers like delve") flag.Parse() - opts := &plugin.ServeOpts{Debug: debugMode, ProviderFunc: mongodbatlas.Provider} + var serveOpts []tf6server.ServeOpt if debugMode { - err := plugin.Debug(context.Background(), "registry.terraform.io/mongodb/mongodbatlas", opts) - - if err != nil { - log.Fatal(err.Error()) - } - - return + serveOpts = append(serveOpts, tf6server.WithManagedDebug()) + } + err := tf6server.Serve( + "registry.terraform.io/mongodb/mongodbatlas", + mongodbatlas.MuxedProviderFactory(), + serveOpts..., + ) + if err != nil { + log.Fatal(err) } - - plugin.Serve(opts) } diff --git a/mongodbatlas/config.go b/mongodbatlas/config.go index 1790754681..7a6d39a213 100644 --- a/mongodbatlas/config.go +++ b/mongodbatlas/config.go @@ -6,7 +6,6 @@ import ( "fmt" "net/http" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" "github.com/mongodb-forks/digest" "github.com/mongodb/terraform-provider-mongodbatlas/version" @@ -38,14 +37,14 @@ type MongoDBClient struct { } // NewClient func... -func (c *Config) NewClient(ctx context.Context) (interface{}, diag.Diagnostics) { +func (c *Config) NewClient(ctx context.Context) (interface{}, error) { // setup a transport to handle digest transport := digest.NewTransport(cast.ToString(c.PublicKey), cast.ToString(c.PrivateKey)) // initialize the client client, err := transport.Client() if err != nil { - return nil, diag.FromErr(err) + return nil, err } client.Transport = logging.NewTransport("MongoDB Atlas", transport) @@ -58,12 +57,12 @@ func (c *Config) NewClient(ctx context.Context) (interface{}, diag.Diagnostics) // Initialize the MongoDB Atlas API Client. atlasClient, err := matlasClient.New(client, optsAtlas...) if err != nil { - return nil, diag.FromErr(err) + return nil, err } sdkV2Client, err := c.newSDKV2Client(client) if err != nil { - return nil, diag.FromErr(err) + return nil, err } clients := &MongoDBClient{ diff --git a/mongodbatlas/data_source_mongodbatlas_accesslist_api_key_test.go b/mongodbatlas/data_source_mongodbatlas_accesslist_api_key_test.go index dc65ef2a85..6bc5f5539c 100644 --- a/mongodbatlas/data_source_mongodbatlas_accesslist_api_key_test.go +++ b/mongodbatlas/data_source_mongodbatlas_accesslist_api_key_test.go @@ -17,9 +17,9 @@ func TestAccConfigDSAccesslistAPIKey_basic(t *testing.T) { ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAccessListAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAccessListAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasAccesslistAPIKeyConfig(orgID, description, ipAddress), diff --git a/mongodbatlas/data_source_mongodbatlas_accesslist_api_keys_test.go b/mongodbatlas/data_source_mongodbatlas_accesslist_api_keys_test.go index de4d898597..ba2590c84b 100644 --- a/mongodbatlas/data_source_mongodbatlas_accesslist_api_keys_test.go +++ b/mongodbatlas/data_source_mongodbatlas_accesslist_api_keys_test.go @@ -17,9 +17,9 @@ func TestAccConfigDSAccesslistAPIKeys_basic(t *testing.T) { ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAccessListAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAccessListAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasAccesslistAPIKeysConfig(orgID, description, ipAddress), diff --git a/mongodbatlas/data_source_mongodbatlas_alert_configuration_test.go b/mongodbatlas/data_source_mongodbatlas_alert_configuration_test.go index d8ea8f4676..ad2c084086 100644 --- a/mongodbatlas/data_source_mongodbatlas_alert_configuration_test.go +++ b/mongodbatlas/data_source_mongodbatlas_alert_configuration_test.go @@ -19,9 +19,9 @@ func TestAccConfigDSAlertConfiguration_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasAlertConfiguration(orgID, projectName), @@ -43,9 +43,9 @@ func TestAccConfigDSAlertConfiguration_withThreshold(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasAlertConfigurationConfigWithThreshold(orgID, projectName, true, 1), @@ -68,9 +68,9 @@ func TestAccConfigDSAlertConfiguration_withPagerDuty(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasAlertConfigurationConfigWithPagerDuty(projectID, serviceKey, true), diff --git a/mongodbatlas/data_source_mongodbatlas_alert_configurations_test.go b/mongodbatlas/data_source_mongodbatlas_alert_configurations_test.go index 42b2b45486..07540f0f66 100644 --- a/mongodbatlas/data_source_mongodbatlas_alert_configurations_test.go +++ b/mongodbatlas/data_source_mongodbatlas_alert_configurations_test.go @@ -21,8 +21,8 @@ func TestAccConfigDSAlertConfigurations_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasAlertConfigurations(orgID, projectName), @@ -53,7 +53,7 @@ func testAccDSMongoDBAtlasAlertConfigurations(orgID, projectName string) string func testAccCheckMongoDBAtlasAlertConfigurationsCount(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/data_source_mongodbatlas_api_key_test.go b/mongodbatlas/data_source_mongodbatlas_api_key_test.go index 4164d0e672..ab427c5450 100644 --- a/mongodbatlas/data_source_mongodbatlas_api_key_test.go +++ b/mongodbatlas/data_source_mongodbatlas_api_key_test.go @@ -17,9 +17,9 @@ func TestAccConfigDSAPIKey_basic(t *testing.T) { roleName := "ORG_MEMBER" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasAPIKeyConfig(orgID, description, roleName), diff --git a/mongodbatlas/data_source_mongodbatlas_api_keys_test.go b/mongodbatlas/data_source_mongodbatlas_api_keys_test.go index bbd30a2456..3049b2f142 100644 --- a/mongodbatlas/data_source_mongodbatlas_api_keys_test.go +++ b/mongodbatlas/data_source_mongodbatlas_api_keys_test.go @@ -17,9 +17,9 @@ func TestAccConfigDSAPIKeys_basic(t *testing.T) { roleName := "ORG_MEMBER" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasAPIKeysConfig(orgID, description, roleName), diff --git a/mongodbatlas/data_source_mongodbatlas_auditing_test.go b/mongodbatlas/data_source_mongodbatlas_auditing_test.go index d6642b6fe4..d7dd932d18 100644 --- a/mongodbatlas/data_source_mongodbatlas_auditing_test.go +++ b/mongodbatlas/data_source_mongodbatlas_auditing_test.go @@ -20,8 +20,8 @@ func TestAccAdvDSAuditing_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceAuditingConfig(projectID, auditFilter, auditAuth, enabled), diff --git a/mongodbatlas/data_source_mongodbatlas_backup_compliance_policy_test.go b/mongodbatlas/data_source_mongodbatlas_backup_compliance_policy_test.go index feae3408fe..a810b299e1 100644 --- a/mongodbatlas/data_source_mongodbatlas_backup_compliance_policy_test.go +++ b/mongodbatlas/data_source_mongodbatlas_backup_compliance_policy_test.go @@ -15,8 +15,8 @@ func TestAccGenericBackupDSBackupCompliancePolicy_basic(t *testing.T) { projectOwnerID := os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceBackupCompliancePolicyConfig(projectName, orgID, projectOwnerID), diff --git a/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_bucket_test.go b/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_bucket_test.go index 5a4ab9aaaf..a693149c70 100644 --- a/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_bucket_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_bucket_test.go @@ -19,8 +19,8 @@ func TestAccBackupDSCloudBackupSnapshotExportBucket_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceCloudBackupSnapshotExportBucketConfig(projectID, iamRoleID, bucketName), diff --git a/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_buckets_test.go b/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_buckets_test.go index 88d29c1121..af60948768 100644 --- a/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_buckets_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_buckets_test.go @@ -18,8 +18,8 @@ func TestAccBackupDSCloudBackupSnapshotExportBuckets_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceCloudBackupSnapshotExportBucketsConfig(projectID, bucketName, iamRoleID), diff --git a/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_job_test.go b/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_job_test.go index 0e962aaf7a..63f88a2a68 100644 --- a/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_job_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_job_test.go @@ -19,8 +19,8 @@ func TestAccBackupDSCloudBackupSnapshotExportJob_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceCloudBackupSnapshotExportJobConfig(projectID, iamRoleID, bucketName), diff --git a/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_jobs_test.go b/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_jobs_test.go index cf4b0943ea..8594e66b21 100644 --- a/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_jobs_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cloud_backup_snapshot_export_jobs_test.go @@ -18,8 +18,8 @@ func TestAccBackupDSCloudBackupSnapshotExportJobs_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceCloudBackupSnapshotExportJobsConfig(projectID, bucketName, iamRoleID), diff --git a/mongodbatlas/data_source_mongodbatlas_cloud_provider_access_setup_test.go b/mongodbatlas/data_source_mongodbatlas_cloud_provider_access_setup_test.go index a4a9a88918..9abff7810b 100644 --- a/mongodbatlas/data_source_mongodbatlas_cloud_provider_access_setup_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cloud_provider_access_setup_test.go @@ -46,8 +46,8 @@ func TestAccConfigDSCloudProviderAccessSetup_aws_basic(t *testing.T) { config := fmt.Sprintf(dataSourceCPASProviderConfig, name, orgID, projectName, "AWS", dataSCName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: config, diff --git a/mongodbatlas/data_source_mongodbatlas_cloud_provider_access_test.go b/mongodbatlas/data_source_mongodbatlas_cloud_provider_access_test.go index ae582ceb85..c7e6c1b4e5 100644 --- a/mongodbatlas/data_source_mongodbatlas_cloud_provider_access_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cloud_provider_access_test.go @@ -40,8 +40,8 @@ func TestAccConfigDSCloudProviderAccess_basic(t *testing.T) { config := fmt.Sprintf(dataSourceProviderConfig, name, orgID, projectName, "AWS", dataSCName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: config, diff --git a/mongodbatlas/data_source_mongodbatlas_cluster_outage_simulation_test.go b/mongodbatlas/data_source_mongodbatlas_cluster_outage_simulation_test.go index 1cd121ba11..018fd4c303 100644 --- a/mongodbatlas/data_source_mongodbatlas_cluster_outage_simulation_test.go +++ b/mongodbatlas/data_source_mongodbatlas_cluster_outage_simulation_test.go @@ -19,9 +19,9 @@ func TestAccOutageSimulationClusterDS_SingleRegion_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterOutageSimulationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterOutageSimulationDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasClusterOutageSimulationConfigDSSingleRegion(projectName, orgID, clusterName), @@ -48,9 +48,9 @@ func TestAccOutageSimulationClusterDS_MultiRegion_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterOutageSimulationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterOutageSimulationDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasClusterOutageSimulationConfigDSMultiRegion(projectName, orgID, clusterName), diff --git a/mongodbatlas/data_source_mongodbatlas_custom_db_role_test.go b/mongodbatlas/data_source_mongodbatlas_custom_db_role_test.go index c4201955ca..2c9f75d765 100644 --- a/mongodbatlas/data_source_mongodbatlas_custom_db_role_test.go +++ b/mongodbatlas/data_source_mongodbatlas_custom_db_role_test.go @@ -17,9 +17,9 @@ func TestAccConfigDSCustomDBRole_basic(t *testing.T) { roleName := fmt.Sprintf("test-acc-custom_role-%s", acctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasCustomDBRoleConfig(orgID, projectName, roleName, "INSERT", fmt.Sprintf("test-acc-db_name-%s", acctest.RandString(5))), diff --git a/mongodbatlas/data_source_mongodbatlas_custom_db_roles_test.go b/mongodbatlas/data_source_mongodbatlas_custom_db_roles_test.go index 0a5d0cea72..9356882954 100644 --- a/mongodbatlas/data_source_mongodbatlas_custom_db_roles_test.go +++ b/mongodbatlas/data_source_mongodbatlas_custom_db_roles_test.go @@ -17,9 +17,9 @@ func TestAccConfigDSCustomDBRoles_basic(t *testing.T) { roleName := fmt.Sprintf("test-acc-custom_role-%s", acctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasCustomDBRolesConfig(orgID, projectName, roleName, "INSERT", fmt.Sprintf("test-acc-db_name-%s", acctest.RandString(5))), diff --git a/mongodbatlas/data_source_mongodbatlas_custom_dns_configuration_cluster_aws_test.go b/mongodbatlas/data_source_mongodbatlas_custom_dns_configuration_cluster_aws_test.go index 62d5d2c601..d097b3e296 100644 --- a/mongodbatlas/data_source_mongodbatlas_custom_dns_configuration_cluster_aws_test.go +++ b/mongodbatlas/data_source_mongodbatlas_custom_dns_configuration_cluster_aws_test.go @@ -15,8 +15,8 @@ func TestAccConfigDSCustomDNSConfigurationAWS_basic(t *testing.T) { projectName := acctest.RandomWithPrefix("test-acc") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCustomDNSConfigurationAWSDataSourceConfig(orgID, projectName, true), diff --git a/mongodbatlas/data_source_mongodbatlas_data_lake_pipeline_run_test.go b/mongodbatlas/data_source_mongodbatlas_data_lake_pipeline_run_test.go index 028c4066c9..52354989ea 100644 --- a/mongodbatlas/data_source_mongodbatlas_data_lake_pipeline_run_test.go +++ b/mongodbatlas/data_source_mongodbatlas_data_lake_pipeline_run_test.go @@ -18,8 +18,8 @@ func TestAccBackupDSDataLakePipelineRun_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataLakeDataSourcePipelineRunConfig(projectID, pipelineName, runID), diff --git a/mongodbatlas/data_source_mongodbatlas_data_lake_pipeline_runs_test.go b/mongodbatlas/data_source_mongodbatlas_data_lake_pipeline_runs_test.go index b8a1eafc7b..7c12c3eb3d 100644 --- a/mongodbatlas/data_source_mongodbatlas_data_lake_pipeline_runs_test.go +++ b/mongodbatlas/data_source_mongodbatlas_data_lake_pipeline_runs_test.go @@ -17,8 +17,8 @@ func TestAccBackupDSDataLakePipelineRuns_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataLakeDataSourcePipelineRunsConfig(projectID, pipelineName), diff --git a/mongodbatlas/data_source_mongodbatlas_data_lake_pipeline_test.go b/mongodbatlas/data_source_mongodbatlas_data_lake_pipeline_test.go index cb65a89116..087a733825 100644 --- a/mongodbatlas/data_source_mongodbatlas_data_lake_pipeline_test.go +++ b/mongodbatlas/data_source_mongodbatlas_data_lake_pipeline_test.go @@ -19,9 +19,9 @@ func TestAccDataSourceClusterRSDataLakePipeline_basic(t *testing.T) { name = acctest.RandomWithPrefix("test-acc-index") ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDataLakeDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDataLakeDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasDataLakePipelineConfig(projectID, clusterName, name), diff --git a/mongodbatlas/data_source_mongodbatlas_data_lake_pipelines_test.go b/mongodbatlas/data_source_mongodbatlas_data_lake_pipelines_test.go index a9a0ab12d0..7a5e12ec4b 100644 --- a/mongodbatlas/data_source_mongodbatlas_data_lake_pipelines_test.go +++ b/mongodbatlas/data_source_mongodbatlas_data_lake_pipelines_test.go @@ -22,9 +22,9 @@ func TestAccDataSourceClusterRSDataLakePipelines_basic(t *testing.T) { secondPipelineName = acctest.RandomWithPrefix("test-acc-index") ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDataLakeDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDataLakeDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasDataLakePipelinesConfig(projectID, firstClusterName, secondClusterName, firstPipelineName, secondPipelineName), diff --git a/mongodbatlas/data_source_mongodbatlas_data_lake_test.go b/mongodbatlas/data_source_mongodbatlas_data_lake_test.go index 7ada0c72bc..c81e128e1d 100644 --- a/mongodbatlas/data_source_mongodbatlas_data_lake_test.go +++ b/mongodbatlas/data_source_mongodbatlas_data_lake_test.go @@ -24,8 +24,8 @@ func TestAccBackupDSDataLake_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataLakeDataSourceConfig(policyName, roleName, projectName, orgID, name, testS3Bucket), diff --git a/mongodbatlas/data_source_mongodbatlas_data_lakes_test.go b/mongodbatlas/data_source_mongodbatlas_data_lakes_test.go index e68f0d956d..4618cb15f9 100644 --- a/mongodbatlas/data_source_mongodbatlas_data_lakes_test.go +++ b/mongodbatlas/data_source_mongodbatlas_data_lakes_test.go @@ -15,8 +15,8 @@ func TestAccGenericBackupDSDataLakes_basic(t *testing.T) { projectName := acctest.RandomWithPrefix("test-acc") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataLakesDataSourceConfig(orgID, projectName), diff --git a/mongodbatlas/data_source_mongodbatlas_database_user_test.go b/mongodbatlas/data_source_mongodbatlas_database_user_test.go index bff2a5df61..c640b10a63 100644 --- a/mongodbatlas/data_source_mongodbatlas_database_user_test.go +++ b/mongodbatlas/data_source_mongodbatlas_database_user_test.go @@ -20,8 +20,8 @@ func TestAccConfigDSDatabaseUser_basic(t *testing.T) { username := fmt.Sprintf("test-acc-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserDataSourceConfig(orgID, projectName, roleName, username), diff --git a/mongodbatlas/data_source_mongodbatlas_database_users_test.go b/mongodbatlas/data_source_mongodbatlas_database_users_test.go index c3dd371677..56049fadb7 100644 --- a/mongodbatlas/data_source_mongodbatlas_database_users_test.go +++ b/mongodbatlas/data_source_mongodbatlas_database_users_test.go @@ -18,8 +18,8 @@ func TestAccConfigDSDatabaseUsers_basic(t *testing.T) { roleName := "atlasAdmin" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUsersDataSourceConfig(orgID, projectName, roleName, username), diff --git a/mongodbatlas/data_source_mongodbatlas_event_trigger_test.go b/mongodbatlas/data_source_mongodbatlas_event_trigger_test.go index 751a4edf15..534d569ae1 100644 --- a/mongodbatlas/data_source_mongodbatlas_event_trigger_test.go +++ b/mongodbatlas/data_source_mongodbatlas_event_trigger_test.go @@ -36,9 +36,9 @@ func TestAccConfigDSEventTrigger_basic(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceEventTriggerConfig(projectID, appID, `"INSERT", "UPDATE"`, &event), diff --git a/mongodbatlas/data_source_mongodbatlas_event_triggers_test.go b/mongodbatlas/data_source_mongodbatlas_event_triggers_test.go index 92d739c465..efe1541190 100644 --- a/mongodbatlas/data_source_mongodbatlas_event_triggers_test.go +++ b/mongodbatlas/data_source_mongodbatlas_event_triggers_test.go @@ -38,8 +38,8 @@ func TestAccConfigDSEventTriggers_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasEventTriggersDataSourceConfig(projectID, appID, `"INSERT", "UPDATE"`, &event), diff --git a/mongodbatlas/data_source_mongodbatlas_federated_database_instance_test.go b/mongodbatlas/data_source_mongodbatlas_federated_database_instance_test.go index 839cc371b9..cc8593796a 100644 --- a/mongodbatlas/data_source_mongodbatlas_federated_database_instance_test.go +++ b/mongodbatlas/data_source_mongodbatlas_federated_database_instance_test.go @@ -34,8 +34,8 @@ func TestAccDataSourceFederatedDatabaseInstance_basic(t *testing.T) { Source: "hashicorp/aws", }, }, - ProviderFactories: testAccProviderFactories, - Config: testAccMongoDBAtlasFederatedDatabaseInstanceConfigDataSourceFirstSteps(name, projectName, orgID), + ProtoV6ProviderFactories: testAccProviderV6Factories, + Config: testAccMongoDBAtlasFederatedDatabaseInstanceConfigDataSourceFirstSteps(name, projectName, orgID), Check: resource.ComposeTestCheckFunc( testAccCheckMongoDBAtlasFederatedDatabaseDataSourceInstanceExists(resourceName, &federatedInstance), testAccCheckMongoDBAtlasFederatedDabaseInstanceAttributes(&federatedInstance, name), @@ -72,8 +72,8 @@ func TestAccDataSourceFederatedDatabaseInstance_S3Bucket(t *testing.T) { Source: "hashicorp/aws", }, }, - ProviderFactories: testAccProviderFactories, - Config: testAccMongoDBAtlasFederatedDatabaseInstanceDataSourceConfigS3Bucket(policyName, roleName, projectName, orgID, name, testS3Bucket, region), + ProtoV6ProviderFactories: testAccProviderV6Factories, + Config: testAccMongoDBAtlasFederatedDatabaseInstanceDataSourceConfigS3Bucket(policyName, roleName, projectName, orgID, name, testS3Bucket, region), Check: resource.ComposeTestCheckFunc( testAccCheckMongoDBAtlasFederatedDatabaseDataSourceInstanceExists(resourceName, &federatedInstance), testAccCheckMongoDBAtlasFederatedDabaseInstanceAttributes(&federatedInstance, name), @@ -87,7 +87,7 @@ func TestAccDataSourceFederatedDatabaseInstance_S3Bucket(t *testing.T) { func testAccCheckMongoDBAtlasFederatedDatabaseDataSourceInstanceExists(resourceName string, dataFederatedInstance *matlas.DataFederationInstance) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/data_source_mongodbatlas_federated_database_instances_test.go b/mongodbatlas/data_source_mongodbatlas_federated_database_instances_test.go index c62282d028..ad08365061 100644 --- a/mongodbatlas/data_source_mongodbatlas_federated_database_instances_test.go +++ b/mongodbatlas/data_source_mongodbatlas_federated_database_instances_test.go @@ -34,8 +34,8 @@ func TestAccDataSourceFederatedDatabaseInstances_basic(t *testing.T) { Source: "hashicorp/aws", }, }, - ProviderFactories: testAccProviderFactories, - Config: testAccMongoDBAtlasFederatedDatabaseInstancesDataSourceConfig(policyName, roleName, projectName, orgID, firstName, secondName, testS3Bucket, region), + ProtoV6ProviderFactories: testAccProviderV6Factories, + Config: testAccMongoDBAtlasFederatedDatabaseInstancesDataSourceConfig(policyName, roleName, projectName, orgID, firstName, secondName, testS3Bucket, region), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttrSet(resourceName, "results.#"), diff --git a/mongodbatlas/data_source_mongodbatlas_federated_query_limit_test.go b/mongodbatlas/data_source_mongodbatlas_federated_query_limit_test.go index 17d8c990de..2fdfad797a 100644 --- a/mongodbatlas/data_source_mongodbatlas_federated_query_limit_test.go +++ b/mongodbatlas/data_source_mongodbatlas_federated_query_limit_test.go @@ -40,8 +40,8 @@ func TestAccDataSourceFederatedDatabaseQueryLimit_basic(t *testing.T) { Source: "hashicorp/aws", }, }, - ProviderFactories: testAccProviderFactories, - Config: testAccMongoDBAtlasFederatedDatabaseQueryLimitDataSourceConfig(policyName, roleName, projectName, orgID, tenantName, testS3Bucket, region), + ProtoV6ProviderFactories: testAccProviderV6Factories, + Config: testAccMongoDBAtlasFederatedDatabaseQueryLimitDataSourceConfig(policyName, roleName, projectName, orgID, tenantName, testS3Bucket, region), Check: resource.ComposeTestCheckFunc( testAccCheckMongoDBAtlasFederatedDatabaseDataSourceQueryLimitExists(resourceName, &queryLimit), testAccCheckMongoDBAtlasFederatedDabaseQueryLimitAttributes(&queryLimit, limitName), @@ -200,7 +200,7 @@ resource "mongodbatlas_federated_query_limit" "test" { func testAccCheckMongoDBAtlasFederatedDatabaseDataSourceQueryLimitExists(resourceName string, queryLimit *matlas.DataFederationQueryLimit) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/data_source_mongodbatlas_federated_query_limits_test.go b/mongodbatlas/data_source_mongodbatlas_federated_query_limits_test.go index be38b991f7..6b34082993 100644 --- a/mongodbatlas/data_source_mongodbatlas_federated_query_limits_test.go +++ b/mongodbatlas/data_source_mongodbatlas_federated_query_limits_test.go @@ -33,8 +33,8 @@ func TestAccDataSourceFederatedDatabaseQueryLimits_basic(t *testing.T) { Source: "hashicorp/aws", }, }, - ProviderFactories: testAccProviderFactories, - Config: testAccMongoDBAtlasFederatedDatabaseQueryLimitsDataSourceConfig(policyName, roleName, projectName, orgID, tenantName, testS3Bucket, region), + ProtoV6ProviderFactories: testAccProviderV6Factories, + Config: testAccMongoDBAtlasFederatedDatabaseQueryLimitsDataSourceConfig(policyName, roleName, projectName, orgID, tenantName, testS3Bucket, region), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttrSet(resourceName, "tenant_name"), diff --git a/mongodbatlas/data_source_mongodbatlas_federated_settings_connected_organization_test.go b/mongodbatlas/data_source_mongodbatlas_federated_settings_connected_organization_test.go index f5737dc71b..e18f21e251 100644 --- a/mongodbatlas/data_source_mongodbatlas_federated_settings_connected_organization_test.go +++ b/mongodbatlas/data_source_mongodbatlas_federated_settings_connected_organization_test.go @@ -19,8 +19,8 @@ func TestAccFedDSFederatedSettingsOrganizationConfig_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceFederatedSettingsOrganizationConfigConfig(federatedSettingsID, orgID), @@ -49,7 +49,7 @@ func testAccMongoDBAtlasDataSourceFederatedSettingsOrganizationConfigConfig(fede func testAccCheckMongoDBAtlasFederatedSettingsOrganizationConfigExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/data_source_mongodbatlas_federated_settings_connected_organizations_test.go b/mongodbatlas/data_source_mongodbatlas_federated_settings_connected_organizations_test.go index 6810d1c43b..03162a1d71 100644 --- a/mongodbatlas/data_source_mongodbatlas_federated_settings_connected_organizations_test.go +++ b/mongodbatlas/data_source_mongodbatlas_federated_settings_connected_organizations_test.go @@ -18,8 +18,8 @@ func TestAccFedDSFederatedSettingsOrganizationConfigs_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceFederatedSettingsOrganizationConfigsConfig(federatedSettingsID), @@ -48,7 +48,7 @@ func testAccMongoDBAtlasDataSourceFederatedSettingsOrganizationConfigsConfig(fed func testAccCheckMongoDBAtlasFederatedSettingsOrganizationConfigsExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/data_source_mongodbatlas_federated_settings_identity_provider_test.go b/mongodbatlas/data_source_mongodbatlas_federated_settings_identity_provider_test.go index 6a969d57b1..ed0ff86e03 100644 --- a/mongodbatlas/data_source_mongodbatlas_federated_settings_identity_provider_test.go +++ b/mongodbatlas/data_source_mongodbatlas_federated_settings_identity_provider_test.go @@ -16,8 +16,8 @@ func TestAccFedDSFederatedSettingsIdentityProvider_basic(t *testing.T) { idpID = os.Getenv("MONGODB_ATLAS_FEDERATED_IDP_ID") ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceFederatedSettingsIdentityProviderConfig(federatedSettingsID, idpID), diff --git a/mongodbatlas/data_source_mongodbatlas_federated_settings_identity_providers_test.go b/mongodbatlas/data_source_mongodbatlas_federated_settings_identity_providers_test.go index f0d58ed472..a38a64f69a 100644 --- a/mongodbatlas/data_source_mongodbatlas_federated_settings_identity_providers_test.go +++ b/mongodbatlas/data_source_mongodbatlas_federated_settings_identity_providers_test.go @@ -18,8 +18,8 @@ func TestAccFedDSFederatedSettingsIdentityProviders_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceFederatedSettingsIdentityProvidersConfig(federatedSettingsID), @@ -48,7 +48,7 @@ func testAccMongoDBAtlasDataSourceFederatedSettingsIdentityProvidersConfig(feder func testAccCheckMongoDBAtlasFederatedSettingsIdentityProvidersExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/data_source_mongodbatlas_federated_settings_organization_role_mapping_test.go b/mongodbatlas/data_source_mongodbatlas_federated_settings_organization_role_mapping_test.go index e4b49f668e..ee2e68b9c9 100644 --- a/mongodbatlas/data_source_mongodbatlas_federated_settings_organization_role_mapping_test.go +++ b/mongodbatlas/data_source_mongodbatlas_federated_settings_organization_role_mapping_test.go @@ -20,8 +20,8 @@ func TestAccFedDSFederatedSettingsOrganizationRoleMapping_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceFederatedSettingsOrganizationRoleMappingConfig(federatedSettingsID, orgID, roleMappingID), diff --git a/mongodbatlas/data_source_mongodbatlas_federated_settings_organization_role_mappings_test.go b/mongodbatlas/data_source_mongodbatlas_federated_settings_organization_role_mappings_test.go index f249352cc3..3b14f6ab3f 100644 --- a/mongodbatlas/data_source_mongodbatlas_federated_settings_organization_role_mappings_test.go +++ b/mongodbatlas/data_source_mongodbatlas_federated_settings_organization_role_mappings_test.go @@ -19,8 +19,8 @@ func TestAccFedDSFederatedSettingsOrganizationRoleMappings_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceFederatedSettingsOrganizationRoleMappingsConfig(federatedSettingsID, orgID), @@ -49,7 +49,7 @@ func testAccMongoDBAtlasDataSourceFederatedSettingsOrganizationRoleMappingsConfi func testAccCheckMongoDBAtlasFederatedSettingsOrganizationRoleMappingsExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/data_source_mongodbatlas_federated_settings_test.go b/mongodbatlas/data_source_mongodbatlas_federated_settings_test.go index 0760cdf072..19ca71b5b8 100644 --- a/mongodbatlas/data_source_mongodbatlas_federated_settings_test.go +++ b/mongodbatlas/data_source_mongodbatlas_federated_settings_test.go @@ -20,8 +20,8 @@ func TestAccFedDSFederatedSettings_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceFederatedSettingsConfig(orgID), @@ -48,7 +48,7 @@ func testAccMongoDBAtlasDataSourceFederatedSettingsConfig(orgID string) string { func testAccCheckMongoDBAtlasFederatedSettingsExists(resourceName string, federatedSettings *matlas.FederatedSettings) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/data_source_mongodbatlas_global_cluster_config_test.go b/mongodbatlas/data_source_mongodbatlas_global_cluster_config_test.go index e0a4be59e1..8679175a57 100644 --- a/mongodbatlas/data_source_mongodbatlas_global_cluster_config_test.go +++ b/mongodbatlas/data_source_mongodbatlas_global_cluster_config_test.go @@ -17,9 +17,9 @@ func TestAccClusterDSGlobalCluster_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasGlobalClusterDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasGlobalClusterDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasGlobalClusterConfig(projectID, name), diff --git a/mongodbatlas/data_source_mongodbatlas_ldap_configuration_test.go b/mongodbatlas/data_source_mongodbatlas_ldap_configuration_test.go index 734e3703fc..16449bdb0d 100644 --- a/mongodbatlas/data_source_mongodbatlas_ldap_configuration_test.go +++ b/mongodbatlas/data_source_mongodbatlas_ldap_configuration_test.go @@ -26,9 +26,9 @@ func TestAccAdvDSLDAPConfiguration_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasLDAPConfigurationDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasLDAPConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceLDAPConfigurationConfig(projectName, orgID, hostname, username, password, authEnabled, cast.ToInt(port)), diff --git a/mongodbatlas/data_source_mongodbatlas_ldap_verify_test.go b/mongodbatlas/data_source_mongodbatlas_ldap_verify_test.go index 54728a8a5b..fb2758a794 100644 --- a/mongodbatlas/data_source_mongodbatlas_ldap_verify_test.go +++ b/mongodbatlas/data_source_mongodbatlas_ldap_verify_test.go @@ -26,9 +26,9 @@ func TestAccAdvDSLDAPVerify_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasLDAPConfigurationDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasLDAPConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceLDAPVerifyConfig(projectName, orgID, clusterName, hostname, username, password, cast.ToInt(port)), diff --git a/mongodbatlas/data_source_mongodbatlas_maintenance_window_test.go b/mongodbatlas/data_source_mongodbatlas_maintenance_window_test.go index bf4e456432..fa52ac7767 100644 --- a/mongodbatlas/data_source_mongodbatlas_maintenance_window_test.go +++ b/mongodbatlas/data_source_mongodbatlas_maintenance_window_test.go @@ -19,8 +19,8 @@ func TestAccConfigDSMaintenanceWindow_basic(t *testing.T) { hourOfDay := 3 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataSourceMaintenanceWindowConfig(orgID, projectName, dayOfWeek, hourOfDay), diff --git a/mongodbatlas/data_source_mongodbatlas_network_peering_test.go b/mongodbatlas/data_source_mongodbatlas_network_peering_test.go index 3e50c56d62..3a32bd25b6 100644 --- a/mongodbatlas/data_source_mongodbatlas_network_peering_test.go +++ b/mongodbatlas/data_source_mongodbatlas_network_peering_test.go @@ -22,9 +22,9 @@ func TestAccNetworkDSNetworkPeering_basic(t *testing.T) { awsRegion := os.Getenv("AWS_REGION") resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvAWS(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvAWS(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasNetworkPeeringConfig(projectID, vpcID, awsAccountID, vpcCIDRBlock, awsRegion), diff --git a/mongodbatlas/data_source_mongodbatlas_network_peerings_test.go b/mongodbatlas/data_source_mongodbatlas_network_peerings_test.go index dc8fa74b4b..aa59b2eea3 100644 --- a/mongodbatlas/data_source_mongodbatlas_network_peerings_test.go +++ b/mongodbatlas/data_source_mongodbatlas_network_peerings_test.go @@ -22,9 +22,9 @@ func TestAccNetworkDSNetworkPeerings_basic(t *testing.T) { awsRegion := os.Getenv("AWS_REGION") resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvAWS(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvAWS(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasNetworkPeeringsConfig(projectID, vpcID, awsAccountID, vpcCIDRBlock, awsRegion), diff --git a/mongodbatlas/data_source_mongodbatlas_org_id_test.go b/mongodbatlas/data_source_mongodbatlas_org_id_test.go index 749b2da707..b7ee3ab2b5 100644 --- a/mongodbatlas/data_source_mongodbatlas_org_id_test.go +++ b/mongodbatlas/data_source_mongodbatlas_org_id_test.go @@ -18,9 +18,9 @@ func TestAccConfigDSOrgID_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasOrgInvitationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasOrgInvitationDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasOrgIDConfig(orgID, name, initialRole), diff --git a/mongodbatlas/data_source_mongodbatlas_org_invitation_test.go b/mongodbatlas/data_source_mongodbatlas_org_invitation_test.go index 45bfff3c50..3a5f03dbf2 100644 --- a/mongodbatlas/data_source_mongodbatlas_org_invitation_test.go +++ b/mongodbatlas/data_source_mongodbatlas_org_invitation_test.go @@ -19,9 +19,9 @@ func TestAccConfigDSOrgInvitation_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasOrgInvitationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasOrgInvitationDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasOrgInvitationConfig(orgID, name, initialRole), diff --git a/mongodbatlas/data_source_mongodbatlas_organization_test.go b/mongodbatlas/data_source_mongodbatlas_organization_test.go index 823479b6f4..d5b046d5f2 100644 --- a/mongodbatlas/data_source_mongodbatlas_organization_test.go +++ b/mongodbatlas/data_source_mongodbatlas_organization_test.go @@ -13,7 +13,7 @@ func TestAccConfigDSOrganization_basic(t *testing.T) { orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") ) resource.ParallelTest(t, resource.TestCase{ - ProviderFactories: testAccProviderFactories, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasOrganizationConfigWithDS(orgID), diff --git a/mongodbatlas/data_source_mongodbatlas_organizations_test.go b/mongodbatlas/data_source_mongodbatlas_organizations_test.go index 8c857804f0..524034d7a0 100644 --- a/mongodbatlas/data_source_mongodbatlas_organizations_test.go +++ b/mongodbatlas/data_source_mongodbatlas_organizations_test.go @@ -12,7 +12,7 @@ func TestAccConfigDSOrganizations_basic(t *testing.T) { datasourceName = "data.mongodbatlas_organizations.test" ) resource.ParallelTest(t, resource.TestCase{ - ProviderFactories: testAccProviderFactories, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasOrganizationsConfigWithDS(true), @@ -31,7 +31,7 @@ func TestAccConfigDSOrganizations_withPagination(t *testing.T) { datasourceName = "data.mongodbatlas_organizations.test" ) resource.ParallelTest(t, resource.TestCase{ - ProviderFactories: testAccProviderFactories, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasOrganizationsConfigWithPagination(2, 5), diff --git a/mongodbatlas/data_source_mongodbatlas_private_endpoint_regional_mode_test.go b/mongodbatlas/data_source_mongodbatlas_private_endpoint_regional_mode_test.go index fec5b3ff67..753f34a265 100644 --- a/mongodbatlas/data_source_mongodbatlas_private_endpoint_regional_mode_test.go +++ b/mongodbatlas/data_source_mongodbatlas_private_endpoint_regional_mode_test.go @@ -16,8 +16,8 @@ func TestAccNetworkDSPrivateEndpointRegionalMode_basic(t *testing.T) { projectID := os.Getenv("MONGODB_ATLAS_PROJECT_ID") resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateEndpointRegionalModeDataSourceConfig(projectID), @@ -32,7 +32,7 @@ func TestAccNetworkDSPrivateEndpointRegionalMode_basic(t *testing.T) { func testAccMongoDBAtlasPrivateEndpointRegionalModeUnmanagedResource(resourceName, projectID string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas setting, _, err := conn.PrivateEndpoints.GetRegionalizedPrivateEndpointSetting(context.Background(), projectID) diff --git a/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_adl_test.go b/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_adl_test.go index 0249b9249b..03b028e752 100644 --- a/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_adl_test.go +++ b/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_adl_test.go @@ -14,8 +14,8 @@ func TestAccNetworkDSPrivateLinkEndpointServiceADL_basic(t *testing.T) { endpointID := "vpce-jjg5e24qp93513h03" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointADLDataSourceConfig(projectID, endpointID), diff --git a/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_data_federation_online_archive_test.go b/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_data_federation_online_archive_test.go index aaa2905e00..b0b4361082 100644 --- a/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_data_federation_online_archive_test.go +++ b/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_data_federation_online_archive_test.go @@ -14,9 +14,9 @@ var ( func TestAccDataSourceMongoDBAtlasPrivatelinkEndpointServiceDataFederationOnlineArchive_basic(t *testing.T) { testCheckPrivateEndpointServiceDataFederationOnlineArchiveRun(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateEndpointServiceDataFederationOnlineArchiveDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateEndpointServiceDataFederationOnlineArchiveDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasPrivateEndpointServiceDataFederationOnlineArchiveConfig(projectID, endpointID), diff --git a/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_data_federation_online_archives_test.go b/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_data_federation_online_archives_test.go index 1264f86bb6..c91d8ec547 100644 --- a/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_data_federation_online_archives_test.go +++ b/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_data_federation_online_archives_test.go @@ -14,9 +14,9 @@ var ( func TestAccDataSourceMongoDBAtlasPrivatelinkEndpointServiceDataFederationOnlineArchives_basic(t *testing.T) { testCheckPrivateEndpointServiceDataFederationOnlineArchiveRun(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateEndpointServiceDataFederationOnlineArchiveDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateEndpointServiceDataFederationOnlineArchiveDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasPrivateEndpointServiceDataFederationOnlineArchivesConfig(projectID, endpointID), diff --git a/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_test.go b/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_test.go index 8c45a65ae3..065510bb22 100644 --- a/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_test.go +++ b/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_service_test.go @@ -24,8 +24,8 @@ func TestAccNetworkDSPrivateLinkEndpointServiceAWS_basic(t *testing.T) { securityGroupID := os.Getenv("AWS_SECURITY_GROUP_ID") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckAwsEnv(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t); testCheckAwsEnv(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointServiceDataSourceConfig( diff --git a/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_test.go b/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_test.go index 98975eb9eb..0ad285cae5 100644 --- a/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_test.go +++ b/mongodbatlas/data_source_mongodbatlas_privatelink_endpoint_test.go @@ -16,8 +16,8 @@ func TestAccNetworkDSPrivateLinkEndpoint_basic(t *testing.T) { providerName := "AWS" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointDataSourceConfig(projectID, providerName, region), diff --git a/mongodbatlas/data_source_mongodbatlas_privatelink_endpoints_service_adl_test.go b/mongodbatlas/data_source_mongodbatlas_privatelink_endpoints_service_adl_test.go index 8ccc0ef1af..bf4fb5cb9d 100644 --- a/mongodbatlas/data_source_mongodbatlas_privatelink_endpoints_service_adl_test.go +++ b/mongodbatlas/data_source_mongodbatlas_privatelink_endpoints_service_adl_test.go @@ -14,8 +14,8 @@ func TestAccNetworkDSPrivateLinkEndpointsServiceADL_basic(t *testing.T) { endpointID := "vpce-jjg5e24qp93513h03" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointsADLDataSourceConfig(projectID, endpointID), diff --git a/mongodbatlas/data_source_mongodbatlas_project_api_key_test.go b/mongodbatlas/data_source_mongodbatlas_project_api_key_test.go index ccea7d01ab..6dafe20f53 100644 --- a/mongodbatlas/data_source_mongodbatlas_project_api_key_test.go +++ b/mongodbatlas/data_source_mongodbatlas_project_api_key_test.go @@ -18,9 +18,9 @@ func TestAccConfigDSProjectAPIKey_basic(t *testing.T) { roleName := "GROUP_OWNER" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasProjectAPIKeyConfig(orgID, projectName, description, roleName), diff --git a/mongodbatlas/data_source_mongodbatlas_project_api_keys_test.go b/mongodbatlas/data_source_mongodbatlas_project_api_keys_test.go index 9778cb8eec..28fb621aac 100644 --- a/mongodbatlas/data_source_mongodbatlas_project_api_keys_test.go +++ b/mongodbatlas/data_source_mongodbatlas_project_api_keys_test.go @@ -18,9 +18,9 @@ func TestAccConfigDSProjectAPIKeys_basic(t *testing.T) { roleName := "GROUP_OWNER" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccDSMongoDBAtlasProjectAPIKeysConfig(orgID, projectName, description, roleName), diff --git a/mongodbatlas/data_source_mongodbatlas_project_invitation_test.go b/mongodbatlas/data_source_mongodbatlas_project_invitation_test.go index 28ff26b67a..c307f50add 100644 --- a/mongodbatlas/data_source_mongodbatlas_project_invitation_test.go +++ b/mongodbatlas/data_source_mongodbatlas_project_invitation_test.go @@ -20,9 +20,9 @@ func TestAccProjectDSProjectInvitation_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectInvitationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectInvitationDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasProjectInvitationConfig(orgID, projectName, name, initialRole), diff --git a/mongodbatlas/data_source_mongodbatlas_project_ip_access_list_test.go b/mongodbatlas/data_source_mongodbatlas_project_ip_access_list_test.go index 63c89e3f67..d75974ecdb 100644 --- a/mongodbatlas/data_source_mongodbatlas_project_ip_access_list_test.go +++ b/mongodbatlas/data_source_mongodbatlas_project_ip_access_list_test.go @@ -17,8 +17,8 @@ func TestAccProjectDSProjectIPAccessList_SettingIPAddress(t *testing.T) { comment := fmt.Sprintf("TestAcc for ipAddress (%s)", ipAddress) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccDataMongoDBAtlasProjectIPAccessListConfigSettingIPAddress(orgID, projectName, ipAddress, comment), @@ -42,8 +42,8 @@ func TestAccProjectDSProjectIPAccessList_SettingCIDRBlock(t *testing.T) { comment := fmt.Sprintf("TestAcc for cidrBlock (%s)", cidrBlock) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccDataMongoDBAtlasProjectIPAccessListConfigSettingCIDRBlock(orgID, projectName, cidrBlock, comment), @@ -74,8 +74,8 @@ func TestAccProjectDSProjectIPAccessList_SettingAWSSecurityGroup(t *testing.T) { comment := fmt.Sprintf("TestAcc for awsSecurityGroup (%s)", awsSGroup) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccDataMongoDBAtlasProjectIPAccessListConfigSettingAWSSecurityGroup(projectID, providerName, vpcID, awsAccountID, vpcCIDRBlock, awsRegion, awsSGroup, comment), diff --git a/mongodbatlas/data_source_mongodbatlas_project_test.go b/mongodbatlas/data_source_mongodbatlas_project_test.go index a8c2f10749..e4b43136f7 100644 --- a/mongodbatlas/data_source_mongodbatlas_project_test.go +++ b/mongodbatlas/data_source_mongodbatlas_project_test.go @@ -24,8 +24,8 @@ func TestAccProjectDSProject_byID(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectDSUsingRS(testAccMongoDBAtlasProjectConfig(projectName, orgID, @@ -72,8 +72,8 @@ func TestAccProjectDSProject_byName(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectDSUsingRS(testAccMongoDBAtlasProjectConfig(projectName, orgID, @@ -121,8 +121,8 @@ func TestAccProjectDSProject_defaultFlags(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectDSUsingRS(testAccMongoDBAtlasProjectConfig(projectName, orgID, @@ -168,8 +168,8 @@ func TestAccProjectDSProject_limits(t *testing.T) { orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectDSUsingRS(testAccMongoDBAtlasProjectConfigWithLimits(projectName, orgID, []*projectLimit{})), diff --git a/mongodbatlas/data_source_mongodbatlas_projects_test.go b/mongodbatlas/data_source_mongodbatlas_projects_test.go index cfd014a20e..4241b8c647 100644 --- a/mongodbatlas/data_source_mongodbatlas_projects_test.go +++ b/mongodbatlas/data_source_mongodbatlas_projects_test.go @@ -24,8 +24,8 @@ func TestAccProjectDSProjects_basic(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectsConfigWithDS(projectName, orgID, @@ -72,8 +72,8 @@ func TestAccProjectDSProjects_withPagination(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectsConfigWithPagination(projectName, orgID, diff --git a/mongodbatlas/data_source_mongodbatlas_team_test.go b/mongodbatlas/data_source_mongodbatlas_team_test.go index 101d861862..4d42857213 100644 --- a/mongodbatlas/data_source_mongodbatlas_team_test.go +++ b/mongodbatlas/data_source_mongodbatlas_team_test.go @@ -18,9 +18,9 @@ func TestAccConfigDSTeam_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasTeamDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasTeamDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasTeamConfig(orgID, name, username), @@ -44,9 +44,9 @@ func TestAccConfigDSTeamByName_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasTeamDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasTeamDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasTeamConfigByName(orgID, name, username), diff --git a/mongodbatlas/data_source_mongodbatlas_third_party_integration_test.go b/mongodbatlas/data_source_mongodbatlas_third_party_integration_test.go index d89f1e9fce..c324eade64 100644 --- a/mongodbatlas/data_source_mongodbatlas_third_party_integration_test.go +++ b/mongodbatlas/data_source_mongodbatlas_third_party_integration_test.go @@ -136,8 +136,8 @@ func TestAccConfigDSThirdPartyIntegration_basic(t *testing.T) { seedConfig.Integration.APIKey = apiKey resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasThirdPartyIntegrationDataSourceConfig(&seedConfig), @@ -285,7 +285,7 @@ func testGenString(length int, charSet string) string { func testAccCheckThirdPartyIntegrationExists(resourceName string, integration *matlas.ThirdPartyIntegration) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/data_source_mongodbatlas_third_party_integrations_test.go b/mongodbatlas/data_source_mongodbatlas_third_party_integrations_test.go index 2b61680d94..fce3e9ac4e 100644 --- a/mongodbatlas/data_source_mongodbatlas_third_party_integrations_test.go +++ b/mongodbatlas/data_source_mongodbatlas_third_party_integrations_test.go @@ -40,8 +40,8 @@ func TestAccConfigDSThirdPartyIntegrations_basic(t *testing.T) { intgResourcesHCL := testAccMongoDBAtlasThirdPartyIntegrationsDataSourceConfig(hclConfig, projectID) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: intgResourcesHCL, diff --git a/mongodbatlas/framework/validator/duration_validator.go b/mongodbatlas/framework/validator/duration_validator.go new file mode 100644 index 0000000000..5a6ae5f653 --- /dev/null +++ b/mongodbatlas/framework/validator/duration_validator.go @@ -0,0 +1,60 @@ +package validator + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" +) + +type durationValidator struct { + MinMinutes int + MaxMinutes int +} + +func (v durationValidator) Description(_ context.Context) string { + ds := "string value must be defined as a valid duration, and must be between %d and %d minutes, inclusive. Valid time units are ns, us (or µs), ms, s, h, or m." + return fmt.Sprintf(ds, v.MinMinutes, v.MaxMinutes) +} + +func (v durationValidator) MarkdownDescription(ctx context.Context) string { + return v.Description(ctx) +} + +//nolint:gocritic //we have to comply with validator interface, cannot pass req as a pointer +func (v durationValidator) ValidateString(ctx context.Context, req validator.StringRequest, response *validator.StringResponse) { + // If the value is unknown or null, there is nothing to validate. + if req.ConfigValue.IsUnknown() || req.ConfigValue.IsNull() { + return + } + + value := req.ConfigValue.ValueString() + + duration, err := time.ParseDuration(value) + + if err != nil { + response.Diagnostics.Append(validatordiag.InvalidAttributeValueDiagnostic( + req.Path, + v.Description(ctx), + req.ConfigValue.ValueString(), + )) + return + } + + if duration.Minutes() < float64(v.MinMinutes) || duration.Minutes() > float64(v.MaxMinutes) { + response.Diagnostics.Append(validatordiag.InvalidAttributeValueDiagnostic( + req.Path, + v.Description(ctx), + req.ConfigValue.ValueString(), + )) + } +} + +func ValidDurationBetween(minMinutes, maxMinutes int) validator.String { + return durationValidator{ + MinMinutes: minMinutes, + MaxMinutes: maxMinutes, + } +} diff --git a/mongodbatlas/framework/validator/json_string_validator.go b/mongodbatlas/framework/validator/json_string_validator.go new file mode 100644 index 0000000000..5471691023 --- /dev/null +++ b/mongodbatlas/framework/validator/json_string_validator.go @@ -0,0 +1,39 @@ +package validator + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-sdk/helper/structure" +) + +type jsonStringValidator struct{} + +func (v jsonStringValidator) Description(_ context.Context) string { + return "string value must be a valid JSON" +} + +func (v jsonStringValidator) MarkdownDescription(ctx context.Context) string { + return v.Description(ctx) +} + +//nolint:gocritic //we have to comply with validator interface, cannot pass req as a pointer +func (v jsonStringValidator) ValidateString(ctx context.Context, req validator.StringRequest, response *validator.StringResponse) { + // If the value is unknown or null, there is nothing to validate. + if req.ConfigValue.IsUnknown() || req.ConfigValue.IsNull() { + return + } + + if _, err := structure.NormalizeJsonString(req.ConfigValue.ValueString()); err != nil { + response.Diagnostics.Append(validatordiag.InvalidAttributeValueDiagnostic( + req.Path, + v.Description(ctx), + req.ConfigValue.ValueString(), + )) + } +} + +func StringIsJSON() validator.String { + return jsonStringValidator{} +} diff --git a/mongodbatlas/fw_provider.go b/mongodbatlas/fw_provider.go new file mode 100644 index 0000000000..11f8eafd33 --- /dev/null +++ b/mongodbatlas/fw_provider.go @@ -0,0 +1,404 @@ +package mongodbatlas + +import ( + "context" + "fmt" + "log" + "regexp" + "time" + + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/provider" + "github.com/hashicorp/terraform-plugin-framework/provider/schema" + "github.com/hashicorp/terraform-plugin-framework/providerserver" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-mux/tf5to6server" + "github.com/hashicorp/terraform-plugin-mux/tf6muxserver" + sdkv2schema "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + cstmvalidator "github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas/framework/validator" + "github.com/mongodb/terraform-provider-mongodbatlas/version" +) + +type MongodbtlasProvider struct{} + +type tfMongodbAtlasProviderModel struct { + AssumeRole types.List `tfsdk:"assume_role"` + PublicKey types.String `tfsdk:"public_key"` + PrivateKey types.String `tfsdk:"private_key"` + BaseURL types.String `tfsdk:"base_url"` + RealmBaseURL types.String `tfsdk:"realm_base_url"` + SecretName types.String `tfsdk:"secret_name"` + Region types.String `tfsdk:"region"` + StsEndpoint types.String `tfsdk:"sts_endpoint"` + AwsAccessKeyID types.String `tfsdk:"aws_access_key_id"` + AwsSecretAccessKeyID types.String `tfsdk:"aws_secret_access_key"` + AwsSessionToken types.String `tfsdk:"aws_session_token"` + IsMongodbGovCloud types.Bool `tfsdk:"is_mongodbgov_cloud"` +} + +type tfAssumeRoleModel struct { + PolicyARNs types.Set `tfsdk:"policy_arns"` + TransitiveTagKeys types.Set `tfsdk:"transitive_tag_keys"` + Tags types.Map `tfsdk:"tags"` + Duration types.String `tfsdk:"duration"` + ExternalID types.String `tfsdk:"external_id"` + Policy types.String `tfsdk:"policy"` + RoleARN types.String `tfsdk:"role_arn"` + SessionName types.String `tfsdk:"session_name"` + SourceIdentity types.String `tfsdk:"source_identity"` + DurationSeconds types.Int64 `tfsdk:"duration_seconds"` +} + +func (p *MongodbtlasProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse) { + resp.TypeName = "mongodbatlas" + resp.Version = version.ProviderVersion +} + +func (p *MongodbtlasProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) { + resp.Schema = schema.Schema{ + Blocks: map[string]schema.Block{ + "assume_role": fwAssumeRoleSchema, + }, + Attributes: map[string]schema.Attribute{ + "public_key": schema.StringAttribute{ + Optional: true, + Description: "MongoDB Atlas Programmatic Public Key", + }, + "private_key": schema.StringAttribute{ + Optional: true, + Description: "MongoDB Atlas Programmatic Private Key", + Sensitive: true, + }, + "base_url": schema.StringAttribute{ + Optional: true, + Description: "MongoDB Atlas Base URL", + }, + "realm_base_url": schema.StringAttribute{ + Optional: true, + Description: "MongoDB Realm Base URL", + }, + "is_mongodbgov_cloud": schema.BoolAttribute{ + Optional: true, + Description: "MongoDB Atlas Base URL default to gov", + }, + "secret_name": schema.StringAttribute{ + Optional: true, + Description: "Name of secret stored in AWS Secret Manager.", + }, + "region": schema.StringAttribute{ + Optional: true, + Description: "Region where secret is stored as part of AWS Secret Manager.", + }, + "sts_endpoint": schema.StringAttribute{ + Optional: true, + Description: "AWS Security Token Service endpoint. Required for cross-AWS region or cross-AWS account secrets.", + }, + "aws_access_key_id": schema.StringAttribute{ + Optional: true, + Description: "AWS API Access Key.", + }, + "aws_secret_access_key": schema.StringAttribute{ + Optional: true, + Description: "AWS API Access Secret Key.", + }, + "aws_session_token": schema.StringAttribute{ + Optional: true, + Description: "AWS Security Token Service provided session token.", + }, + }, + } +} + +var fwAssumeRoleSchema = schema.ListNestedBlock{ + Validators: []validator.List{listvalidator.SizeAtMost(1)}, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "duration": schema.StringAttribute{ + Optional: true, + Description: "The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m.", + Validators: []validator.String{ + cstmvalidator.ValidDurationBetween(15, 12*60), + stringvalidator.ConflictsWith(path.Expressions{ + path.MatchRelative().AtParent().AtName("duration_seconds"), + }...), + }, + }, + "duration_seconds": schema.Int64Attribute{ + Optional: true, + DeprecationMessage: "Use assume_role.duration instead", + Description: "The duration, in seconds, of the role session.", + Validators: []validator.Int64{ + int64validator.Between(900, 43200), + int64validator.ConflictsWith(path.Expressions{ + path.MatchRelative().AtParent().AtName("duration"), + }...), + }, + }, + "external_id": schema.StringAttribute{ + Optional: true, + Description: "A unique identifier that might be required when you assume a role in another account.", + Validators: []validator.String{ + stringvalidator.LengthBetween(2, 1224), + stringvalidator.RegexMatches(regexp.MustCompile(`[\w+=,.@:/\-]*`), ""), + }, + }, + "policy": schema.StringAttribute{ + Optional: true, + Description: "IAM Policy JSON describing further restricting permissions for the IAM Role being assumed.", + Validators: []validator.String{ + cstmvalidator.StringIsJSON(), + }, + }, + "policy_arns": schema.SetAttribute{ + ElementType: types.StringType, + Optional: true, + Description: "Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed.", + }, + "role_arn": schema.StringAttribute{ + Optional: true, + Description: "Amazon Resource Name (ARN) of an IAM Role to assume prior to making API calls.", + }, + "session_name": schema.StringAttribute{ + Optional: true, + Description: "An identifier for the assumed role session.", + Validators: []validator.String{ + stringvalidator.LengthBetween(2, 64), + stringvalidator.RegexMatches(regexp.MustCompile(`[\w+=,.@\-]*`), ""), + }, + }, + "source_identity": schema.StringAttribute{ + Optional: true, + Description: "Source identity specified by the principal assuming the role.", + Validators: []validator.String{ + stringvalidator.LengthBetween(2, 64), + stringvalidator.RegexMatches(regexp.MustCompile(`[\w+=,.@\-]*`), ""), + }, + }, + "tags": schema.MapAttribute{ + ElementType: types.StringType, + Optional: true, + Description: "Assume role session tags.", + }, + "transitive_tag_keys": schema.SetAttribute{ + ElementType: types.StringType, + Optional: true, + Description: "Assume role session tag keys to pass to any subsequent sessions.", + }, + }, + }, +} + +func (p *MongodbtlasProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) { + var data tfMongodbAtlasProviderModel + + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + if resp.Diagnostics.HasError() { + return + } + + data = setDefaultValuesWithValidations(&data, resp) + if resp.Diagnostics.HasError() { + return + } + + config := Config{ + PublicKey: data.PublicKey.ValueString(), + PrivateKey: data.PrivateKey.ValueString(), + BaseURL: data.BaseURL.ValueString(), + RealmBaseURL: data.RealmBaseURL.ValueString(), + } + + var assumeRoles []tfAssumeRoleModel + data.AssumeRole.ElementsAs(ctx, &assumeRoles, true) + + if len(assumeRoles) > 0 { + config.AssumeRole = parseTfModel(ctx, &assumeRoles[0]) + secret := data.SecretName.ValueString() + region := data.Region.ValueString() + awsAccessKeyID := data.AwsAccessKeyID.ValueString() + awsSecretAccessKey := data.AwsSecretAccessKeyID.ValueString() + awsSessionToken := data.AwsSessionToken.ValueString() + endpoint := data.StsEndpoint.ValueString() + var err error + config, err = configureCredentialsSTS(config, secret, region, awsAccessKeyID, awsSecretAccessKey, awsSessionToken, endpoint) + if err != nil { + resp.Diagnostics.AddError("failed to configure credentials STS", err.Error()) + return + } + } + + client, err := config.NewClient(ctx) + + if err != nil { + resp.Diagnostics.AddError( + "failed to initialize a new client", + err.Error(), + ) + return + } + + resp.DataSourceData = client + resp.ResourceData = client +} + +// parseTfModel extracts the values from tfAssumeRoleModel creating a new instance of our internal model AssumeRole used in Config +func parseTfModel(ctx context.Context, tfAssumeRoleModel *tfAssumeRoleModel) *AssumeRole { + assumeRole := AssumeRole{} + + if !tfAssumeRoleModel.Duration.IsNull() { + duration, _ := time.ParseDuration(tfAssumeRoleModel.Duration.ValueString()) + assumeRole.Duration = duration + } else if !tfAssumeRoleModel.DurationSeconds.IsNull() { + assumeRole.Duration = time.Duration(tfAssumeRoleModel.DurationSeconds.ValueInt64()) * time.Second + } + + assumeRole.ExternalID = tfAssumeRoleModel.ExternalID.ValueString() + assumeRole.Policy = tfAssumeRoleModel.Policy.ValueString() + + if !tfAssumeRoleModel.PolicyARNs.IsNull() { + var policiesARNs []string + tfAssumeRoleModel.PolicyARNs.ElementsAs(ctx, &policiesARNs, true) + assumeRole.PolicyARNs = policiesARNs + } + + assumeRole.RoleARN = tfAssumeRoleModel.RoleARN.ValueString() + assumeRole.SessionName = tfAssumeRoleModel.SessionName.ValueString() + assumeRole.SourceIdentity = tfAssumeRoleModel.SourceIdentity.ValueString() + + if !tfAssumeRoleModel.TransitiveTagKeys.IsNull() { + var transitiveTagKeys []string + tfAssumeRoleModel.TransitiveTagKeys.ElementsAs(ctx, &transitiveTagKeys, true) + assumeRole.TransitiveTagKeys = transitiveTagKeys + } + + return &assumeRole +} + +const MongodbGovCloudURL = "https://cloud.mongodbgov.com" + +func setDefaultValuesWithValidations(data *tfMongodbAtlasProviderModel, resp *provider.ConfigureResponse) tfMongodbAtlasProviderModel { + if mongodbgovCloud := data.IsMongodbGovCloud.ValueBool(); mongodbgovCloud { + data.BaseURL = types.StringValue(MongodbGovCloudURL) + } + if data.BaseURL.ValueString() == "" { + data.BaseURL = types.StringValue(MultiEnvDefaultFunc([]string{ + "MONGODB_ATLAS_BASE_URL", + "MCLI_OPS_MANAGER_URL", + }, "").(string)) + } + + if data.PublicKey.ValueString() == "" { + data.PublicKey = types.StringValue(MultiEnvDefaultFunc([]string{ + "MONGODB_ATLAS_PUBLIC_KEY", + "MCLI_PUBLIC_API_KEY", + }, "").(string)) + if data.PublicKey.ValueString() == "" { + resp.Diagnostics.AddError(ProviderConfigError, fmt.Sprintf(AttrNotSetError, "public_key")) + } + } + + if data.PrivateKey.ValueString() == "" { + data.PrivateKey = types.StringValue(MultiEnvDefaultFunc([]string{ + "MONGODB_ATLAS_PRIVATE_KEY", + "MCLI_PRIVATE_API_KEY", + }, "").(string)) + if data.PrivateKey.ValueString() == "" { + resp.Diagnostics.AddError(ProviderConfigError, fmt.Sprintf(AttrNotSetError, "private_key")) + } + } + + if data.RealmBaseURL.ValueString() == "" { + data.RealmBaseURL = types.StringValue(MultiEnvDefaultFunc([]string{ + "MONGODB_REALM_BASE_URL", + }, "").(string)) + } + + if data.Region.ValueString() == "" { + data.Region = types.StringValue(MultiEnvDefaultFunc([]string{ + "AWS_REGION", + "TF_VAR_AWS_REGION", + }, "").(string)) + } + + if data.StsEndpoint.ValueString() == "" { + data.StsEndpoint = types.StringValue(MultiEnvDefaultFunc([]string{ + "STS_ENDPOINT", + "TF_VAR_STS_ENDPOINT", + }, "").(string)) + } + + if data.AwsAccessKeyID.ValueString() == "" { + data.AwsAccessKeyID = types.StringValue(MultiEnvDefaultFunc([]string{ + "AWS_ACCESS_KEY_ID", + "TF_VAR_AWS_ACCESS_KEY_ID", + }, "").(string)) + } + + if data.AwsSecretAccessKeyID.ValueString() == "" { + data.AwsSecretAccessKeyID = types.StringValue(MultiEnvDefaultFunc([]string{ + "AWS_SECRET_ACCESS_KEY", + "TF_VAR_AWS_SECRET_ACCESS_KEY", + }, "").(string)) + } + + if data.AwsSessionToken.ValueString() == "" { + data.AwsSessionToken = types.StringValue(MultiEnvDefaultFunc([]string{ + "AWS_SESSION_TOKEN", + "TF_VAR_AWS_SESSION_TOKEN", + }, "").(string)) + } + + return *data +} + +func (p *MongodbtlasProvider) DataSources(context.Context) []func() datasource.DataSource { + return []func() datasource.DataSource{ + // NewExampleDataSource, + } +} + +func (p *MongodbtlasProvider) Resources(context.Context) []func() resource.Resource { + return []func() resource.Resource{ + // NewExampleResource, + } +} + +func NewFrameworkProvider() provider.Provider { + return &MongodbtlasProvider{} +} + +func MuxedProviderFactory() func() tfprotov6.ProviderServer { + return muxedProviderFactory(NewSdkV2Provider()) +} + +// muxedProviderFactory creates mux provider using existing sdk v2 provider passed as parameter and creating new instance of framework provider. +// Used in testing where existing sdk v2 provider has to be used. +func muxedProviderFactory(sdkV2Provider *sdkv2schema.Provider) func() tfprotov6.ProviderServer { + fwProvider := NewFrameworkProvider() + + ctx := context.Background() + upgradedSdkProvider, err := tf5to6server.UpgradeServer(ctx, sdkV2Provider.GRPCProvider) + if err != nil { + log.Fatal(err) + } + + providers := []func() tfprotov6.ProviderServer{ + func() tfprotov6.ProviderServer { + return upgradedSdkProvider + }, + providerserver.NewProtocol6(fwProvider), + } + + muxServer, err := tf6muxserver.NewMuxServer(ctx, providers...) + if err != nil { + log.Fatal(err) + } + return muxServer.ProviderServer +} diff --git a/mongodbatlas/provider.go b/mongodbatlas/provider.go index 57069d7375..6b3eb9afb2 100644 --- a/mongodbatlas/provider.go +++ b/mongodbatlas/provider.go @@ -34,13 +34,14 @@ import ( var ( ProviderEnableBeta, _ = strconv.ParseBool(os.Getenv("MONGODB_ATLAS_ENABLE_BETA")) - baseURL = "" ) const ( endPointSTSDefault = "https://sts.amazonaws.com" DeprecationMessage = "this resource is deprecated and will be removed in %s, please transition to %s" DeprecationMessageParameterToResource = "this parameter is deprecated and will be removed in %s, please transition to %s" + AttrNotSetError = "attribute %s must be set" + ProviderConfigError = "error in configuring the provider." ) type SecretData struct { @@ -48,42 +49,29 @@ type SecretData struct { PrivateKey string `json:"private_key"` } -// Provider returns the provider to be use by the code. -func Provider() *schema.Provider { +// NewSdkV2Provider returns the provider to be use by the code. +func NewSdkV2Provider() *schema.Provider { provider := &schema.Provider{ Schema: map[string]*schema.Schema{ "public_key": { - Type: schema.TypeString, - Required: true, - DefaultFunc: schema.MultiEnvDefaultFunc([]string{ - "MONGODB_ATLAS_PUBLIC_KEY", - "MCLI_PUBLIC_API_KEY", - }, ""), + Type: schema.TypeString, + Optional: true, Description: "MongoDB Atlas Programmatic Public Key", }, "private_key": { - Type: schema.TypeString, - Required: true, - DefaultFunc: schema.MultiEnvDefaultFunc([]string{ - "MONGODB_ATLAS_PRIVATE_KEY", - "MCLI_PRIVATE_API_KEY", - }, ""), + Type: schema.TypeString, + Optional: true, Description: "MongoDB Atlas Programmatic Private Key", Sensitive: true, }, "base_url": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.MultiEnvDefaultFunc([]string{ - "MONGODB_ATLAS_BASE_URL", - "MCLI_OPS_MANAGER_URL", - }, ""), + Type: schema.TypeString, + Optional: true, Description: "MongoDB Atlas Base URL", }, "realm_base_url": { Type: schema.TypeString, Optional: true, - DefaultFunc: schema.EnvDefaultFunc("MONGODB_REALM_BASE_URL", ""), Description: "MongoDB Realm Base URL", }, "is_mongodbgov_cloud": { @@ -93,48 +81,34 @@ func Provider() *schema.Provider { }, "assume_role": assumeRoleSchema(), "secret_name": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + Description: "Name of secret stored in AWS Secret Manager.", }, "region": { - Type: schema.TypeString, - DefaultFunc: schema.MultiEnvDefaultFunc([]string{ - "AWS_REGION", - "TF_VAR_AWS_REGION", - }, ""), - Optional: true, + Type: schema.TypeString, + Optional: true, + Description: "Region where secret is stored as part of AWS Secret Manager.", }, "sts_endpoint": { - Type: schema.TypeString, - DefaultFunc: schema.MultiEnvDefaultFunc([]string{ - "STS_ENDPOINT", - "TF_VAR_STS_ENDPOINT", - }, ""), - Optional: true, + Type: schema.TypeString, + Optional: true, + Description: "AWS Security Token Service endpoint. Required for cross-AWS region or cross-AWS account secrets.", }, "aws_access_key_id": { - Type: schema.TypeString, - DefaultFunc: schema.MultiEnvDefaultFunc([]string{ - "AWS_ACCESS_KEY_ID", - "TF_VAR_AWS_ACCESS_KEY_ID", - }, ""), - Optional: true, + Type: schema.TypeString, + Optional: true, + Description: "AWS API Access Key.", }, "aws_secret_access_key": { - Type: schema.TypeString, - DefaultFunc: schema.MultiEnvDefaultFunc([]string{ - "AWS_SECRET_ACCESS_KEY", - "TF_VAR_AWS_SECRET_ACCESS_KEY", - }, ""), - Optional: true, + Type: schema.TypeString, + Optional: true, + Description: "AWS API Access Secret Key.", }, "aws_session_token": { - Type: schema.TypeString, - DefaultFunc: schema.MultiEnvDefaultFunc([]string{ - "AWS_SESSION_TOKEN", - "TF_VAR_AWS_SESSION_TOKEN", - }, ""), - Optional: true, + Type: schema.TypeString, + Optional: true, + Description: "AWS Security Token Service provided session token.", }, }, DataSourcesMap: getDataSourcesMap(), @@ -308,17 +282,14 @@ func addBetaFeatures(provider *schema.Provider) { } func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) { - mongodbgovCloud := pointy.Bool(d.Get("is_mongodbgov_cloud").(bool)) - if *mongodbgovCloud { - baseURL = "https://cloud.mongodbgov.com" - } else { - baseURL = d.Get("base_url").(string) + if err := setDefaultsAndValidations(d); err != nil { + return nil, diag.FromErr(err) } config := Config{ PublicKey: d.Get("public_key").(string), PrivateKey: d.Get("private_key").(string), - BaseURL: baseURL, + BaseURL: d.Get("base_url").(string), RealmBaseURL: d.Get("realm_base_url").(string), } @@ -331,20 +302,119 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{} awsSessionToken := d.Get("aws_session_token").(string) endpoint := d.Get("sts_endpoint").(string) var err error - config, err = configureCredentialsSTS(&config, secret, region, awsAccessKeyID, awsSecretAccessKey, awsSessionToken, endpoint) + config, err = configureCredentialsSTS(config, secret, region, awsAccessKeyID, awsSecretAccessKey, awsSessionToken, endpoint) if err != nil { return nil, diag.FromErr(err) } } - return config.NewClient(ctx) + client, err := config.NewClient(ctx) + if err != nil { + return nil, diag.FromErr(err) + } + return client, nil +} + +func setDefaultsAndValidations(d *schema.ResourceData) error { + mongodbgovCloud := pointy.Bool(d.Get("is_mongodbgov_cloud").(bool)) + if *mongodbgovCloud { + if err := d.Set("base_url", MongodbGovCloudURL); err != nil { + return err + } + } + + if err := setValueFromConfigOrEnv(d, "base_url", []string{ + "MONGODB_ATLAS_BASE_URL", + "MCLI_OPS_MANAGER_URL", + }); err != nil { + return err + } + + if err := setValueFromConfigOrEnv(d, "public_key", []string{ + "MONGODB_ATLAS_PUBLIC_KEY", + "MCLI_PUBLIC_API_KEY", + }); err != nil { + return err + } + if d.Get("public_key").(string) == "" { + return fmt.Errorf(AttrNotSetError, "public_key") + } + + if err := setValueFromConfigOrEnv(d, "private_key", []string{ + "MONGODB_ATLAS_PRIVATE_KEY", + "MCLI_PRIVATE_API_KEY", + }); err != nil { + return err + } + + if d.Get("private_key").(string) == "" { + return fmt.Errorf(AttrNotSetError, "private_key") + } + + if err := setValueFromConfigOrEnv(d, "realm_base_url", []string{ + "MONGODB_REALM_BASE_URL", + }); err != nil { + return err + } + + if err := setValueFromConfigOrEnv(d, "region", []string{ + "AWS_REGION", + "TF_VAR_AWS_REGION", + }); err != nil { + return err + } + + if err := setValueFromConfigOrEnv(d, "sts_endpoint", []string{ + "STS_ENDPOINT", + "TF_VAR_STS_ENDPOINT", + }); err != nil { + return err + } + + if err := setValueFromConfigOrEnv(d, "aws_access_key_id", []string{ + "AWS_ACCESS_KEY_ID", + "TF_VAR_AWS_ACCESS_KEY_ID", + }); err != nil { + return err + } + + if err := setValueFromConfigOrEnv(d, "aws_secret_access_key", []string{ + "AWS_SECRET_ACCESS_KEY", + "TF_VAR_AWS_SECRET_ACCESS_KEY", + }); err != nil { + return err + } + + err := setValueFromConfigOrEnv(d, "aws_session_token", []string{ + "AWS_SESSION_TOKEN", + "TF_VAR_AWS_SESSION_TOKEN", + }) + + return err +} + +func setValueFromConfigOrEnv(d *schema.ResourceData, attrName string, envVars []string) error { + var val = d.Get(attrName).(string) + if val == "" { + val = MultiEnvDefaultFunc(envVars, "").(string) + } + return d.Set(attrName, val) +} + +func MultiEnvDefaultFunc(ks []string, def interface{}) interface{} { + for _, k := range ks { + if v := os.Getenv(k); v != "" { + return v + } + } + return def } -func configureCredentialsSTS(config *Config, secret, region, awsAccessKeyID, awsSecretAccessKey, awsSessionToken, endpoint string) (Config, error) { +func configureCredentialsSTS(config Config, secret, region, awsAccessKeyID, awsSecretAccessKey, awsSessionToken, endpoint string) (Config, error) { ep, err := endpoints.GetSTSRegionalEndpoint("regional") if err != nil { log.Printf("GetSTSRegionalEndpoint error: %s", err) - return *config, err + return config, err } defaultResolver := endpoints.DefaultResolver() @@ -379,35 +449,35 @@ func configureCredentialsSTS(config *Config, secret, region, awsAccessKeyID, aws _, err = sess.Config.Credentials.Get() if err != nil { log.Printf("Session get credentials error: %s", err) - return *config, err + return config, err } _, err = creds.Get() if err != nil { log.Printf("STS get credentials error: %s", err) - return *config, err + return config, err } secretString, err := secretsManagerGetSecretValue(sess, &aws.Config{Credentials: creds, Region: aws.String(region)}, secret) if err != nil { log.Printf("Get Secrets error: %s", err) - return *config, err + return config, err } var secretData SecretData err = json.Unmarshal([]byte(secretString), &secretData) if err != nil { - return *config, err + return config, err } if secretData.PrivateKey == "" { - return *config, fmt.Errorf("secret missing value for credential PrivateKey") + return config, fmt.Errorf("secret missing value for credential PrivateKey") } if secretData.PublicKey == "" { - return *config, fmt.Errorf("secret missing value for credential PublicKey") + return config, fmt.Errorf("secret missing value for credential PublicKey") } config.PublicKey = secretData.PublicKey config.PrivateKey = secretData.PrivateKey - return *config, nil + return config, nil } func secretsManagerGetSecretValue(sess *session.Session, creds *aws.Config, secret string) (string, error) { diff --git a/mongodbatlas/provider_test.go b/mongodbatlas/provider_test.go index 1367cf099b..7132bf889b 100644 --- a/mongodbatlas/provider_test.go +++ b/mongodbatlas/provider_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/go-test/deep" + "github.com/hashicorp/terraform-plugin-go/tfprotov6" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" matlas "go.mongodb.org/atlas/mongodbatlas" ) @@ -15,25 +16,24 @@ const ( ProviderNameMongoDBAtlas = "mongodbatlas" ) -var testAccProviders map[string]*schema.Provider +var testAccProviderV6Factories map[string]func() (tfprotov6.ProviderServer, error) -var testAccProviderFactories map[string]func() (*schema.Provider, error) - -var testAccProvider *schema.Provider +// only being used in tests obtaining client: .Meta().(*MongoDBClient) +// this provider instance has to be passed into mux server factory for its configure method to be invoked +var testAccProviderSdkV2 *schema.Provider func init() { - testAccProvider = Provider() - testAccProviders = map[string]*schema.Provider{ - ProviderNameMongoDBAtlas: testAccProvider, - } + testAccProviderSdkV2 = NewSdkV2Provider() - testAccProviderFactories = map[string]func() (*schema.Provider, error){ - ProviderNameMongoDBAtlas: func() (*schema.Provider, error) { return testAccProvider, nil }, + testAccProviderV6Factories = map[string]func() (tfprotov6.ProviderServer, error){ + ProviderNameMongoDBAtlas: func() (tfprotov6.ProviderServer, error) { + return muxedProviderFactory(testAccProviderSdkV2)(), nil + }, } } -func TestProvider(t *testing.T) { - if err := Provider().InternalValidate(); err != nil { +func TestSdkV2Provider(t *testing.T) { + if err := NewSdkV2Provider().InternalValidate(); err != nil { t.Fatalf("err: %s", err) } } diff --git a/mongodbatlas/resource_mongodbatlas_access_list_api_key_test.go b/mongodbatlas/resource_mongodbatlas_access_list_api_key_test.go index 2b86af88a1..607d9df40e 100644 --- a/mongodbatlas/resource_mongodbatlas_access_list_api_key_test.go +++ b/mongodbatlas/resource_mongodbatlas_access_list_api_key_test.go @@ -19,9 +19,9 @@ func TestAccProjectRSAccesslistAPIKey_SettingIPAddress(t *testing.T) { updatedIPAddress := fmt.Sprintf("179.154.228.%d", acctest.RandIntRange(0, 255)) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAccessListAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAccessListAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAccessListAPIKeyConfigSettingIPAddress(orgID, description, ipAddress), @@ -57,9 +57,9 @@ func TestAccProjectRSAccessListAPIKey_SettingCIDRBlock(t *testing.T) { updatedCIDRBlock := fmt.Sprintf("179.154.228.%d/32", acctest.RandIntRange(0, 255)) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAccessListAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAccessListAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAccessListAPIKeyConfigSettingCIDRBlock(orgID, description, cidrBlock), @@ -94,9 +94,9 @@ func TestAccProjectRSAccessListAPIKey_importBasic(t *testing.T) { description := fmt.Sprintf("test-acc-access_list-api_key-%s", acctest.RandString(5)) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAccessListAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAccessListAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAccessListAPIKeyConfigSettingIPAddress(orgID, description, ipAddress), @@ -113,7 +113,7 @@ func TestAccProjectRSAccessListAPIKey_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasAccessListAPIKeyExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -136,7 +136,7 @@ func testAccCheckMongoDBAtlasAccessListAPIKeyExists(resourceName string) resourc } func testAccCheckMongoDBAtlasAccessListAPIKeyDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_access_list_api_key" { diff --git a/mongodbatlas/resource_mongodbatlas_advanced_cluster_test.go b/mongodbatlas/resource_mongodbatlas_advanced_cluster_test.go index c1dfbb578d..8b13aaed4f 100644 --- a/mongodbatlas/resource_mongodbatlas_advanced_cluster_test.go +++ b/mongodbatlas/resource_mongodbatlas_advanced_cluster_test.go @@ -27,9 +27,9 @@ func TestAccClusterAdvancedCluster_basicTenant(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAdvancedClusterConfigTenant(orgID, projectName, rName), @@ -87,9 +87,9 @@ func TestAccClusterAdvancedCluster_singleProvider(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAdvancedClusterConfigSingleProvider(orgID, projectName, rName), @@ -139,9 +139,9 @@ func TestAccClusterAdvancedCluster_multicloud(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAdvancedClusterConfigMultiCloud(orgID, projectName, rName), @@ -197,9 +197,9 @@ func TestAccClusterAdvancedCluster_multicloudSharded(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAdvancedClusterConfigMultiCloudSharded(orgID, projectName, rName), @@ -245,9 +245,9 @@ func TestAccClusterAdvancedCluster_UnpausedToPaused(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAdvancedClusterConfigSingleProviderPaused(orgID, projectName, rName, false), @@ -295,9 +295,9 @@ func TestAccClusterAdvancedCluster_PausedToUnpaused(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAdvancedClusterConfigSingleProviderPaused(orgID, projectName, rName, true), @@ -371,9 +371,9 @@ func TestAccClusterAdvancedCluster_advancedConf(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAdvancedClusterConfigAdvancedConf(orgID, projectName, rName, processArgs), @@ -449,9 +449,9 @@ func TestAccClusterAdvancedCluster_DefaultWrite(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAdvancedClusterConfigAdvancedConfDefaultWrite(orgID, projectName, rName, processArgs), @@ -508,9 +508,9 @@ func TestAccClusterAdvancedClusterConfig_ReplicationSpecsAutoScaling(t *testing. ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAdvancedClusterConfigReplicationSpecsAutoScaling(orgID, projectName, rName, autoScaling), @@ -553,9 +553,9 @@ func TestAccClusterAdvancedClusterConfig_ReplicationSpecsAnalyticsAutoScaling(t ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAdvancedClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAdvancedClusterConfigReplicationSpecsAnalyticsAutoScaling(orgID, projectName, rName, autoScaling), @@ -581,7 +581,7 @@ func TestAccClusterAdvancedClusterConfig_ReplicationSpecsAnalyticsAutoScaling(t func testAccCheckMongoDBAtlasAdvancedClusterExists(resourceName string, cluster *matlas.AdvancedCluster) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -636,7 +636,7 @@ func testAccCheckMongoDBAtlasAdvancedClusterAnalyticsScaling(cluster *matlas.Adv } func testAccCheckMongoDBAtlasAdvancedClusterDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_advanced_cluster" { diff --git a/mongodbatlas/resource_mongodbatlas_alert_configuration_test.go b/mongodbatlas/resource_mongodbatlas_alert_configuration_test.go index f44ef84ebf..3c8cd44192 100644 --- a/mongodbatlas/resource_mongodbatlas_alert_configuration_test.go +++ b/mongodbatlas/resource_mongodbatlas_alert_configuration_test.go @@ -21,9 +21,9 @@ func TestAccConfigRSAlertConfiguration_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationConfig(orgID, projectName, true), @@ -54,9 +54,9 @@ func TestAccConfigRSAlertConfiguration_EmptyMetricThresholdConfig(t *testing.T) ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationConfigEmptyMetricThresholdConfig(orgID, projectName, true), @@ -81,9 +81,9 @@ func TestAccConfigRSAlertConfiguration_Notifications(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationConfigNotifications(orgID, projectName, true, true, false), @@ -112,9 +112,9 @@ func TestAccConfigRSAlertConfiguration_WithMatchers(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationConfigWithMatchers(orgID, projectName, true, false, true, @@ -163,9 +163,9 @@ func TestAccConfigRSAlertConfiguration_whitMetricUpdated(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationConfigWithMetrictUpdated(orgID, projectName, true, 99.0), @@ -194,9 +194,9 @@ func TestAccConfigRSAlertConfiguration_whitThresholdUpdated(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationConfigWithThresholdUpdated(orgID, projectName, true, 1), @@ -232,9 +232,9 @@ func TestAccConfigRSAlertConfiguration_whitoutRoles(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationConfigWithoutRoles(orgID, projectName, true, 99.0), @@ -255,9 +255,9 @@ func TestAccConfigRSAlertConfiguration_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationConfig(orgID, projectName, true), @@ -281,9 +281,9 @@ func TestAccConfigRSAlertConfiguration_importConfigNotifications(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationConfigNotifications(orgID, projectName, true, true, false), @@ -311,9 +311,9 @@ func TestAccConfigRSAlertConfiguration_DataDog(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationConfigWithDataDog(projectID, ddAPIKey, ddRegion, true), @@ -336,9 +336,9 @@ func TestAccConfigRSAlertConfiguration_PagerDuty(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationPagerDutyConfig(projectID, serviceKey, true), @@ -361,9 +361,9 @@ func TestAccConfigRSAlertConfiguration_OpsGenie(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationOpsGenieConfig(projectID, apiKey, true), @@ -386,9 +386,9 @@ func TestAccConfigRSAlertConfiguration_VictorOps(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAlertConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAlertConfigurationVictorOpsConfig(projectID, apiKey, true), @@ -403,7 +403,7 @@ func TestAccConfigRSAlertConfiguration_VictorOps(t *testing.T) { func testAccCheckMongoDBAtlasAlertConfigurationExists(resourceName string, alert *matlas.AlertConfiguration) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -428,7 +428,7 @@ func testAccCheckMongoDBAtlasAlertConfigurationExists(resourceName string, alert } func testAccCheckMongoDBAtlasAlertConfigurationDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_alert_configuration" { diff --git a/mongodbatlas/resource_mongodbatlas_api_key_test.go b/mongodbatlas/resource_mongodbatlas_api_key_test.go index ae361e10d3..9eea4c7ef2 100644 --- a/mongodbatlas/resource_mongodbatlas_api_key_test.go +++ b/mongodbatlas/resource_mongodbatlas_api_key_test.go @@ -22,9 +22,9 @@ func TestAccConfigRSAPIKey_Basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAPIKeyConfigBasic(orgID, description, roleName), @@ -59,9 +59,9 @@ func TestAccConfigRSAPIKey_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAPIKeyConfigBasic(orgID, description, roleName), @@ -78,7 +78,7 @@ func TestAccConfigRSAPIKey_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasAPIKeyExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -101,7 +101,7 @@ func testAccCheckMongoDBAtlasAPIKeyExists(resourceName string) resource.TestChec } func testAccCheckMongoDBAtlasAPIKeyDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_api_key" { diff --git a/mongodbatlas/resource_mongodbatlas_auditing_test.go b/mongodbatlas/resource_mongodbatlas_auditing_test.go index fcb30b9269..0c40aeba39 100644 --- a/mongodbatlas/resource_mongodbatlas_auditing_test.go +++ b/mongodbatlas/resource_mongodbatlas_auditing_test.go @@ -24,9 +24,9 @@ func TestAccAdvRSAuditing_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAuditingDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAuditingDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAuditingConfig(orgID, projectName, auditFilter, auditAuth, enabled), @@ -73,9 +73,9 @@ func TestAccAdvRSAuditing_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasAuditingDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasAuditingDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasAuditingConfig(orgID, projectName, auditFilter, auditAuth, enabled), @@ -104,7 +104,7 @@ func TestAccAdvRSAuditing_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasAuditingExists(resourceName string, auditing *matlas.Auditing) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -127,7 +127,7 @@ func testAccCheckMongoDBAtlasAuditingExists(resourceName string, auditing *matla } func testAccCheckMongoDBAtlasAuditingDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_auditing" { diff --git a/mongodbatlas/resource_mongodbatlas_backup_compliance_policy_test.go b/mongodbatlas/resource_mongodbatlas_backup_compliance_policy_test.go index 297273119f..d23ad6d2c9 100644 --- a/mongodbatlas/resource_mongodbatlas_backup_compliance_policy_test.go +++ b/mongodbatlas/resource_mongodbatlas_backup_compliance_policy_test.go @@ -20,9 +20,9 @@ func TestAccGenericBackupRSBackupCompliancePolicy_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasBackupCompliancePolicyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasBackupCompliancePolicyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasBackupCompliancePolicyConfig(projectName, orgID, projectOwnerID), @@ -54,9 +54,9 @@ func TestAccGenericBackupRSBackupCompliancePolicy_withoutRestoreWindowDays(t *te ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasBackupCompliancePolicyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasBackupCompliancePolicyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasBackupCompliancePolicyConfigWithoutRestoreDays(projectName, orgID, projectOwnerID), @@ -89,9 +89,9 @@ func TestAccGenericBackupRSBackupCompliancePolicy_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasBackupCompliancePolicyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasBackupCompliancePolicyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasBackupCompliancePolicyConfig(projectName, orgID, projectOwnerID), @@ -109,7 +109,7 @@ func TestAccGenericBackupRSBackupCompliancePolicy_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasBackupCompliancePolicyExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -133,7 +133,7 @@ func testAccCheckMongoDBAtlasBackupCompliancePolicyExists(resourceName string) r } func testAccCheckMongoDBAtlasBackupCompliancePolicyDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_backup_compliance_policy" { diff --git a/mongodbatlas/resource_mongodbatlas_cloud_backup_schedule_test.go b/mongodbatlas/resource_mongodbatlas_cloud_backup_schedule_test.go index 53e9c0d250..8242f11b35 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_backup_schedule_test.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_backup_schedule_test.go @@ -23,9 +23,9 @@ func TestAccBackupRSCloudBackupSchedule_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCloudBackupScheduleDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCloudBackupScheduleDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCloudBackupScheduleConfigNoPolicies(orgID, projectName, clusterName, &matlas.CloudProviderSnapshotBackupPolicy{ @@ -142,8 +142,8 @@ func TestAccBackupRSCloudBackupSchedule_export(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { @@ -173,9 +173,9 @@ func TestAccBackupRSCloudBackupSchedule_onepolicy(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCloudBackupScheduleDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCloudBackupScheduleDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCloudBackupScheduleDefaultConfig(orgID, projectName, clusterName, &matlas.CloudProviderSnapshotBackupPolicy{ @@ -240,9 +240,9 @@ func TestAccBackupRSCloudBackupSchedule_copySettings(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCloudBackupScheduleDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCloudBackupScheduleDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCloudBackupScheduleCopySettingsConfig(orgID, projectName, clusterName, &matlas.CloudProviderSnapshotBackupPolicy{ @@ -289,9 +289,9 @@ func TestAccBackupRSCloudBackupScheduleImport_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCloudBackupScheduleDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCloudBackupScheduleDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCloudBackupScheduleDefaultConfig(orgID, projectName, clusterName, &matlas.CloudProviderSnapshotBackupPolicy{ @@ -342,9 +342,9 @@ func TestAccBackupRSCloudBackupSchedule_azure(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCloudBackupScheduleDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCloudBackupScheduleDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCloudBackupScheduleBasicConfig(orgID, projectName, clusterName, &matlas.PolicyItem{ @@ -385,7 +385,7 @@ func TestAccBackupRSCloudBackupSchedule_azure(t *testing.T) { func testAccCheckMongoDBAtlasCloudBackupScheduleExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -410,7 +410,7 @@ func testAccCheckMongoDBAtlasCloudBackupScheduleExists(resourceName string) reso } func testAccCheckMongoDBAtlasCloudBackupScheduleDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_cloud_backup_schedule" { diff --git a/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_export_bucket_test.go b/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_export_bucket_test.go index d5973d2441..a8d05778e3 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_export_bucket_test.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_export_bucket_test.go @@ -21,9 +21,9 @@ func TestAccBackupRSBackupSnapshotExportBucket_basic(t *testing.T) { iamRoleID = os.Getenv("IAM_ROLE_ID") ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasBackupSnapshotExportBucketDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasBackupSnapshotExportBucketDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasBackupSnapshotExportBucketConfig(projectID, bucketName, iamRoleID), @@ -48,9 +48,9 @@ func TestAccBackupRSBackupSnapshotExportBucket_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasBackupSnapshotExportBucketDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasBackupSnapshotExportBucketDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasBackupSnapshotExportBucketConfig(projectID, bucketName, iamRoleID), @@ -67,7 +67,7 @@ func TestAccBackupRSBackupSnapshotExportBucket_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasBackupSnapshotExportBucketExists(resourceName string, snapshotExportBucket *matlas.CloudProviderSnapshotExportBucket) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -91,7 +91,7 @@ func testAccCheckMongoDBAtlasBackupSnapshotExportBucketExists(resourceName strin } func testAccCheckMongoDBAtlasBackupSnapshotExportBucketDestroy(state *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range state.RootModule().Resources { if rs.Type != "mongodbatlas_cloud_backup_snapshot_export_bucket" { diff --git a/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_export_job_test.go b/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_export_job_test.go index a63f0b28f0..7606e8f94e 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_export_job_test.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_export_job_test.go @@ -21,9 +21,9 @@ func TestAccBackupRSBackupSnapshotExportJob_basic(t *testing.T) { iamRoleID = os.Getenv("IAM_ROLE_ID") ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasBackupSnapshotExportJobDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasBackupSnapshotExportJobDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasBackupSnapshotExportJobConfig(projectID, bucketName, iamRoleID), @@ -48,9 +48,9 @@ func TestAccBackupRSBackupSnapshotExportJob_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasBackupSnapshotExportJobDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasBackupSnapshotExportJobDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasBackupSnapshotExportJobConfig(projectID, bucketName, iamRoleID), @@ -67,7 +67,7 @@ func TestAccBackupRSBackupSnapshotExportJob_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasBackupSnapshotExportJobExists(resourceName string, snapshotExportJob *matlas.CloudProviderSnapshotExportJob) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -91,7 +91,7 @@ func testAccCheckMongoDBAtlasBackupSnapshotExportJobExists(resourceName string, } func testAccCheckMongoDBAtlasBackupSnapshotExportJobDestroy(state *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range state.RootModule().Resources { if rs.Type != "mongodbatlas_cloud_backup_snapshot_export_job" { diff --git a/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_restore_job_test.go b/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_restore_job_test.go index 368367ea15..8950bd28c2 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_restore_job_test.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_restore_job_test.go @@ -30,9 +30,9 @@ func TestAccBackupRSCloudBackupSnapshotRestoreJob_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCloudBackupSnapshotRestoreJobDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCloudBackupSnapshotRestoreJobDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCloudBackupSnapshotRestoreJobConfigAutomated(orgID, projectName, clusterName, description, retentionInDays, targetProjectName, targetClusterName), @@ -69,9 +69,9 @@ func TestAccBackupRSCloudBackupSnapshotRestoreJob_basicDownload(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCloudBackupSnapshotRestoreJobDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCloudBackupSnapshotRestoreJobDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCloudBackupSnapshotRestoreJobConfigDownload(orgID, projectName, clusterName, description, retentionInDays), @@ -98,9 +98,9 @@ func TestAccBackupRSCloudBackupSnapshotRestoreJobWithPointTime_basic(t *testing. ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCloudBackupSnapshotRestoreJobDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCloudBackupSnapshotRestoreJobDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCloudBackupSnapshotRestoreJobConfigPointInTime(orgID, projectName, clusterName, description, retentionInDays, targetProjectName, timeUtc), @@ -112,7 +112,7 @@ func TestAccBackupRSCloudBackupSnapshotRestoreJobWithPointTime_basic(t *testing. func testAccCheckMongoDBAtlasCloudBackupSnapshotRestoreJobExists(resourceName string, cloudBackupSnapshotRestoreJob *matlas.CloudProviderSnapshotRestoreJob) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -153,7 +153,7 @@ func testAccCheckMongoDBAtlasCloudBackupSnapshotRestoreJobAttributes(cloudBackup } func testAccCheckMongoDBAtlasCloudBackupSnapshotRestoreJobDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_cloud_backup_snapshot_restore_job" { diff --git a/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_test.go b/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_test.go index 8873e84fe2..2708bd25d4 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_test.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_backup_snapshot_test.go @@ -29,9 +29,9 @@ func TestAccBackupRSCloudBackupSnapshot_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCloudBackupSnapshotDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCloudBackupSnapshotDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCloudBackupSnapshotConfig(orgID, projectName, clusterName, description, retentionInDays), @@ -61,7 +61,7 @@ func TestAccBackupRSCloudBackupSnapshot_basic(t *testing.T) { func testAccCheckMongoDBAtlasCloudBackupSnapshotExists(resourceName string, cloudBackupSnapshot *matlas.CloudProviderSnapshot) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -103,7 +103,7 @@ func testAccCheckMongoDBAtlasCloudBackupSnapshotAttributes(cloudBackupSnapshot * } func testAccCheckMongoDBAtlasCloudBackupSnapshotDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_cloud_backup_snapshot" { diff --git a/mongodbatlas/resource_mongodbatlas_cloud_provider_access_authorization_test.go b/mongodbatlas/resource_mongodbatlas_cloud_provider_access_authorization_test.go index d01c7d4b68..847863f06a 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_provider_access_authorization_test.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_provider_access_authorization_test.go @@ -19,8 +19,8 @@ func TestAccConfigRSCloudProviderAccessAuthorization_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, // same as regular cloud provider access resource CheckDestroy: testAccCheckMongoDBAtlasProviderAccessDestroy, Steps: []resource.TestStep{ diff --git a/mongodbatlas/resource_mongodbatlas_cloud_provider_access_setup_test.go b/mongodbatlas/resource_mongodbatlas_cloud_provider_access_setup_test.go index 58ae751426..d2001819a5 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_provider_access_setup_test.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_provider_access_setup_test.go @@ -34,8 +34,8 @@ func TestAccConfigRSCloudProviderAccessSetup_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, // same as regular cloud provider access resource CheckDestroy: testAccCheckMongoDBAtlasProviderAccessDestroy, Steps: []resource.TestStep{ @@ -63,9 +63,9 @@ func TestAccConfigRSCloudProviderAccessSetup_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProviderAccessDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProviderAccessDestroy, Steps: []resource.TestStep{ { Config: fmt.Sprintf(createProviderAccessSetupRole, name, orgID, projectName, "AWS"), diff --git a/mongodbatlas/resource_mongodbatlas_cloud_provider_access_test.go b/mongodbatlas/resource_mongodbatlas_cloud_provider_access_test.go index b4f05a27b6..1d6bbab747 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_provider_access_test.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_provider_access_test.go @@ -35,8 +35,8 @@ func TestAccConfigRSCloudProviderAccess_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: fmt.Sprintf(createProviderAccessRole, orgID, projectName, "AWS"), @@ -60,8 +60,8 @@ func TestAccConfigRSCloudProviderAccess_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: fmt.Sprintf(createProviderAccessRole, orgID, projectName, "AWS"), @@ -96,7 +96,7 @@ func testAccCheckMongoDBAtlasCloudProviderAccessImportStateIDFunc(resourceName s } func testAccCheckMongoDBAtlasProviderAccessDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_cloud_provider_access" { continue @@ -132,7 +132,7 @@ func testAccCheckMongoDBAtlasProviderAccessDestroy(s *terraform.State) error { func testAccCheckMongoDBAtlasProviderAccessExists(resourceName string, targetRole *matlas.AWSIAMRole) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/resource_mongodbatlas_cluster_outage_simulation_test.go b/mongodbatlas/resource_mongodbatlas_cluster_outage_simulation_test.go index 522f393859..9170d8db6b 100644 --- a/mongodbatlas/resource_mongodbatlas_cluster_outage_simulation_test.go +++ b/mongodbatlas/resource_mongodbatlas_cluster_outage_simulation_test.go @@ -21,9 +21,9 @@ func TestAccOutageSimulationCluster_SingleRegion_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterOutageSimulationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterOutageSimulationDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasClusterOutageSimulationConfigSingleRegion(projectName, orgID, clusterName), @@ -50,9 +50,9 @@ func TestAccOutageSimulationCluster_MultiRegion_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterOutageSimulationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterOutageSimulationDestroy, Steps: []resource.TestStep{ { Config: testAccDataSourceMongoDBAtlasClusterOutageSimulationConfigMultiRegion(projectName, orgID, clusterName), @@ -150,7 +150,7 @@ func testAccDataSourceMongoDBAtlasClusterOutageSimulationConfigMultiRegion(proje } func testAccCheckMongoDBAtlasClusterOutageSimulationDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_cluster_outage_simulation" { diff --git a/mongodbatlas/resource_mongodbatlas_cluster_test.go b/mongodbatlas/resource_mongodbatlas_cluster_test.go index 3f84b20255..e6d7f1f116 100644 --- a/mongodbatlas/resource_mongodbatlas_cluster_test.go +++ b/mongodbatlas/resource_mongodbatlas_cluster_test.go @@ -25,9 +25,9 @@ func TestAccClusterRSCluster_basicAWS_simple(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAWS(orgID, projectName, name, true, true), @@ -76,9 +76,9 @@ func TestAccClusterRSCluster_basicAWS_instanceScale(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAWSNVMEInstance(orgID, projectName, name, "M40_NVME"), @@ -118,9 +118,9 @@ func TestAccClusterRSCluster_basic_Partial_AdvancedConf(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAdvancedConf(orgID, projectName, name, "false", &matlas.ProcessArgs{ @@ -189,9 +189,9 @@ func TestAccClusterRSCluster_basic_DefaultWriteRead_AdvancedConf(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAdvancedConfDefaultWriteRead(orgID, projectName, name, "false", &matlas.ProcessArgs{ @@ -249,9 +249,9 @@ func TestAccClusterRSCluster_emptyAdvancedConf(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAdvancedConfPartial(orgID, projectName, name, "false", &matlas.ProcessArgs{ @@ -294,9 +294,9 @@ func TestAccClusterRSCluster_basicAdvancedConf(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAdvancedConf(orgID, projectName, name, "false", &matlas.ProcessArgs{ @@ -360,9 +360,9 @@ func TestAccClusterRSCluster_basicAzure(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAzure(orgID, projectName, name, "true"), @@ -402,9 +402,9 @@ func TestAccClusterRSCluster_basicGCP(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigGCP(orgID, projectName, name, "true"), @@ -446,9 +446,9 @@ func TestAccClusterRSCluster_WithBiConnectorGCP(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigGCPWithBiConnector(orgID, projectName, name, "true", false), @@ -518,9 +518,9 @@ func TestAccClusterRSCluster_MultiRegion(t *testing.T) { }` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigMultiRegion(orgID, projectName, name, "true", createRegionsConfig), @@ -569,9 +569,9 @@ func TestAccClusterRSCluster_Global(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigGlobal(resourceSuffix, orgID, projectName, name, "false"), @@ -605,9 +605,9 @@ func TestAccClusterRSCluster_AWSWithLabels(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterAWSConfigdWithLabels(orgID, projectName, name, "false", "M10", "EU_CENTRAL_1", []matlas.Label{}), @@ -695,9 +695,9 @@ func TestAccClusterRSCluster_withPrivateEndpointLink(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckAwsEnv(t); testCheckPeeringEnvAWS(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckAwsEnv(t); testCheckPeeringEnvAWS(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigWithPrivateEndpointLink( @@ -730,9 +730,9 @@ func TestAccClusterRSCluster_withAzureNetworkPeering(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAzureWithNetworkPeering(projectID, providerName, directoryID, subcrptionID, resourceGroupName, vNetName, clusterName, atlasCidrBlock, region), @@ -761,9 +761,9 @@ func TestAccClusterRSCluster_withGCPNetworkPeering(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvGCP(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvGCP(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigGCPWithNetworkPeering(gcpProjectID, gcpRegion, projectID, providerName, gcpPeeringName, clusterName, gcpClusterRegion), @@ -797,9 +797,9 @@ func TestAccClusterRSCluster_withAzureAndContainerID(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvAzure(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvAzure(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAzureWithContainerID(projectID, clusterName, providerName, region, directoryID, subcrptionID, resourceGroupName, vNetName), @@ -830,9 +830,9 @@ func TestAccClusterRSCluster_withAWSAndContainerID(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAWSWithContainerID(awsAccessKey, awsSecretKey, projectID, clusterName, providerName, awsRegion, vpcCIDRBlock, awsAccountID), @@ -860,9 +860,9 @@ func TestAccClusterRSCluster_withGCPAndContainerID(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvGCP(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvGCP(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigGCPWithContainerID(gcpProjectID, gcpRegion, projectID, clusterName, providerName, gcpClusterRegion, gcpPeeringName), @@ -899,9 +899,9 @@ func TestAccClusterRSCluster_withAutoScalingAWS(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAWSWithAutoscaling(orgID, projectName, name, "true", "false", "true", "false", minSize, maxSize, instanceSize), @@ -954,9 +954,9 @@ func TestAccClusterRSCluster_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAWS(orgID, projectName, clusterName, true, false), @@ -984,9 +984,9 @@ func TestAccClusterRSCluster_tenant(t *testing.T) { dbMajorVersion := testAccGetMongoDBAtlasMajorVersion() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigTenant(orgID, projectName, name, "M2", "2", dbMajorVersion), @@ -1024,9 +1024,9 @@ func TestAccClusterRSCluster_tenant_m5(t *testing.T) { dbMajorVersion := testAccGetMongoDBAtlasMajorVersion() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigTenant(orgID, projectName, name, "M5", "5", dbMajorVersion), @@ -1053,9 +1053,9 @@ func TestAccClusterRSCluster_basicGCPRegionNameWesternUS(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigGCPRegionName(orgID, projectName, clusterName, regionName), @@ -1079,9 +1079,9 @@ func TestAccClusterRSCluster_basicGCPRegionNameUSWest2(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigGCPRegionName(orgID, projectName, clusterName, regionName), @@ -1158,9 +1158,9 @@ func TestAccClusterRSCluster_RegionsConfig(t *testing.T) { }` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigRegions(orgID, projectName, clusterName, replications), @@ -1192,9 +1192,9 @@ func TestAccClusterRSCluster_basicAWS_UnpauseToPaused(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAWSPaused(orgID, projectName, name, true, false), @@ -1245,9 +1245,9 @@ func TestAccClusterRSCluster_basicAWS_PausedToUnpaused(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasClusterConfigAWSPaused(orgID, projectName, name, true, true), @@ -1301,7 +1301,7 @@ func testAccGetMongoDBAtlasMajorVersion() string { func testAccCheckMongoDBAtlasClusterExists(resourceName string, cluster *matlas.Cluster) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -1336,7 +1336,7 @@ func testAccCheckMongoDBAtlasClusterAttributes(cluster *matlas.Cluster, name str } func testAccCheckMongoDBAtlasClusterDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_cluster" { diff --git a/mongodbatlas/resource_mongodbatlas_custom_db_role_test.go b/mongodbatlas/resource_mongodbatlas_custom_db_role_test.go index f436973751..b6f6df650a 100644 --- a/mongodbatlas/resource_mongodbatlas_custom_db_role_test.go +++ b/mongodbatlas/resource_mongodbatlas_custom_db_role_test.go @@ -23,9 +23,9 @@ func TestAccConfigRSCustomDBRoles_Basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCustomDBRolesDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCustomDBRolesDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCustomDBRolesConfigBasic(orgID, projectName, roleName, "INSERT", fmt.Sprintf("test-acc-db_name-%s", acctest.RandString(5))), @@ -127,9 +127,9 @@ func TestAccConfigRSCustomDBRoles_WithInheritedRoles(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCustomDBRolesDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCustomDBRolesDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCustomDBRolesConfigWithInheritedRoles(orgID, projectName, inheritRole, testRole), @@ -330,9 +330,9 @@ func TestAccConfigRSCustomDBRoles_MultipleCustomRoles(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCustomDBRolesDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCustomDBRolesDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCustomDBRolesConfigMultiple(orgID, projectName, inheritRole, testRole), @@ -403,9 +403,9 @@ func TestAccConfigRSCustomDBRoles_MultipleResources(t *testing.T) { t.Run(roleName, func(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCustomDBRolesDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCustomDBRolesDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCustomDBRolesConfigBasic(orgID, projectName, roleName, "INSERT", fmt.Sprintf("test-acc-db_name-%s", acctest.RandString(5))), @@ -436,9 +436,9 @@ func TestAccConfigRSCustomDBRoles_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCustomDBRolesDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCustomDBRolesDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCustomDBRolesConfigBasic(orgID, projectName, roleName, "INSERT", databaseName), @@ -533,9 +533,9 @@ func TestAccConfigRSCustomDBRoles_UpdatedInheritRoles(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCustomDBRolesDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCustomDBRolesDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCustomDBRolesConfigMultiple(orgID, projectName, inheritRole, testRole), @@ -587,7 +587,7 @@ func TestAccConfigRSCustomDBRoles_UpdatedInheritRoles(t *testing.T) { func testAccCheckMongoDBAtlasCustomDBRolesExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -610,7 +610,7 @@ func testAccCheckMongoDBAtlasCustomDBRolesExists(resourceName string) resource.T } func testAccCheckMongoDBAtlasCustomDBRolesDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_custom_db_role" { diff --git a/mongodbatlas/resource_mongodbatlas_custom_dns_configuration_cluster_aws_test.go b/mongodbatlas/resource_mongodbatlas_custom_dns_configuration_cluster_aws_test.go index b87cc4ba17..76cab359fd 100644 --- a/mongodbatlas/resource_mongodbatlas_custom_dns_configuration_cluster_aws_test.go +++ b/mongodbatlas/resource_mongodbatlas_custom_dns_configuration_cluster_aws_test.go @@ -19,9 +19,9 @@ func TestAccConfigRSCustomDNSConfigurationAWS_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCustomDNSConfigurationAWSDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCustomDNSConfigurationAWSDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCustomDNSConfigurationAWSConfig(orgID, projectName, true), @@ -59,9 +59,9 @@ func TestAccConfigRSCustomDNSConfigurationAWS_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasCustomDNSConfigurationAWSDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasCustomDNSConfigurationAWSDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasCustomDNSConfigurationAWSConfig(orgID, projectName, true), @@ -82,7 +82,7 @@ func TestAccConfigRSCustomDNSConfigurationAWS_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasCustomDNSConfigurationAWSExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -102,7 +102,7 @@ func testAccCheckMongoDBAtlasCustomDNSConfigurationAWSExists(resourceName string } } func testAccCheckMongoDBAtlasCustomDNSConfigurationAWSDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_custom_dns_configuration_cluster_aws" { diff --git a/mongodbatlas/resource_mongodbatlas_data_lake_pipeline_test.go b/mongodbatlas/resource_mongodbatlas_data_lake_pipeline_test.go index 48fe3228bf..5f09f447ed 100644 --- a/mongodbatlas/resource_mongodbatlas_data_lake_pipeline_test.go +++ b/mongodbatlas/resource_mongodbatlas_data_lake_pipeline_test.go @@ -21,9 +21,9 @@ func TestAccClusterRSDataLakePipeline_basic(t *testing.T) { name = acctest.RandomWithPrefix("test-acc-index") ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataLakePipelineConfig(projectID, clusterName, name), @@ -59,7 +59,7 @@ func testAccCheckMongoDBAtlasDataLakePipelineImportStateIDFunc(resourceName stri func testAccCheckMongoDBAtlasDataLakePipelineExists(resourceName string, pipeline *matlas.DataLakePipeline) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/resource_mongodbatlas_data_lake_test.go b/mongodbatlas/resource_mongodbatlas_data_lake_test.go index 8f4f5a95da..3bd23f47c2 100644 --- a/mongodbatlas/resource_mongodbatlas_data_lake_test.go +++ b/mongodbatlas/resource_mongodbatlas_data_lake_test.go @@ -28,9 +28,9 @@ func TestAccBackupRSDataLake_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDataLakeDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDataLakeDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataLakeConfig(policyName, roleName, projectName, orgID, name, testS3Bucket, dataLakeRegion, false), @@ -63,9 +63,9 @@ func TestAccBackupRSDataLake_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDataLakeDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDataLakeDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDataLakeConfig(policyName, roleName, projectName, orgID, name, testS3Bucket, "", false), @@ -99,7 +99,7 @@ func testAccCheckMongoDBAtlasDataLakeImportStateIDFunc(resourceName, s3Bucket st func testAccCheckMongoDBAtlasDataLakeExists(resourceName string, dataLake *matlas.DataLake) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -133,7 +133,7 @@ func testAccCheckMongoDBAtlasDataLakeAttributes(dataLake *matlas.DataLake, name } func testAccCheckMongoDBAtlasDataLakeDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_data_lake" { diff --git a/mongodbatlas/resource_mongodbatlas_database_user_test.go b/mongodbatlas/resource_mongodbatlas_database_user_test.go index 4ba38c616b..2083db00ad 100644 --- a/mongodbatlas/resource_mongodbatlas_database_user_test.go +++ b/mongodbatlas/resource_mongodbatlas_database_user_test.go @@ -23,9 +23,9 @@ func TestAccConfigRSDatabaseUser_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserConfig(projectName, orgID, "atlasAdmin", username, "First Key", "First value"), @@ -66,9 +66,9 @@ func TestAccConfigRSDatabaseUser_withX509TypeCustomer(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserWithX509TypeConfig(projectName, orgID, "atlasAdmin", username, "First Key", "First value", x509Type), @@ -97,9 +97,9 @@ func TestAccConfigRSDatabaseUser_withX509TypeManaged(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserWithX509TypeConfig(projectName, orgID, "atlasAdmin", username, "First Key", "First value", x509Type), @@ -127,9 +127,9 @@ func TestAccConfigRSDatabaseUser_withAWSIAMType(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserWithAWSIAMTypeConfig(projectName, orgID, "atlasAdmin", username, "First Key", "First value"), @@ -161,9 +161,9 @@ func TestAccConfigRSDatabaseUser_withAWSIAMType_import(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserWithAWSIAMTypeConfig(projectName, orgID, "atlasAdmin", username, "First Key", "First value"), @@ -198,9 +198,9 @@ func TestAccConfigRSDatabaseUser_WithLabels(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserWithLabelsConfig(projectName, orgID, "atlasAdmin", username, []matlas.Label{}), @@ -279,9 +279,9 @@ func TestAccConfigRSDatabaseUser_withRoles(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserWithRoles(username, password, projectName, orgID, @@ -343,9 +343,9 @@ func TestAccConfigRSDatabaseUser_withScopes(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserWithScopes(username, password, projectName, orgID, "atlasAdmin", clusterName, @@ -405,9 +405,9 @@ func TestAccConfigRSDatabaseUser_withScopesAndEmpty(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserWithScopes(username, password, projectName, orgID, "atlasAdmin", clusterName, @@ -460,9 +460,9 @@ func TestAccConfigRSDatabaseUser_withLDAPAuthType(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserWithLDAPAuthTypeConfig(projectName, orgID, "atlasAdmin", username, "First Key", "First value"), @@ -489,9 +489,9 @@ func TestAccConfigRSDatabaseUser_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserConfig(projectName, orgID, "read", username, "First Key", "First value"), @@ -525,9 +525,9 @@ func TestAccConfigRSDatabaseUser_importX509TypeCustomer(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserWithX509TypeConfig(projectName, orgID, "atlasAdmin", username, "First Key", "First value", x509Type), @@ -562,9 +562,9 @@ func TestAccConfigRSDatabaseUser_importLDAPAuthType(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasDatabaseUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasDatabaseUserWithLDAPAuthTypeConfig(projectName, orgID, "atlasAdmin", username, "First Key", "First value"), @@ -604,7 +604,7 @@ func testAccCheckMongoDBAtlasDatabaseUserImportStateIDFunc(resourceName string) func testAccCheckMongoDBAtlasDatabaseUserExists(resourceName string, dbUser *matlas.DatabaseUser) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -639,7 +639,7 @@ func testAccCheckMongoDBAtlasDatabaseUserAttributes(dbUser *matlas.DatabaseUser, } func testAccCheckMongoDBAtlasDatabaseUserDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_database_user" { diff --git a/mongodbatlas/resource_mongodbatlas_encryption_at_rest_test.go b/mongodbatlas/resource_mongodbatlas_encryption_at_rest_test.go index 4835f74461..89a5c4ed23 100644 --- a/mongodbatlas/resource_mongodbatlas_encryption_at_rest_test.go +++ b/mongodbatlas/resource_mongodbatlas_encryption_at_rest_test.go @@ -120,9 +120,9 @@ func TestAccAdvRSEncryptionAtRest_basicAWS(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckAwsEnv(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasEncryptionAtRestDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckAwsEnv(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasEncryptionAtRestDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasEncryptionAtRestConfigAwsKms(projectID, &awsKms), @@ -174,9 +174,9 @@ func TestAccAdvRSEncryptionAtRest_basicAzure(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckEncryptionAtRestEnvAzure(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasEncryptionAtRestDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckEncryptionAtRestEnvAzure(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasEncryptionAtRestDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasEncryptionAtRestConfigAzureKeyVault(projectID, &azureKeyVault), @@ -216,9 +216,9 @@ func TestAccAdvRSEncryptionAtRest_basicGCP(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckGPCEnv(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasEncryptionAtRestDestroy, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckGPCEnv(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasEncryptionAtRestDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasEncryptionAtRestConfigGoogleCloudKms(projectID, &googleCloudKms), @@ -257,9 +257,9 @@ func TestAccAdvRSEncryptionAtRestWithRole_basicAWS(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckAwsEnv(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasEncryptionAtRestDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckAwsEnv(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasEncryptionAtRestDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasEncryptionAtRestConfigAwsKmsWithRole(awsKms.Region, accessKeyID, secretKey, projectID, policyName, roleName, false, &awsKms), @@ -277,7 +277,7 @@ func TestAccAdvRSEncryptionAtRestWithRole_basicAWS(t *testing.T) { func testAccCheckMongoDBAtlasEncryptionAtRestExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -297,7 +297,7 @@ func testAccCheckMongoDBAtlasEncryptionAtRestExists(resourceName string) resourc } func testAccCheckMongoDBAtlasEncryptionAtRestDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_encryption_at_rest" { diff --git a/mongodbatlas/resource_mongodbatlas_event_trigger_test.go b/mongodbatlas/resource_mongodbatlas_event_trigger_test.go index b694d5dbf1..92eea571ac 100644 --- a/mongodbatlas/resource_mongodbatlas_event_trigger_test.go +++ b/mongodbatlas/resource_mongodbatlas_event_trigger_test.go @@ -49,9 +49,9 @@ func TestAccConfigRSEventTriggerDatabase_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasEventTriggerDatabaseConfigDatabase(projectID, appID, `"INSERT", "UPDATE"`, &event, false, false), @@ -115,9 +115,9 @@ func TestAccConfigRSEventTriggerDatabase_eventProccesor(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasEventTriggerDatabaseConfigDatabaseEP(projectID, appID, `"INSERT", "UPDATE"`, awsAccountID, awsRegion, &event), @@ -174,9 +174,9 @@ func TestAccConfigRSEventTriggerAuth_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasEventTriggerDatabaseConfigAuthentication(projectID, appID, `"anon-user", "local-userpass"`, &event), @@ -235,9 +235,9 @@ func TestAccConfigRSEventTriggerAuth_eventProcessor(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasEventTriggerDatabaseConfigAuthenticationEP(projectID, appID, `"anon-user", "local-userpass"`, awsAccountID, awsRegion, &event), @@ -291,9 +291,9 @@ func TestAccConfigRSEventTriggerSchedule_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasEventTriggerDatabaseConfigSchedule(projectID, appID, &event), @@ -349,9 +349,9 @@ func TestAccConfigRSEventTriggerSchedule_eventProcessor(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasEventTriggerDatabaseConfigScheduleEP(projectID, appID, awsAccountID, awsRegion, &event), @@ -405,9 +405,9 @@ func TestAccConfigRSEventTriggerFunction_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasEventTriggerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasEventTriggerFunctionConfig(projectID, appID, &event), @@ -436,7 +436,7 @@ func TestAccConfigRSEventTriggerFunction_basic(t *testing.T) { func testAccCheckMongoDBAtlasEventTriggerExists(resourceName string, eventTrigger *realm.EventTrigger) resource.TestCheckFunc { return func(s *terraform.State) error { ctx := context.Background() - conn, err := testAccProvider.Meta().(*MongoDBClient).GetRealmClient(ctx) + conn, err := testAccProviderSdkV2.Meta().(*MongoDBClient).GetRealmClient(ctx) if err != nil { return err } @@ -466,7 +466,7 @@ func testAccCheckMongoDBAtlasEventTriggerExists(resourceName string, eventTrigge func testAccCheckMongoDBAtlasEventTriggerDestroy(s *terraform.State) error { ctx := context.Background() - conn, err := testAccProvider.Meta().(*MongoDBClient).GetRealmClient(ctx) + conn, err := testAccProviderSdkV2.Meta().(*MongoDBClient).GetRealmClient(ctx) if err != nil { return err } diff --git a/mongodbatlas/resource_mongodbatlas_federated_database_instance_test.go b/mongodbatlas/resource_mongodbatlas_federated_database_instance_test.go index fd4ba9f32d..89df015e48 100644 --- a/mongodbatlas/resource_mongodbatlas_federated_database_instance_test.go +++ b/mongodbatlas/resource_mongodbatlas_federated_database_instance_test.go @@ -25,19 +25,19 @@ func TestAccFederatedDatabaseInstance_basic(t *testing.T) { CheckDestroy: testAccCheckMongoDBAtlasFederatedDatabaseInstanceDestroy, Steps: []resource.TestStep{ { - ProviderFactories: testAccProviderFactories, - Config: testAccMongoDBAtlasFederatedDatabaseInstanceConfigFirstSteps(name, projectName, orgID), + ProtoV6ProviderFactories: testAccProviderV6Factories, + Config: testAccMongoDBAtlasFederatedDatabaseInstanceConfigFirstSteps(name, projectName, orgID), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttr(resourceName, "name", name), ), }, { - ResourceName: resourceName, - ProviderFactories: testAccProviderFactories, - ImportStateIdFunc: testAccCheckMongoDBAtlasFederatedDatabaseInstanceImportStateIDFunc(resourceName), - ImportState: true, - ImportStateVerify: true, + ResourceName: resourceName, + ProtoV6ProviderFactories: testAccProviderV6Factories, + ImportStateIdFunc: testAccCheckMongoDBAtlasFederatedDatabaseInstanceImportStateIDFunc(resourceName), + ImportState: true, + ImportStateVerify: true, }, }, }) @@ -67,19 +67,19 @@ func TestAccFederatedDatabaseInstance_S3bucket(t *testing.T) { Source: "hashicorp/aws", }, }, - ProviderFactories: testAccProviderFactories, - Config: testAccMongoDBAtlasFederatedDatabaseInstanceConfigS3Bucket(policyName, roleName, projectName, orgID, name, testS3Bucket, region), + ProtoV6ProviderFactories: testAccProviderV6Factories, + Config: testAccMongoDBAtlasFederatedDatabaseInstanceConfigS3Bucket(policyName, roleName, projectName, orgID, name, testS3Bucket, region), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttr(resourceName, "name", name), ), }, { - ResourceName: resourceName, - ProviderFactories: testAccProviderFactories, - ImportStateIdFunc: testAccCheckMongoDBAtlasFederatedDatabaseInstanceImportStateIDFuncS3Bucket(resourceName, testS3Bucket), - ImportState: true, - ImportStateVerify: true, + ResourceName: resourceName, + ProtoV6ProviderFactories: testAccProviderV6Factories, + ImportStateIdFunc: testAccCheckMongoDBAtlasFederatedDatabaseInstanceImportStateIDFuncS3Bucket(resourceName, testS3Bucket), + ImportState: true, + ImportStateVerify: true, }, }, }) @@ -99,8 +99,8 @@ func TestAccFederatedDatabaseInstance_atlasCluster(t *testing.T) { CheckDestroy: testAccCheckMongoDBAtlasFederatedDatabaseInstanceDestroy, Steps: []resource.TestStep{ { - ProviderFactories: testAccProviderFactories, - Config: testAccMongoDBAtlasFederatedDatabaseInstanceAtlasProviderConfig(projectName, orgID, name), + ProtoV6ProviderFactories: testAccProviderV6Factories, + Config: testAccMongoDBAtlasFederatedDatabaseInstanceAtlasProviderConfig(projectName, orgID, name), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttr(resourceName, "name", name), @@ -207,7 +207,7 @@ func testAccCheckMongoDBAtlasFederatedDatabaseInstanceImportStateIDFunc(resource } func testAccCheckMongoDBAtlasFederatedDatabaseInstanceDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_federated_database_instance" { diff --git a/mongodbatlas/resource_mongodbatlas_federated_query_limit_test.go b/mongodbatlas/resource_mongodbatlas_federated_query_limit_test.go index 1450f69247..da1305f9fc 100644 --- a/mongodbatlas/resource_mongodbatlas_federated_query_limit_test.go +++ b/mongodbatlas/resource_mongodbatlas_federated_query_limit_test.go @@ -36,8 +36,8 @@ func TestAccFederatedDatabaseQueryLimit_basic(t *testing.T) { Source: "hashicorp/aws", }, }, - ProviderFactories: testAccProviderFactories, - Config: testAccMongoDBAtlasFederatedDatabaseQueryLimitConfig(policyName, roleName, projectName, orgID, tenantName, testS3Bucket, region), + ProtoV6ProviderFactories: testAccProviderV6Factories, + Config: testAccMongoDBAtlasFederatedDatabaseQueryLimitConfig(policyName, roleName, projectName, orgID, tenantName, testS3Bucket, region), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttrSet(resourceName, "tenant_name"), @@ -45,11 +45,11 @@ func TestAccFederatedDatabaseQueryLimit_basic(t *testing.T) { ), }, { - ResourceName: resourceName, - ProviderFactories: testAccProviderFactories, - ImportStateIdFunc: testAccCheckMongoDBAtlasFederatedDatabaseQueryLimitImportStateIDFunc(resourceName), - ImportState: true, - ImportStateVerify: true, + ResourceName: resourceName, + ProtoV6ProviderFactories: testAccProviderV6Factories, + ImportStateIdFunc: testAccCheckMongoDBAtlasFederatedDatabaseQueryLimitImportStateIDFunc(resourceName), + ImportState: true, + ImportStateVerify: true, }, }, }) @@ -206,7 +206,7 @@ func testAccCheckMongoDBAtlasFederatedDatabaseQueryLimitImportStateIDFunc(resour } func testAccCheckMongoDBAtlasFederatedDatabaseQueryLimitDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_federated_query_limit" { diff --git a/mongodbatlas/resource_mongodbatlas_federated_settings_connected_organization_test.go b/mongodbatlas/resource_mongodbatlas_federated_settings_connected_organization_test.go index df5042a353..f18c1abb40 100644 --- a/mongodbatlas/resource_mongodbatlas_federated_settings_connected_organization_test.go +++ b/mongodbatlas/resource_mongodbatlas_federated_settings_connected_organization_test.go @@ -21,8 +21,8 @@ func TestAccFedRSFederatedSettingsOrganizationConfig_basic(t *testing.T) { idpID = os.Getenv("MONGODB_ATLAS_FEDERATED_IDP_ID") ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasFederatedSettingsOrganizationConfig(federationSettingsID, orgID, idpID), @@ -57,8 +57,8 @@ func TestAccFedRSFederatedSettingsOrganizationConfig_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { @@ -75,7 +75,7 @@ func TestAccFedRSFederatedSettingsOrganizationConfig_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasFederatedSettingsOrganizationConfigRExists(resourceName string, federatedSettingsIdentityProvider *matlas.FederatedSettingsConnectedOrganization) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/resource_mongodbatlas_federated_settings_identity_provider_test.go b/mongodbatlas/resource_mongodbatlas_federated_settings_identity_provider_test.go index 4bfdf9ba1a..6d6d5e277a 100644 --- a/mongodbatlas/resource_mongodbatlas_federated_settings_identity_provider_test.go +++ b/mongodbatlas/resource_mongodbatlas_federated_settings_identity_provider_test.go @@ -22,8 +22,8 @@ func TestAccFedRSFederatedSettingsIdentityProvider_basic(t *testing.T) { issuerURI = os.Getenv("MONGODB_ATLAS_FEDERATED_ISSUER_URI") ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasFederatedSettingsIdentityProviderConfig(federationSettingsID, ssoURL, issuerURI), @@ -59,8 +59,8 @@ func TestAccFedRSFederatedSettingsIdentityProvider_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { @@ -77,7 +77,7 @@ func TestAccFedRSFederatedSettingsIdentityProvider_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasFederatedSettingsIdentityProviderExists(resourceName string, federatedSettingsIdentityProvider *matlas.FederatedSettingsIdentityProvider, idpID string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/resource_mongodbatlas_federated_settings_organization_role_mapping_test.go b/mongodbatlas/resource_mongodbatlas_federated_settings_organization_role_mapping_test.go index 33647f1d9b..6f6cc71752 100644 --- a/mongodbatlas/resource_mongodbatlas_federated_settings_organization_role_mapping_test.go +++ b/mongodbatlas/resource_mongodbatlas_federated_settings_organization_role_mapping_test.go @@ -21,9 +21,9 @@ func TestAccFedRSFederatedSettingsOrganizationRoleMapping_basic(t *testing.T) { groupID = os.Getenv("MONGODB_ATLAS_FEDERATED_GROUP_ID") ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasFederatedSettingsOrganizationRoleMappingDestroy, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasFederatedSettingsOrganizationRoleMappingDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasFederatedSettingsOrganizationRoleMappingConfig(federationSettingsID, orgID, groupID), @@ -49,9 +49,9 @@ func TestAccFedRSFederatedSettingsOrganizationRoleMapping_importBasic(t *testing ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testCheckFederatedSettings(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasFederatedSettingsOrganizationRoleMappingDestroy, + PreCheck: func() { testCheckFederatedSettings(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasFederatedSettingsOrganizationRoleMappingDestroy, Steps: []resource.TestStep{ { @@ -68,7 +68,7 @@ func TestAccFedRSFederatedSettingsOrganizationRoleMapping_importBasic(t *testing func testAccCheckMongoDBAtlasFederatedSettingsOrganizationRoleMappingExists(resourceName string, federatedSettingsOrganizationRoleMapping *matlas.FederatedSettingsOrganizationRoleMapping) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -94,7 +94,7 @@ func testAccCheckMongoDBAtlasFederatedSettingsOrganizationRoleMappingExists(reso } func testAccCheckMongoDBAtlasFederatedSettingsOrganizationRoleMappingDestroy(state *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range state.RootModule().Resources { if rs.Type != "mongodbatlas_federated_settings_org_role_mapping" { diff --git a/mongodbatlas/resource_mongodbatlas_global_cluster_config_test.go b/mongodbatlas/resource_mongodbatlas_global_cluster_config_test.go index f8f00dbad2..95fec2d0a5 100644 --- a/mongodbatlas/resource_mongodbatlas_global_cluster_config_test.go +++ b/mongodbatlas/resource_mongodbatlas_global_cluster_config_test.go @@ -22,9 +22,9 @@ func TestAccClusterRSGlobalCluster_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasGlobalClusterDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasGlobalClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasGlobalClusterConfig(projectID, name, "false", "false", "false"), @@ -72,9 +72,9 @@ func TestAccClusterRSGlobalCluster_WithAWSCluster(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasGlobalClusterDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasGlobalClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasGlobalClusterWithAWSClusterConfig(projectID, name, "true"), @@ -101,9 +101,9 @@ func TestAccClusterRSGlobalCluster_importBasic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasGlobalClusterDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasGlobalClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasGlobalClusterConfig(projectID, name, "false", "false", "false"), @@ -159,9 +159,9 @@ func TestAccClusterRSGlobalCluster_database(t *testing.T) { }` resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasGlobalClusterDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasGlobalClusterDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasGlobalClusterWithDBConfig(projectID, name, "false", customZone), @@ -207,7 +207,7 @@ func TestAccClusterRSGlobalCluster_database(t *testing.T) { func testAccCheckMongoDBAtlasGlobalClusterExists(resourceName string, globalConfig *matlas.GlobalCluster) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -257,7 +257,7 @@ func testAccCheckMongoDBAtlasGlobalClusterAttributes(globalCluster *matlas.Globa } func testAccCheckMongoDBAtlasGlobalClusterDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_global_cluster_config" { diff --git a/mongodbatlas/resource_mongodbatlas_ldap_configuration_test.go b/mongodbatlas/resource_mongodbatlas_ldap_configuration_test.go index fd872fec46..2078b9e3d0 100644 --- a/mongodbatlas/resource_mongodbatlas_ldap_configuration_test.go +++ b/mongodbatlas/resource_mongodbatlas_ldap_configuration_test.go @@ -28,9 +28,9 @@ func TestAccAdvRSLDAPConfiguration_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasLDAPConfigurationDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasLDAPConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasLDAPConfigurationConfig(projectName, orgID, hostname, username, password, authEnabled, cast.ToInt(port)), @@ -65,9 +65,9 @@ func TestAccAdvRSLDAPConfigurationWithVerify_CACertificateComplete(t *testing.T) ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasLDAPConfigurationDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasLDAPConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasLDAPConfigurationWithVerifyConfig(projectName, orgID, clusterName, hostname, username, password, caCertificate, cast.ToInt(port), true), @@ -113,9 +113,9 @@ func TestAccAdvRSLDAPConfiguration_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasLDAPConfigurationDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasLDAPConfigurationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasLDAPConfigurationConfig(projectName, orgID, hostname, username, password, authEnabled, port), @@ -142,7 +142,7 @@ func TestAccAdvRSLDAPConfiguration_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasLDAPConfigurationExists(resourceName string, ldapConf *matlas.LDAPConfiguration) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -165,7 +165,7 @@ func testAccCheckMongoDBAtlasLDAPConfigurationExists(resourceName string, ldapCo } func testAccCheckMongoDBAtlasLDAPConfigurationDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_ldap_configuration" { diff --git a/mongodbatlas/resource_mongodbatlas_ldap_verify_test.go b/mongodbatlas/resource_mongodbatlas_ldap_verify_test.go index 9222963f50..b9e67e2861 100644 --- a/mongodbatlas/resource_mongodbatlas_ldap_verify_test.go +++ b/mongodbatlas/resource_mongodbatlas_ldap_verify_test.go @@ -30,9 +30,9 @@ func TestAccAdvRSLDAPVerify_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasLDAPVerifyDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasLDAPVerifyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasLDAPVerifyConfig(projectName, orgID, clusterName, hostname, username, password, cast.ToInt(port)), @@ -66,9 +66,9 @@ func TestAccAdvRSLDAPVerifyWithConfiguration_CACertificate(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasLDAPVerifyDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasLDAPVerifyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasLDAPVerifyWithConfigurationConfig(projectName, orgID, clusterName, hostname, username, password, caCertificate, cast.ToInt(port), true), @@ -108,9 +108,9 @@ func TestAccAdvRSLDAPVerify_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasLDAPVerifyDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckLDAP(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasLDAPVerifyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasLDAPVerifyConfig(projectName, orgID, clusterName, hostname, username, password, cast.ToInt(port)), @@ -137,7 +137,7 @@ func TestAccAdvRSLDAPVerify_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasLDAPVerifyExists(resourceName string, ldapConf *matlas.LDAPConfiguration) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -160,7 +160,7 @@ func testAccCheckMongoDBAtlasLDAPVerifyExists(resourceName string, ldapConf *mat } func testAccCheckMongoDBAtlasLDAPVerifyDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_ldap_verify" { diff --git a/mongodbatlas/resource_mongodbatlas_maintenance_window_test.go b/mongodbatlas/resource_mongodbatlas_maintenance_window_test.go index fb934b491f..b47b9a8f86 100644 --- a/mongodbatlas/resource_mongodbatlas_maintenance_window_test.go +++ b/mongodbatlas/resource_mongodbatlas_maintenance_window_test.go @@ -28,8 +28,8 @@ func TestAccConfigRSMaintenanceWindow_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasMaintenanceWindowConfig(orgID, projectName, dayOfWeek, hourOfDay), @@ -72,8 +72,8 @@ func TestAccConfigRSMaintenanceWindow_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasMaintenanceWindowConfig(orgID, projectName, dayOfWeek, hourOfDay), @@ -110,8 +110,8 @@ func TestAccConfigRSMaintenanceWindow_autoDeferActivated(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasMaintenanceWindowConfigAutoDeferEnabled(orgID, projectName, dayOfWeek, hourOfDay), @@ -147,7 +147,7 @@ func testAccMongoDBAtlasMaintenanceWindowConfigAutoDeferEnabled(orgID, projectNa func testAccCheckMongoDBAtlasMaintenanceWindowExists(resourceName string, maintenance *matlas.MaintenanceWindow) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/resource_mongodbatlas_network_container_test.go b/mongodbatlas/resource_mongodbatlas_network_container_test.go index 52dcb414ac..4dad6ac08b 100644 --- a/mongodbatlas/resource_mongodbatlas_network_container_test.go +++ b/mongodbatlas/resource_mongodbatlas_network_container_test.go @@ -29,9 +29,9 @@ func TestAccNetworkRSNetworkContainer_basicAWS(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkContainerDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkContainerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasNetworkContainerConfigAWS(projectName, orgID, cidrBlock, providerName, "US_EAST_1"), @@ -79,9 +79,9 @@ func TestAccNetworkRSNetworkContainer_basicAzure(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkContainerDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkContainerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasNetworkContainerConfigAzure(projectName, orgID, cidrBlock, providerName), @@ -121,9 +121,9 @@ func TestAccNetworkRSNetworkContainer_basicGCP(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkContainerDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkContainerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasNetworkContainerConfigGCP(projectName, orgID, cidrBlock, providerName), @@ -163,9 +163,9 @@ func TestAccNetworkRSNetworkContainer_WithRegionsGCP(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkContainerDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkContainerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasNetworkContainerConfigGCPWithRegions(projectName, orgID, cidrBlock, providerName), @@ -198,9 +198,9 @@ func TestAccNetworkRSNetworkContainer_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkContainerDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkContainerDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasNetworkContainerConfigAWS(projectName, orgID, cidrBlock, providerName, "US_EAST_1"), @@ -229,7 +229,7 @@ func testAccCheckMongoDBAtlasNetworkContainerImportStateIDFunc(resourceName stri func testAccCheckMongoDBAtlasNetworkContainerExists(resourceName string, container *matlas.Container) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -262,7 +262,7 @@ func testAccCheckMongoDBAtlasNetworkContainerAttributes(container *matlas.Contai } func testAccCheckMongoDBAtlasNetworkContainerDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_container" { diff --git a/mongodbatlas/resource_mongodbatlas_network_peering_test.go b/mongodbatlas/resource_mongodbatlas_network_peering_test.go index c685dc2786..a68171b6b1 100644 --- a/mongodbatlas/resource_mongodbatlas_network_peering_test.go +++ b/mongodbatlas/resource_mongodbatlas_network_peering_test.go @@ -28,9 +28,9 @@ func TestAccNetworkRSNetworkPeering_basicAWS(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvAWS(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvAWS(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasNetworkPeeringConfigAWS(projectID, providerName, vpcID, awsAccountID, vpcCIDRBlock, awsRegion), @@ -68,9 +68,9 @@ func TestAccNetworkRSNetworkPeering_basicAzure(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvAzure(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvAzure(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasNetworkPeeringConfigAzure(projectID, providerName, directoryID, subscriptionID, resourceGroupName, vNetName), @@ -106,9 +106,9 @@ func TestAccNetworkRSNetworkPeering_basicGCP(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvGCP(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckPeeringEnvGCP(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasNetworkPeeringConfigGCP(projectID, providerName, gcpProjectID, networkName), @@ -158,8 +158,8 @@ func TestAccNetworkRSNetworkPeering_AWSDifferentRegionName(t *testing.T) { } }() }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasNetworkPeeringDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasNetworkPeeringConfigAWSWithDifferentRegionName(projectID, providerName, containerRegion, peerRegion, vpcCIDRBlock, vpcID, awsAccountID), @@ -212,7 +212,7 @@ func testAccCheckMongoDBAtlasNetworkPeeringImportStateIDFunc(resourceName string func testAccCheckMongoDBAtlasNetworkPeeringExists(resourceName string, peer *matlas.Peer) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -238,7 +238,7 @@ func testAccCheckMongoDBAtlasNetworkPeeringExists(resourceName string, peer *mat } func testAccCheckMongoDBAtlasNetworkPeeringDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_network_peering" { diff --git a/mongodbatlas/resource_mongodbatlas_online_archive_test.go b/mongodbatlas/resource_mongodbatlas_online_archive_test.go index d6d023a964..8833e10745 100644 --- a/mongodbatlas/resource_mongodbatlas_online_archive_test.go +++ b/mongodbatlas/resource_mongodbatlas_online_archive_test.go @@ -25,9 +25,9 @@ func TestAccBackupRSOnlineArchive(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { // We need this step to pupulate the cluster with Sample Data @@ -113,9 +113,9 @@ func TestAccBackupRSOnlineArchiveBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasClusterDestroy, Steps: []resource.TestStep{ { // We need this step to pupulate the cluster with Sample Data @@ -152,7 +152,7 @@ func TestAccBackupRSOnlineArchiveBasic(t *testing.T) { func populateWithSampleData(resourceName string, cluster *matlas.Cluster) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/resource_mongodbatlas_org_invitation_test.go b/mongodbatlas/resource_mongodbatlas_org_invitation_test.go index f202c7b810..d8fd11eb98 100644 --- a/mongodbatlas/resource_mongodbatlas_org_invitation_test.go +++ b/mongodbatlas/resource_mongodbatlas_org_invitation_test.go @@ -24,9 +24,9 @@ func TestAccConfigRSOrgInvitation_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasOrgInvitationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasOrgInvitationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasOrgInvitationConfig(orgID, name, initialRole), @@ -64,9 +64,9 @@ func TestAccConfigRSOrgInvitation_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasOrgInvitationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasOrgInvitationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasOrgInvitationConfig(orgID, name, initialRole), @@ -92,7 +92,7 @@ func TestAccConfigRSOrgInvitation_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasOrgInvitationExists(t *testing.T, resourceName string, invitation *matlas.Invitation) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -148,7 +148,7 @@ func testAccCheckMongoDBAtlasOrgInvitationRoleAttribute(invitation *matlas.Invit } func testAccCheckMongoDBAtlasOrgInvitationDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_invitations" { diff --git a/mongodbatlas/resource_mongodbatlas_organization_test.go b/mongodbatlas/resource_mongodbatlas_organization_test.go index e0524acc64..91dc3b4f71 100644 --- a/mongodbatlas/resource_mongodbatlas_organization_test.go +++ b/mongodbatlas/resource_mongodbatlas_organization_test.go @@ -23,9 +23,9 @@ func TestAccConfigRSOrganization_Basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasOrganizationDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasOrganizationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasOrganizationConfigBasic(orgOwnerID, name, description, roleName), @@ -51,9 +51,9 @@ func TestAccConfigRSOrganization_importBasic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasOrganizationDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasOrganizationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasOrganizationConfigBasic(orgOwnerID, name, description, roleName), @@ -70,7 +70,7 @@ func TestAccConfigRSOrganization_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasOrganizationExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -99,7 +99,7 @@ func testAccCheckMongoDBAtlasOrganizationExists(resourceName string) resource.Te } func testAccCheckMongoDBAtlasOrganizationDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_organization" { diff --git a/mongodbatlas/resource_mongodbatlas_private_endpoint_regional_mode_test.go b/mongodbatlas/resource_mongodbatlas_private_endpoint_regional_mode_test.go index 446eb86ad5..5b0dbf4627 100644 --- a/mongodbatlas/resource_mongodbatlas_private_endpoint_regional_mode_test.go +++ b/mongodbatlas/resource_mongodbatlas_private_endpoint_regional_mode_test.go @@ -41,9 +41,9 @@ func TestAccNetworkRSPrivateEndpointRegionalMode_conn(t *testing.T) { dependencies := []string{clusterResource, clusterDataSource, endpointResources} resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateEndpointRegionalModeDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateEndpointRegionalModeDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateEndpointRegionalModeConfigWithDependencies(resourceSuffix, projectID, false, dependencies), @@ -77,9 +77,9 @@ func TestAccNetworkRSPrivateEndpointRegionalMode_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateEndpointRegionalModeDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateEndpointRegionalModeDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateEndpointRegionalModeConfig(resourceSuffix, projectID, false), @@ -146,7 +146,7 @@ func testAccMongoDBAtlasPrivateEndpointRegionalModeConfig(resourceName, projectI func testAccCheckMongoDBAtlasPrivateEndpointRegionalModeExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { fmt.Printf("==========================================================================\n") - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] @@ -173,7 +173,7 @@ func testAccCheckMongoDBAtlasPrivateEndpointRegionalModeExists(resourceName stri func testAccCheckMongoDBAtlasPrivateEndpointRegionalModeClustersUpToDate(projectID, clusterName, clusterResourceName string) resource.TestCheckFunc { resourceName := strings.Join([]string{"data", "mongodbatlas_cluster", clusterResourceName}, ".") return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] @@ -210,7 +210,7 @@ func testAccCheckMongoDBAtlasPrivateEndpointRegionalModeClustersUpToDate(project } func testAccCheckMongoDBAtlasPrivateEndpointRegionalModeDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_private_endpoint_regional_mode" { diff --git a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_serverless_test.go b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_serverless_test.go index 9095b8023a..f2cf8d6891 100644 --- a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_serverless_test.go +++ b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_serverless_test.go @@ -20,9 +20,9 @@ func TestAccServerlessPrivateLinkEndpoint_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointServerlessDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointServerlessDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointServerlessConfig(orgID, projectName, instanceName, true), @@ -43,9 +43,9 @@ func TestAccServerlessPrivateLinkEndpoint_importBasic(t *testing.T) { instanceName = "serverlessimport" ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointServerlessDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointServerlessDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointServerlessConfig(orgID, projectName, instanceName, true), @@ -66,7 +66,7 @@ func TestAccServerlessPrivateLinkEndpoint_importBasic(t *testing.T) { } func testAccCheckMongoDBAtlasPrivateLinkEndpointServerlessDestroy(state *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range state.RootModule().Resources { if rs.Type != "mongodbatlas_privatelink_endpoint_serverless" { @@ -99,7 +99,7 @@ func testAccMongoDBAtlasPrivateLinkEndpointServerlessConfig(orgID, projectName, func testAccCheckMongoDBAtlasPrivateLinkEndpointServerlessExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_adl_test.go b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_adl_test.go index 573d887216..7dba01f72b 100644 --- a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_adl_test.go +++ b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_adl_test.go @@ -20,9 +20,9 @@ func TestAccNetworkRSPrivateLinkEndpointServiceADL_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointServiceADLDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointServiceADLDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointServiceADLConfig(projectID, endpointID, commentOrigin), @@ -56,9 +56,9 @@ func TestAccNetworkRSPrivateLinkEndpointServiceADL_importBasic(t *testing.T) { commentOrigin = "this is a comment for adl private link endpoint" ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointServiceADLConfig(projectID, endpointID, commentOrigin), @@ -81,7 +81,7 @@ func TestAccNetworkRSPrivateLinkEndpointServiceADL_importBasic(t *testing.T) { } func testAccCheckMongoDBAtlasPrivateLinkEndpointServiceADLDestroy(state *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range state.RootModule().Resources { if rs.Type != "mongodbatlas_privatelink_endpoint_service_adl" { @@ -113,7 +113,7 @@ func testAccMongoDBAtlasPrivateLinkEndpointServiceADLConfig(projectID, endpointI func testAccCheckMongoDBAtlasPrivateLinkEndpointServiceADLExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_data_federation_online_archive_test.go b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_data_federation_online_archive_test.go index 791698f976..1b6fec8f64 100644 --- a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_data_federation_online_archive_test.go +++ b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_data_federation_online_archive_test.go @@ -19,9 +19,9 @@ var ( func TestAccMongoDBAtlasPrivatelinkEndpointServiceDataFederationOnlineArchive_basic(t *testing.T) { testCheckPrivateEndpointServiceDataFederationOnlineArchiveRun(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateEndpointServiceDataFederationOnlineArchiveDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateEndpointServiceDataFederationOnlineArchiveDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateEndpointServiceDataFederationOnlineArchiveConfig(projectID, endpointID), @@ -58,7 +58,7 @@ func testAccCheckMongoDBAtlasPrivatelinkEndpointServiceDataFederationOnlineArchi } func testAccCheckMongoDBAtlasPrivateEndpointServiceDataFederationOnlineArchiveDestroy(s *terraform.State) error { - client := testAccProvider.Meta().(*MongoDBClient).Atlas + client := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_privatelink_endpoint_service_data_federation_online_archive" { @@ -79,7 +79,7 @@ func testAccCheckMongoDBAtlasPrivateEndpointServiceDataFederationOnlineArchiveDe func testAccCheckMongoDBAtlasPrivateEndpointServiceDataFederationOnlineArchiveExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - client := testAccProvider.Meta().(*MongoDBClient).Atlas + client := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] diff --git a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_serverless_test.go b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_serverless_test.go index 8b7b2a1ef6..e61f0d8780 100644 --- a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_serverless_test.go +++ b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_serverless_test.go @@ -23,9 +23,9 @@ func TestAccServerlessPrivateLinkEndpointService_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointServiceServerlessDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointServiceServerlessDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointServiceServerlessConfig(orgID, projectName, instanceName, commentOrigin), @@ -52,9 +52,9 @@ func TestAccServerlessPrivateLinkEndpointService_importBasic(t *testing.T) { commentOrigin = "this is a comment for serverless private link endpoint" ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointServiceServerlessConfig(orgID, projectName, instanceName, commentOrigin), @@ -75,7 +75,7 @@ func TestAccServerlessPrivateLinkEndpointService_importBasic(t *testing.T) { } func testAccCheckMongoDBAtlasPrivateLinkEndpointServiceServerlessDestroy(state *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range state.RootModule().Resources { if rs.Type != "mongodbatlas_privatelink_endpoint_service_serverless" { @@ -150,7 +150,7 @@ func testAccMongoDBAtlasPrivateLinkEndpointServiceServerlessConfig(orgID, projec func testAccCheckMongoDBAtlasPrivateLinkEndpointServiceServerlessExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { diff --git a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_test.go b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_test.go index 9569aa013b..3a7a574a42 100644 --- a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_test.go +++ b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_service_test.go @@ -28,9 +28,9 @@ func TestAccNetworkRSPrivateLinkEndpointServiceAWS_Complete(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckAwsEnv(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointServiceDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckAwsEnv(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointServiceDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointServiceConfigCompleteAWS( @@ -65,9 +65,9 @@ func TestAccNetworkRSPrivateLinkEndpointServiceAWS_import(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testCheckAwsEnv(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointServiceDestroy, + PreCheck: func() { testAccPreCheck(t); testCheckAwsEnv(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointServiceDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointServiceConfigCompleteAWS( @@ -106,7 +106,7 @@ func testAccCheckMongoDBAtlasPrivateLinkEndpointServiceImportStateIDFunc(resourc func testAccCheckMongoDBAtlasPrivateLinkEndpointServiceExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -129,7 +129,7 @@ func testAccCheckMongoDBAtlasPrivateLinkEndpointServiceExists(resourceName strin } func testAccCheckMongoDBAtlasPrivateLinkEndpointServiceDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_privatelink_endpoint_service" { diff --git a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_test.go b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_test.go index 18b8c5cbbc..e745f5b834 100644 --- a/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_test.go +++ b/mongodbatlas/resource_mongodbatlas_privatelink_endpoint_test.go @@ -21,9 +21,9 @@ func TestAccNetworkRSPrivateLinkEndpointAWS_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointConfigBasic(orgID, projectName, providerName, region), @@ -50,9 +50,9 @@ func TestAccNetworkRSPrivateLinkEndpointAWS_import(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointConfigBasic(orgID, projectName, providerName, region), @@ -84,9 +84,9 @@ func TestAccNetworkRSPrivateLinkEndpointAzure_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointConfigBasic(orgID, projectName, providerName, region), @@ -113,9 +113,9 @@ func TestAccNetworkRSPrivateLinkEndpointAzure_import(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointConfigBasic(orgID, projectName, providerName, region), @@ -148,9 +148,9 @@ func TestAccNetworkRSPrivateLinkEndpointGCP_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasPrivateLinkEndpointDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasPrivateLinkEndpointConfigBasic(orgID, projectName, providerName, region), @@ -188,7 +188,7 @@ func testAccCheckMongoDBAtlasPrivateLinkEndpointImportStateIDFunc(resourceName s func testAccCheckMongoDBAtlasPrivateLinkEndpointExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -210,7 +210,7 @@ func testAccCheckMongoDBAtlasPrivateLinkEndpointExists(resourceName string) reso } func testAccCheckMongoDBAtlasPrivateLinkEndpointDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_privatelink_endpoint" { diff --git a/mongodbatlas/resource_mongodbatlas_project_api_key_test.go b/mongodbatlas/resource_mongodbatlas_project_api_key_test.go index 6da5c0023f..d432d85d22 100644 --- a/mongodbatlas/resource_mongodbatlas_project_api_key_test.go +++ b/mongodbatlas/resource_mongodbatlas_project_api_key_test.go @@ -23,9 +23,9 @@ func TestAccConfigRSProjectAPIKey_Basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectAPIKeyConfigBasic(orgID, projectName, description, roleName), @@ -49,9 +49,9 @@ func TestAccConfigRSProjectAPIKey_Multiple(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectAPIKeyConfigMultiple(orgID, projectName, description, roleName), @@ -76,9 +76,9 @@ func TestAccConfigRSProjectAPIKey_UpdateDescription(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectAPIKeyConfigBasic(orgID, projectName, description, roleName), @@ -110,9 +110,9 @@ func TestAccConfigRSProjectAPIKey_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectAPIKeyDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectAPIKeyConfigBasic(orgID, projectName, description, roleName), @@ -140,9 +140,9 @@ func TestAccConfigRSProjectAPIKey_RecreateWhenDeletedExternally(t *testing.T) { projectAPIKeyConfig := testAccMongoDBAtlasProjectAPIKeyConfigBasic(orgID, projectName, description, roleName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectAPIKeyDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectAPIKeyDestroy, Steps: []resource.TestStep{ { Config: projectAPIKeyConfig, @@ -166,7 +166,7 @@ func TestAccConfigRSProjectAPIKey_RecreateWhenDeletedExternally(t *testing.T) { } func deleteAPIKeyManually(orgID, descriptionPrefix string) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas list, _, err := conn.APIKeys.List(context.Background(), orgID, &matlas.ListOptions{}) if err != nil { return err @@ -182,7 +182,7 @@ func deleteAPIKeyManually(orgID, descriptionPrefix string) error { } func testAccCheckMongoDBAtlasProjectAPIKeyDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_project_api_key" { diff --git a/mongodbatlas/resource_mongodbatlas_project_invitation_test.go b/mongodbatlas/resource_mongodbatlas_project_invitation_test.go index ff7ed39efb..a8e89a9a8e 100644 --- a/mongodbatlas/resource_mongodbatlas_project_invitation_test.go +++ b/mongodbatlas/resource_mongodbatlas_project_invitation_test.go @@ -25,9 +25,9 @@ func TestAccProjectRSProjectInvitation_basic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectInvitationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectInvitationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectInvitationConfig(orgID, projectName, name, initialRole), @@ -71,9 +71,9 @@ func TestAccProjectRSProjectInvitation_importBasic(t *testing.T) { ) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectInvitationDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectInvitationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectInvitationConfig(orgID, projectName, name, initialRole), @@ -98,7 +98,7 @@ func TestAccProjectRSProjectInvitation_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasProjectInvitationExists(t *testing.T, resourceName string, invitation *matlas.Invitation) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -156,7 +156,7 @@ func testAccCheckMongoDBAtlasProjectInvitationRoleAttribute(invitation *matlas.I } func testAccCheckMongoDBAtlasProjectInvitationDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_invitations" { diff --git a/mongodbatlas/resource_mongodbatlas_project_ip_access_list_test.go b/mongodbatlas/resource_mongodbatlas_project_ip_access_list_test.go index 8812e0c78f..2b43b3291d 100644 --- a/mongodbatlas/resource_mongodbatlas_project_ip_access_list_test.go +++ b/mongodbatlas/resource_mongodbatlas_project_ip_access_list_test.go @@ -22,9 +22,9 @@ func TestAccProjectRSProjectIPAccesslist_SettingIPAddress(t *testing.T) { updatedComment := fmt.Sprintf("TestAcc for ipAddress updated (%s)", updatedIPAddress) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectIPAccessListDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectIPAccessListDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectIPAccessListConfigSettingIPAddress(orgID, projectName, ipAddress, comment), @@ -63,9 +63,9 @@ func TestAccProjectRSProjectIPAccessList_SettingCIDRBlock(t *testing.T) { updatedComment := fmt.Sprintf("TestAcc for cidrBlock updated (%s)", updatedCIDRBlock) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectIPAccessListDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectIPAccessListDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectIPAccessListConfigSettingCIDRBlock(orgID, projectName, cidrBlock, comment), @@ -110,9 +110,9 @@ func TestAccProjectRSProjectIPAccessList_SettingAWSSecurityGroup(t *testing.T) { updatedComment := fmt.Sprintf("TestAcc for awsSecurityGroup updated (%s)", updatedAWSSgroup) resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectIPAccessListDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectIPAccessListDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectIPAccessListConfigSettingAWSSecurityGroup(projectID, providerName, vpcID, awsAccountID, vpcCIDRBlock, awsRegion, awsSGroup, comment), @@ -172,9 +172,9 @@ func TestAccProjectRSProjectIPAccessList_SettingMultiple(t *testing.T) { //TODO: make testAccCheckMongoDBAtlasProjectIPAccessListExists dynamic resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectIPAccessListDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectIPAccessListDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectIPAccessListConfigSettingMultiple(projectName, orgID, accessList, false), @@ -204,9 +204,9 @@ func TestAccProjectRSProjectIPAccessList_importBasic(t *testing.T) { resourceName := "mongodbatlas_project_ip_access_list.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectIPAccessListDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectIPAccessListDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectIPAccessListConfigSettingIPAddress(orgID, projectName, ipAddress, comment), @@ -223,7 +223,7 @@ func TestAccProjectRSProjectIPAccessList_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasProjectIPAccessListExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -246,7 +246,7 @@ func testAccCheckMongoDBAtlasProjectIPAccessListExists(resourceName string) reso } func testAccCheckMongoDBAtlasProjectIPAccessListDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_project_ip_access_list" { diff --git a/mongodbatlas/resource_mongodbatlas_project_test.go b/mongodbatlas/resource_mongodbatlas_project_test.go index eec2b6940a..9465d576e4 100644 --- a/mongodbatlas/resource_mongodbatlas_project_test.go +++ b/mongodbatlas/resource_mongodbatlas_project_test.go @@ -33,9 +33,9 @@ func TestAccProjectRSProject_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, + PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectConfig(projectName, orgID, @@ -160,9 +160,9 @@ func TestAccProjectRSProject_CreateWithProjectOwner(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasicOwnerID(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, + PreCheck: func() { testAccPreCheckBasicOwnerID(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectConfigWithProjectOwner(projectName, orgID, projectOwnerID), @@ -187,9 +187,9 @@ func TestAccProjectRSGovProject_CreateWithProjectOwner(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckGov(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, + PreCheck: func() { testAccPreCheckGov(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasGovProjectConfigWithProjectOwner(projectName, orgID, projectOwnerID), @@ -213,9 +213,9 @@ func TestAccProjectRSProject_CreateWithFalseDefaultSettings(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasicOwnerID(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, + PreCheck: func() { testAccPreCheckBasicOwnerID(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectConfigWithFalseDefaultSettings(projectName, orgID, projectOwnerID), @@ -240,9 +240,9 @@ func TestAccProjectRSProject_CreateWithFalseDefaultAdvSettings(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasicOwnerID(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, + PreCheck: func() { testAccPreCheckBasicOwnerID(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectConfigWithFalseDefaultAdvSettings(projectName, orgID, projectOwnerID), @@ -269,9 +269,9 @@ func TestAccProjectRSProject_withUpdatedRole(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, + PreCheck: func() { testAccPreCheckBasic(t); testCheckTeamsIds(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectConfigWithUpdatedRole(projectName, orgID, teamsIds[0], roleName), @@ -301,9 +301,9 @@ func TestAccProjectRSProject_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectConfig(projectName, orgID, @@ -330,9 +330,9 @@ func TestAccProjectRSProject_withUpdatedLimits(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectConfigWithLimits(projectName, orgID, []*projectLimit{ @@ -379,9 +379,9 @@ func TestAccProjectRSProject_withInvalidLimitName(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectConfigWithLimits(projectName, orgID, []*projectLimit{ @@ -404,9 +404,9 @@ func TestAccProjectRSProject_withInvalidLimitNameOnUpdate(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasProjectDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasProjectConfigWithLimits(projectName, orgID, []*projectLimit{}), @@ -430,7 +430,7 @@ func TestAccProjectRSProject_withInvalidLimitNameOnUpdate(t *testing.T) { func testAccCheckMongoDBAtlasProjectExists(resourceName string, project *matlas.Project) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -463,7 +463,7 @@ func testAccCheckMongoDBAtlasProjectAttributes(project *matlas.Project, projectN } func testAccCheckMongoDBAtlasProjectDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_project" { diff --git a/mongodbatlas/resource_mongodbatlas_search_index_test.go b/mongodbatlas/resource_mongodbatlas_search_index_test.go index 6805074c20..6c8a22fddf 100644 --- a/mongodbatlas/resource_mongodbatlas_search_index_test.go +++ b/mongodbatlas/resource_mongodbatlas_search_index_test.go @@ -23,9 +23,9 @@ func TestAccClusterRSSearchIndex_basic(t *testing.T) { datasourceName = "data.mongodbatlas_search_indexes.data_index" ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasSearchIndexConfig(projectID, clusterName), @@ -67,9 +67,9 @@ func TestAccClusterRSSearchIndex_withMapping(t *testing.T) { updatedAnalyzer = "lucene.simple" ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasSearchIndexConfigAdvanced(projectID, clusterName), @@ -97,9 +97,9 @@ func TestAccClusterRSSearchIndex_withSynonyms(t *testing.T) { updatedAnalyzer = "lucene.standard" ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasSearchIndexConfigSynonyms(orgID, projectName, clusterName), @@ -138,9 +138,9 @@ func TestAccClusterRSSearchIndex_importBasic(t *testing.T) { name = "name_test" ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasSearchIndexDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasSearchIndexConfig(projectID, clusterName), @@ -164,7 +164,7 @@ func TestAccClusterRSSearchIndex_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasSearchIndexExists(resourceName string, index *matlas.SearchIndex) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -401,7 +401,7 @@ func testAccMongoDBAtlasSearchIndexConfigSynonyms(orgID, projectName, clusterNam } func testAccCheckMongoDBAtlasSearchIndexDestroy(state *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range state.RootModule().Resources { if rs.Type != "mongodbatlas_search_index" { diff --git a/mongodbatlas/resource_mongodbatlas_serverless_instance_test.go b/mongodbatlas/resource_mongodbatlas_serverless_instance_test.go index bc191e9a1c..a18e5a6a92 100644 --- a/mongodbatlas/resource_mongodbatlas_serverless_instance_test.go +++ b/mongodbatlas/resource_mongodbatlas_serverless_instance_test.go @@ -23,9 +23,9 @@ func TestAccServerlessInstance_basic(t *testing.T) { datasourceInstancesName = "data.mongodbatlas_serverless_instances.data_serverless" ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasServerlessInstanceDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasServerlessInstanceDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasServerlessInstanceConfig(orgID, projectName, instanceName, true), @@ -63,9 +63,9 @@ func TestAccServerlessInstance_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasServerlessInstanceDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasServerlessInstanceDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasServerlessInstanceConfig(orgID, projectName, instanceName, true), @@ -82,7 +82,7 @@ func TestAccServerlessInstance_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasServerlessInstanceExists(resourceName string, serverlessInstance *matlas.Cluster) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -106,7 +106,7 @@ func testAccCheckMongoDBAtlasServerlessInstanceExists(resourceName string, serve } func testAccCheckMongoDBAtlasServerlessInstanceDestroy(state *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range state.RootModule().Resources { if rs.Type != "mongodbatlas_serverless_instance" { diff --git a/mongodbatlas/resource_mongodbatlas_team_test.go b/mongodbatlas/resource_mongodbatlas_team_test.go index dc773338c3..ba2a5ab116 100644 --- a/mongodbatlas/resource_mongodbatlas_team_test.go +++ b/mongodbatlas/resource_mongodbatlas_team_test.go @@ -25,9 +25,9 @@ func TestAccConfigRSTeam_basic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasTeamDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasTeamDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasTeamConfig(orgID, name, @@ -84,9 +84,9 @@ func TestAccConfigRSTeam_importBasic(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasTeamDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasTeamDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasTeamConfig(orgID, name, []string{username}), @@ -113,7 +113,7 @@ func TestAccConfigRSTeam_importBasic(t *testing.T) { func testAccCheckMongoDBAtlasTeamExists(resourceName string, team *matlas.Team) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -153,7 +153,7 @@ func testAccCheckMongoDBAtlasTeamAttributes(team *matlas.Team, name string) reso } func testAccCheckMongoDBAtlasTeamDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_teams" { diff --git a/mongodbatlas/resource_mongodbatlas_third_party_integration_test.go b/mongodbatlas/resource_mongodbatlas_third_party_integration_test.go index c28a16d326..2c83f52089 100644 --- a/mongodbatlas/resource_mongodbatlas_third_party_integration_test.go +++ b/mongodbatlas/resource_mongodbatlas_third_party_integration_test.go @@ -32,9 +32,9 @@ func TestAccConfigRSThirdPartyIntegration_basic(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasThirdPartyIntegrationDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasThirdPartyIntegrationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasThirdPartyIntegrationResourceConfig(&seedConfig), @@ -71,9 +71,9 @@ func TestAccConfigRSThirdPartyIntegration_importBasic(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasThirdPartyIntegrationDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasThirdPartyIntegrationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasThirdPartyIntegrationResourceConfig(&seedConfig), @@ -126,9 +126,9 @@ func TestAccConfigRSThirdPartyIntegration_updateBasic(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasThirdPartyIntegrationDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasThirdPartyIntegrationDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasThirdPartyIntegrationResourceConfig(&seedInitialConfig), @@ -154,7 +154,7 @@ func TestAccConfigRSThirdPartyIntegration_updateBasic(t *testing.T) { } func testAccCheckMongoDBAtlasThirdPartyIntegrationDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_third_party_integration" { continue diff --git a/mongodbatlas/resource_mongodbatlas_x509_authentication_database_user_test.go b/mongodbatlas/resource_mongodbatlas_x509_authentication_database_user_test.go index fbbcef5604..b277e190d4 100644 --- a/mongodbatlas/resource_mongodbatlas_x509_authentication_database_user_test.go +++ b/mongodbatlas/resource_mongodbatlas_x509_authentication_database_user_test.go @@ -25,8 +25,8 @@ func TestAccGenericAdvRSX509AuthDBUser_basic(t *testing.T) { PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasX509AuthDBUserDestroy, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasX509AuthDBUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasX509AuthDBUserConfig(projectName, orgID, username), @@ -52,9 +52,9 @@ func TestAccGenericAdvRSX509AuthDBUser_WithCustomerX509(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasX509AuthDBUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasX509AuthDBUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasX509AuthDBUserConfigWithCustomerX509(projectName, orgID, cas), @@ -82,8 +82,8 @@ func TestAccGenericAdvRSX509AuthDBUser_importBasic(t *testing.T) { PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasX509AuthDBUserDestroy, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasX509AuthDBUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasX509AuthDBUserConfig(projectName, orgID, username), @@ -107,9 +107,9 @@ func TestAccGenericAdvRSX509AuthDBUser_WithDatabaseUser(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasX509AuthDBUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasX509AuthDBUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasX509AuthDBUserConfigWithDatabaseUser(projectName, orgID, username, months), @@ -135,9 +135,9 @@ func TestAccGenericAdvRSX509AuthDBUser_importWithCustomerX509(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckBasic(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckMongoDBAtlasX509AuthDBUserDestroy, + PreCheck: func() { testAccPreCheckBasic(t) }, + ProtoV6ProviderFactories: testAccProviderV6Factories, + CheckDestroy: testAccCheckMongoDBAtlasX509AuthDBUserDestroy, Steps: []resource.TestStep{ { Config: testAccMongoDBAtlasX509AuthDBUserConfigWithCustomerX509(projectName, orgID, cas), @@ -166,7 +166,7 @@ func testAccCheckMongoDBAtlasX509AuthDBUserImportStateIDFuncBasic(resourceName s func testAccCheckMongoDBAtlasX509AuthDBUserExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -195,7 +195,7 @@ func testAccCheckMongoDBAtlasX509AuthDBUserExists(resourceName string) resource. } func testAccCheckMongoDBAtlasX509AuthDBUserDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*MongoDBClient).Atlas + conn := testAccProviderSdkV2.Meta().(*MongoDBClient).Atlas for _, rs := range s.RootModule().Resources { if rs.Type != "mongodbatlas_x509_authentication_database_user" { diff --git a/terraform-registry-manifest.json b/terraform-registry-manifest.json new file mode 100644 index 0000000000..6e86c621bd --- /dev/null +++ b/terraform-registry-manifest.json @@ -0,0 +1,6 @@ +{ + "version": 1, + "metadata": { + "protocol_versions": ["6.0"] + } +} \ No newline at end of file diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 7a202219fc..9ef320c6ff 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -181,6 +181,11 @@ In addition to [generic `provider` arguments](https://www.terraform.io/docs/conf For more information on configuring and managing programmatic API Keys see the [MongoDB Atlas Documentation](https://docs.atlas.mongodb.com/tutorial/manage-programmatic-access/index.html). +## Terraform Version Requirement +| MongoDB Atlas Provider version | Required Terraform version | +| ------------- | ------------- | +| `1.12.0` and above | `1.0+` | +| below `1.12.0` | `0.13+` | ## Supported OS and Architectures As per [HashiCorp's recommendations](https://developer.hashicorp.com/terraform/registry/providers/os-arch), we fully support the following operating system / architecture combinations: - Darwin / AMD64