diff --git a/.github/workflows/code-health.yml b/.github/workflows/code-health.yml index 62f1e7426e..3ce22ab882 100644 --- a/.github/workflows/code-health.yml +++ b/.github/workflows/code-health.yml @@ -60,7 +60,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 with: - version: v1.55.0 + version: v1.56.2 website-lint: runs-on: ubuntu-latest steps: diff --git a/.golangci.yml b/.golangci.yml index b3de015831..35775dfc9e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,8 +6,6 @@ linters-settings: - opinionated - performance - style - disabled-checks: - - octalLiteral govet: check-shadowing: true enable: @@ -120,23 +118,8 @@ linters: # - gocognit issues: exclude: - - composite literal uses unkeyed fields - - Using the variable on range scope .* in function literal - declaration of ".*" shadows declaration at line .* - - only one cuddle assignment allowed before if statement - - func `testAccMongoDBAtlasThirdPartyIntegrationDataSourceConfig` is unused - - func `testAccMongoDBAtlasAlertConfigurationConfigWithThresholdUpdated` is unused - - func `testAccMongoDBAtlasAlertConfigurationConfigWithMatchers` is unused - - func `testAccDSMongoDBAtlasAlertConfigurationConfigWithThreshold` is unused - - func `testAccMongoDBAtlasCloudProviderSnapshotRestoreJobConfigPointInTime` is unused - - func `testAccMongoDBAtlasCloudBackupScheduleExportPoliciesConfig` is unused exclude-rules: - - path: _test\.go - linters: - - testpackage - # part of the golangci govet package is picking up things that go vet doesn't. Seems flaky, shutting that specific error off - - # Exclude some staticcheck messages - linters: - staticcheck text: "SA1019:" # d.GetOkExists is deprecated: usage is discouraged due to undefined behaviors and may be removed in a future version of the SDK diff --git a/GNUmakefile b/GNUmakefile index 0bbd63adba..a6903d5bc6 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -13,8 +13,8 @@ GITTAG=$(shell git describe --always --tags) VERSION=$(GITTAG:v%=%) LINKER_FLAGS=-s -w -X 'github.com/mongodb/terraform-provider-mongodbatlas/version.ProviderVersion=${VERSION}' -GOLANGCI_VERSION=v1.55.0 -MOCKERY_VERSION=v2.38.0 +GOLANGCI_VERSION=v1.56.2 +MOCKERY_VERSION=v2.42.0 export PATH := $(shell go env GOPATH)/bin:$(PATH) export SHELL := env PATH=$(PATH) /bin/bash diff --git a/go.mod b/go.mod index 2a0178a7f9..95649ec88b 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/zclconf/go-cty v1.14.2 go.mongodb.org/atlas v0.36.0 go.mongodb.org/atlas-sdk/v20231001002 v20231001002.0.0 - go.mongodb.org/atlas-sdk/v20231115006 v20231115006.0.0 + go.mongodb.org/atlas-sdk/v20231115007 v20231115007.0.0 go.mongodb.org/realm v0.1.0 ) diff --git a/go.sum b/go.sum index 5a5ad5bf0f..e1840f32c6 100644 --- a/go.sum +++ b/go.sum @@ -759,8 +759,8 @@ go.mongodb.org/atlas v0.36.0 h1:m05S3AO7zkl+bcG1qaNsEKBnAqnKx2FDwLooHpIG3j4= go.mongodb.org/atlas v0.36.0/go.mod h1:nfPldE9dSama6G2IbIzmEza02Ly7yFZjMMVscaM0uEc= go.mongodb.org/atlas-sdk/v20231001002 v20231001002.0.0 h1:h1X2CGKyN1UFvNs69vp7xpufbbreq6p7bbrg5uJ1sxw= go.mongodb.org/atlas-sdk/v20231001002 v20231001002.0.0/go.mod h1:4TAUPaWPFNSbi8c1hbQLr1wAdkmqi48O7zvyXjBM+a8= -go.mongodb.org/atlas-sdk/v20231115006 v20231115006.0.0 h1:3FvL4J1Ni/4PR2P0Gapo3wJ6w/6RpFbaJd/IGrTYgMQ= -go.mongodb.org/atlas-sdk/v20231115006 v20231115006.0.0/go.mod h1:R0s6He5geum/u75tpnww4nbPGVFnGO1vVp8Heiq6aq8= +go.mongodb.org/atlas-sdk/v20231115007 v20231115007.0.0 h1:gvUBkSoeNtM9FSBQy8rh6cm6qXn4yXbQGzK09X0eAdk= +go.mongodb.org/atlas-sdk/v20231115007 v20231115007.0.0/go.mod h1:JU7JOUGcv7pfDzbRTwIr8hGy2R1lehdrdfGj9fDjSVY= go.mongodb.org/realm v0.1.0 h1:zJiXyLaZrznQ+Pz947ziSrDKUep39DO4SfA0Fzx8M4M= go.mongodb.org/realm v0.1.0/go.mod h1:4Vj6iy+Puo1TDERcoh4XZ+pjtwbOzPpzqy3Cwe8ZmDM= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= diff --git a/integrationtesting/resource_mongodbatlas_encryption_at_rest_test.go b/integrationtesting/resource_mongodbatlas_encryption_at_rest_test.go index ebe3063c5a..6b326766b7 100644 --- a/integrationtesting/resource_mongodbatlas_encryption_at_rest_test.go +++ b/integrationtesting/resource_mongodbatlas_encryption_at_rest_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/gruntwork-io/terratest/modules/terraform" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) func TestTerraformResourceMongoDBAtlasEncryptionAtRestWithRole_basicAWS(t *testing.T) { @@ -90,10 +90,9 @@ func TestResourceEncryptionAtRestAws(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() publicKey = mongoSecrets.PublicKey privateKey = mongoSecrets.PrivateKey - awsAccess = awsSecrets.AccessKey awsSecret = awsSecrets.SecretKey awsCustomer = awsSecrets.CustomerMasterKey @@ -136,7 +135,7 @@ func TestResourceEncryptionAtRestAzure(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() publicKey = mongoSecrets.PublicKey privateKey = mongoSecrets.PrivateKey @@ -190,7 +189,7 @@ func TestResourceEncryptionAtRestGCP(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() publicKey = mongoSecrets.PublicKey privateKey = mongoSecrets.PrivateKey diff --git a/integrationtesting/test-upgrades_test.go b/integrationtesting/test-upgrades_test.go index 89d53f6bf1..dfc63dcc7b 100644 --- a/integrationtesting/test-upgrades_test.go +++ b/integrationtesting/test-upgrades_test.go @@ -12,6 +12,7 @@ import ( "github.com/gruntwork-io/terratest/modules/terraform" test_structure "github.com/gruntwork-io/terratest/modules/test-structure" "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) var ( @@ -22,13 +23,12 @@ func TestUpgradeNetworkContainerRegionsGCP(t *testing.T) { t.Parallel() var ( - randInt = acctest.RandIntRange(0, 255) orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectID = os.Getenv("MONGODB_ATLAS_PROJECT_ID") - atlasCIDRBlock = fmt.Sprintf("10.%d.0.0/18", randInt) - providerName = "GCP" publicKey = os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") privateKey = os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + providerName = "GCP" + atlasCIDRBlock = fmt.Sprintf("10.%d.0.0/18", acctest.RandIntRange(0, 255)) ) // Construct the terraform options with default retryable errors to handle the most common // retryable errors in terraform testing. @@ -80,7 +80,7 @@ func TestUpgradeDatabaseUserLDAPAuthType(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() roleName = "atlasAdmin" username = "CN=ellen@example.com,OU=users,DC=example,DC=com" publicKey = os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") @@ -146,8 +146,8 @@ func TestUpgradeClusterDeprecationEBSVolume(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - clusterName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() publicKey = os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") privateKey = os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") majorVersion = testAccGetMongoDBAtlasMajorVersion() @@ -204,7 +204,7 @@ func TestUpgradePrivateEndpoint(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() publicKey = os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") privateKey = os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") baseURL = os.Getenv("MONGODB_ATLAS_BASE_URL") @@ -279,10 +279,10 @@ func TestUpgradeProjectIPWhitelistDeprecation(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() publicKey = os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") privateKey = os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") - ipAddress = fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) + ipAddress = acc.RandomIP(179, 154, 226) comment = fmt.Sprintf("TestAcc for ipAddress (%s)", ipAddress) ) // Construct the terraform options with default retryable errors to handle the most common @@ -339,8 +339,8 @@ func TestUpgradeDesignIDState(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - clusterName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() description = fmt.Sprintf("My description in %s", clusterName) retentionInDays = "1" publicKey = mongoSecrets.PublicKey @@ -466,7 +466,7 @@ func TestUpgradePrivateLinkEndpointDeprecation(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() publicKey = os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") privateKey = os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") awsAccess = os.Getenv("AWS_ACCESS_KEY_ID") @@ -538,10 +538,10 @@ func TestUpgradeCloudBackupPolicies(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() publicKey = os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") privateKey = os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") - clusterName = fmt.Sprintf("test-acc-%s", acctest.RandString(10)) + clusterName = acc.RandomClusterName() ) // Construct the terraform options with default retryable errors to handle the most common // retryable errors in terraform testing. @@ -597,7 +597,7 @@ func TestUpgradeEncryptionAtRestAws(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() publicKey = mongoSecrets.PublicKey privateKey = mongoSecrets.PrivateKey @@ -664,7 +664,7 @@ func TestUpgradeEncryptionAtRestAzure(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() publicKey = mongoSecrets.PublicKey privateKey = mongoSecrets.PrivateKey @@ -739,7 +739,7 @@ func TestUpgradeEncryptionAtRestGCP(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() publicKey = mongoSecrets.PublicKey privateKey = mongoSecrets.PrivateKey @@ -798,8 +798,8 @@ func TestUpgradeCloudBackupSnapshot(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - clusterName = fmt.Sprintf("test-acc-%s", acctest.RandString(10)) + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() ) // Construct the terraform options with default retryable errors to handle the most common // retryable errors in terraform testing. diff --git a/internal/common/conversion/flatten_expand.go b/internal/common/conversion/flatten_expand.go index 42ffe43ec2..18a4b89777 100644 --- a/internal/common/conversion/flatten_expand.go +++ b/internal/common/conversion/flatten_expand.go @@ -3,7 +3,7 @@ package conversion import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func FlattenLinks(links []admin.Link) []map[string]string { diff --git a/internal/config/client.go b/internal/config/client.go index 3710c01b3b..4912f93ced 100644 --- a/internal/config/client.go +++ b/internal/config/client.go @@ -13,7 +13,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/version" "github.com/spf13/cast" admin20231001002 "go.mongodb.org/atlas-sdk/v20231001002/admin" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" matlasClient "go.mongodb.org/atlas/mongodbatlas" realmAuth "go.mongodb.org/realm/auth" "go.mongodb.org/realm/realm" diff --git a/internal/provider/provider_authentication_test.go b/internal/provider/provider_authentication_test.go index 9be3b93c45..b5cdbe090b 100644 --- a/internal/provider/provider_authentication_test.go +++ b/internal/provider/provider_authentication_test.go @@ -4,16 +4,15 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccSTSAssumeRole_basic(t *testing.T) { var ( resourceName = "mongodbatlas_project.test" - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") clusterCount = "0" ) diff --git a/internal/service/accesslistapikey/data_source_accesslist_api_key_test.go b/internal/service/accesslistapikey/data_source_accesslist_api_key_test.go index f8e1fac52c..72365885c8 100644 --- a/internal/service/accesslistapikey/data_source_accesslist_api_key_test.go +++ b/internal/service/accesslistapikey/data_source_accesslist_api_key_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -14,8 +13,8 @@ func TestAccConfigDSAccesslistAPIKey_basic(t *testing.T) { resourceName := "mongodbatlas_access_list_api_key.test" dataSourceName := "data.mongodbatlas_access_list_api_key.test" orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - description := fmt.Sprintf("test-acc-accesslist-api_key-%s", acctest.RandString(5)) - ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) + description := acc.RandomName() + ipAddress := acc.RandomIP(179, 154, 226) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, diff --git a/internal/service/accesslistapikey/data_source_accesslist_api_keys.go b/internal/service/accesslistapikey/data_source_accesslist_api_keys.go index 996b749aab..87b247b247 100644 --- a/internal/service/accesslistapikey/data_source_accesslist_api_keys.go +++ b/internal/service/accesslistapikey/data_source_accesslist_api_keys.go @@ -10,7 +10,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func PluralDataSource() *schema.Resource { diff --git a/internal/service/accesslistapikey/data_source_accesslist_api_keys_test.go b/internal/service/accesslistapikey/data_source_accesslist_api_keys_test.go index 31c4f7159d..a89a075881 100644 --- a/internal/service/accesslistapikey/data_source_accesslist_api_keys_test.go +++ b/internal/service/accesslistapikey/data_source_accesslist_api_keys_test.go @@ -5,17 +5,18 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) func TestAccConfigDSAccesslistAPIKeys_basic(t *testing.T) { - resourceName := "mongodbatlas_access_list_api_key.test" - dataSourceName := "data.mongodbatlas_access_list_api_keys.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - description := fmt.Sprintf("test-acc-accesslist-api_keys-%s", acctest.RandString(5)) - ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) + var ( + resourceName = "mongodbatlas_access_list_api_key.test" + dataSourceName = "data.mongodbatlas_access_list_api_keys.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + description = acc.RandomName() + ipAddress = acc.RandomIP(179, 154, 226) + ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, diff --git a/internal/service/accesslistapikey/resource_access_list_api_key.go b/internal/service/accesslistapikey/resource_access_list_api_key.go index 6a7b8596ad..ba07dacfe3 100644 --- a/internal/service/accesslistapikey/resource_access_list_api_key.go +++ b/internal/service/accesslistapikey/resource_access_list_api_key.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func Resource() *schema.Resource { diff --git a/internal/service/accesslistapikey/resource_access_list_api_key_migration_test.go b/internal/service/accesslistapikey/resource_access_list_api_key_migration_test.go index 8ec9345eea..987410e040 100644 --- a/internal/service/accesslistapikey/resource_access_list_api_key_migration_test.go +++ b/internal/service/accesslistapikey/resource_access_list_api_key_migration_test.go @@ -1,11 +1,9 @@ package accesslistapikey_test import ( - "fmt" "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -13,10 +11,12 @@ import ( ) func TestAccMigrationProjectAccesslistAPIKey_SettingIPAddress(t *testing.T) { - resourceName := "mongodbatlas_access_list_api_key.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) - description := fmt.Sprintf("test-acc-access_list-api_key-%s", acctest.RandString(5)) + var ( + resourceName = "mongodbatlas_access_list_api_key.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + ipAddress = acc.RandomIP(179, 154, 226) + description = acc.RandomName() + ) resource.Test(t, resource.TestCase{ PreCheck: func() { mig.PreCheckBasic(t) }, @@ -46,10 +46,12 @@ func TestAccMigrationProjectAccesslistAPIKey_SettingIPAddress(t *testing.T) { } func TestAccMigrationProjectAccesslistAPIKey_SettingCIDRBlock(t *testing.T) { - resourceName := "mongodbatlas_access_list_api_key.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - cidrBlock := fmt.Sprintf("179.154.226.%d/32", acctest.RandIntRange(0, 255)) - description := fmt.Sprintf("test-acc-access_list-api_key-%s", acctest.RandString(5)) + var ( + resourceName = "mongodbatlas_access_list_api_key.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + cidrBlock = acc.RandomIP(179, 154, 226) + "/32" + description = acc.RandomName() + ) resource.Test(t, resource.TestCase{ PreCheck: func() { mig.PreCheckBasic(t) }, diff --git a/internal/service/accesslistapikey/resource_access_list_api_key_test.go b/internal/service/accesslistapikey/resource_access_list_api_key_test.go index 74dca8d209..81cd654ef2 100644 --- a/internal/service/accesslistapikey/resource_access_list_api_key_test.go +++ b/internal/service/accesslistapikey/resource_access_list_api_key_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -14,11 +13,13 @@ import ( ) func TestAccProjectRSAccesslistAPIKey_SettingIPAddress(t *testing.T) { - resourceName := "mongodbatlas_access_list_api_key.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) - description := fmt.Sprintf("test-acc-access_list-api_key-%s", acctest.RandString(5)) - updatedIPAddress := fmt.Sprintf("179.154.228.%d", acctest.RandIntRange(0, 255)) + var ( + resourceName = "mongodbatlas_access_list_api_key.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + ipAddress = acc.RandomIP(179, 154, 226) + description = acc.RandomName() + updatedIPAddress = acc.RandomIP(179, 154, 228) + ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -46,11 +47,13 @@ func TestAccProjectRSAccesslistAPIKey_SettingIPAddress(t *testing.T) { } func TestAccProjectRSAccessListAPIKey_SettingCIDRBlock(t *testing.T) { - resourceName := "mongodbatlas_access_list_api_key.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - cidrBlock := fmt.Sprintf("179.154.226.%d/32", acctest.RandIntRange(0, 255)) - description := fmt.Sprintf("test-acc-access_list-api_key-%s", acctest.RandString(5)) - updatedCIDRBlock := fmt.Sprintf("179.154.228.%d/32", acctest.RandIntRange(0, 255)) + var ( + resourceName = "mongodbatlas_access_list_api_key.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + cidrBlock = acc.RandomIP(179, 154, 226) + "/32" + description = acc.RandomName() + updatedCIDRBlock = acc.RandomIP(179, 154, 228) + "/32" + ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -78,10 +81,12 @@ func TestAccProjectRSAccessListAPIKey_SettingCIDRBlock(t *testing.T) { } func TestAccProjectRSAccessListAPIKey_importBasic(t *testing.T) { - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) - resourceName := "mongodbatlas_access_list_api_key.test" - description := fmt.Sprintf("test-acc-access_list-api_key-%s", acctest.RandString(5)) + var ( + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + ipAddress = acc.RandomIP(179, 154, 226) + resourceName = "mongodbatlas_access_list_api_key.test" + description = acc.RandomName() + ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, diff --git a/internal/service/advancedcluster/data_source_advanced_clusters.go b/internal/service/advancedcluster/data_source_advanced_clusters.go index 2b5333a949..76269cc003 100644 --- a/internal/service/advancedcluster/data_source_advanced_clusters.go +++ b/internal/service/advancedcluster/data_source_advanced_clusters.go @@ -12,7 +12,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func PluralDataSource() *schema.Resource { diff --git a/internal/service/advancedcluster/model_advanced_cluster.go b/internal/service/advancedcluster/model_advanced_cluster.go index 2bf1a11728..7e78fbe547 100644 --- a/internal/service/advancedcluster/model_advanced_cluster.go +++ b/internal/service/advancedcluster/model_advanced_cluster.go @@ -16,7 +16,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/spf13/cast" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) var ( diff --git a/internal/service/advancedcluster/model_advanced_cluster_test.go b/internal/service/advancedcluster/model_advanced_cluster_test.go index ae62f5962e..a17aac9937 100644 --- a/internal/service/advancedcluster/model_advanced_cluster_test.go +++ b/internal/service/advancedcluster/model_advanced_cluster_test.go @@ -11,7 +11,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mocksvc" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) var ( diff --git a/internal/service/advancedcluster/resource_advanced_cluster.go b/internal/service/advancedcluster/resource_advanced_cluster.go index 6934ab0272..1ed40d2230 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster.go +++ b/internal/service/advancedcluster/resource_advanced_cluster.go @@ -20,7 +20,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/spf13/cast" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/advancedcluster/resource_advanced_cluster_test.go b/internal/service/advancedcluster/resource_advanced_cluster_test.go index 4851060227..f56348fc0d 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/advancedcluster/service_advanced_cluster.go b/internal/service/advancedcluster/service_advanced_cluster.go index e991ecf3c9..03d36e2505 100644 --- a/internal/service/advancedcluster/service_advanced_cluster.go +++ b/internal/service/advancedcluster/service_advanced_cluster.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) type ClusterService interface { diff --git a/internal/service/alertconfiguration/data_source_alert_configuration.go b/internal/service/alertconfiguration/data_source_alert_configuration.go index aa9e28f44b..0e7486abf7 100644 --- a/internal/service/alertconfiguration/data_source_alert_configuration.go +++ b/internal/service/alertconfiguration/data_source_alert_configuration.go @@ -14,7 +14,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/zclconf/go-cty/cty" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) var _ datasource.DataSource = &alertConfigurationDS{} diff --git a/internal/service/alertconfiguration/data_source_alert_configuration_test.go b/internal/service/alertconfiguration/data_source_alert_configuration_test.go index 70513b009b..8d2133d8f9 100644 --- a/internal/service/alertconfiguration/data_source_alert_configuration_test.go +++ b/internal/service/alertconfiguration/data_source_alert_configuration_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccConfigDSAlertConfiguration_basic(t *testing.T) { diff --git a/internal/service/alertconfiguration/data_source_alert_configurations.go b/internal/service/alertconfiguration/data_source_alert_configurations.go index 5af3969ad1..4b73a63988 100644 --- a/internal/service/alertconfiguration/data_source_alert_configurations.go +++ b/internal/service/alertconfiguration/data_source_alert_configurations.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const alertConfigurationsDataSourceName = "alert_configurations" diff --git a/internal/service/alertconfiguration/model_alert_configuration.go b/internal/service/alertconfiguration/model_alert_configuration.go index a09cadf58f..edfce60fd3 100644 --- a/internal/service/alertconfiguration/model_alert_configuration.go +++ b/internal/service/alertconfiguration/model_alert_configuration.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func NewNotificationList(list []TfNotificationModel) (*[]admin.AlertsNotificationRootForGroup, error) { diff --git a/internal/service/alertconfiguration/model_alert_configuration_test.go b/internal/service/alertconfiguration/model_alert_configuration_test.go index 9a5d044703..1c3f3f6147 100644 --- a/internal/service/alertconfiguration/model_alert_configuration_test.go +++ b/internal/service/alertconfiguration/model_alert_configuration_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/alertconfiguration" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/alertconfiguration/resource_alert_configuration.go b/internal/service/alertconfiguration/resource_alert_configuration.go index 328c3d6d80..15aad20be9 100644 --- a/internal/service/alertconfiguration/resource_alert_configuration.go +++ b/internal/service/alertconfiguration/resource_alert_configuration.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/alertconfiguration/resource_alert_configuration_migration_test.go b/internal/service/alertconfiguration/resource_alert_configuration_migration_test.go index 988e16cd8b..070ae30d50 100644 --- a/internal/service/alertconfiguration/resource_alert_configuration_migration_test.go +++ b/internal/service/alertconfiguration/resource_alert_configuration_migration_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" diff --git a/internal/service/alertconfiguration/resource_alert_configuration_test.go b/internal/service/alertconfiguration/resource_alert_configuration_test.go index a3c7d274f1..96aea0897c 100644 --- a/internal/service/alertconfiguration/resource_alert_configuration_test.go +++ b/internal/service/alertconfiguration/resource_alert_configuration_test.go @@ -12,7 +12,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/alertconfiguration" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccConfigRSAlertConfiguration_basic(t *testing.T) { diff --git a/internal/service/apikey/data_source_api_keys.go b/internal/service/apikey/data_source_api_keys.go index aa9e1edeca..f3503812a9 100644 --- a/internal/service/apikey/data_source_api_keys.go +++ b/internal/service/apikey/data_source_api_keys.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func PluralDataSource() *schema.Resource { diff --git a/internal/service/apikey/resource_api_key.go b/internal/service/apikey/resource_api_key.go index fe626a63ec..130a71a304 100644 --- a/internal/service/apikey/resource_api_key.go +++ b/internal/service/apikey/resource_api_key.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func Resource() *schema.Resource { diff --git a/internal/service/atlasuser/data_source_atlas_user.go b/internal/service/atlasuser/data_source_atlas_user.go index 8b2947c105..b775c7bd74 100644 --- a/internal/service/atlasuser/data_source_atlas_user.go +++ b/internal/service/atlasuser/data_source_atlas_user.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/atlasuser/data_source_atlas_user_test.go b/internal/service/atlasuser/data_source_atlas_user_test.go index 219d05bc50..1f02fc0b51 100644 --- a/internal/service/atlasuser/data_source_atlas_user_test.go +++ b/internal/service/atlasuser/data_source_atlas_user_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccConfigDSAtlasUser_ByUserID(t *testing.T) { diff --git a/internal/service/atlasuser/data_source_atlas_users.go b/internal/service/atlasuser/data_source_atlas_users.go index 0fd518a63c..65e6c55aa7 100644 --- a/internal/service/atlasuser/data_source_atlas_users.go +++ b/internal/service/atlasuser/data_source_atlas_users.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/atlasuser/data_source_atlas_users_test.go b/internal/service/atlasuser/data_source_atlas_users_test.go index e4c431527e..f733d2101c 100644 --- a/internal/service/atlasuser/data_source_atlas_users_test.go +++ b/internal/service/atlasuser/data_source_atlas_users_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/atlasuser" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccConfigDSAtlasUsers_ByOrgID(t *testing.T) { diff --git a/internal/service/auditing/data_source_auditing_test.go b/internal/service/auditing/data_source_auditing_test.go index 27ee076b44..8ab54047ca 100644 --- a/internal/service/auditing/data_source_auditing_test.go +++ b/internal/service/auditing/data_source_auditing_test.go @@ -4,7 +4,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -13,7 +12,7 @@ func TestAccGenericAuditingDS_basic(t *testing.T) { var ( dataSourceName = "data.mongodbatlas_auditing.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() auditAuth = true auditFilter = "{ 'atype': 'authenticate', 'param': { 'user': 'auditAdmin', 'db': 'admin', 'mechanism': 'SCRAM-SHA-1' }}" enabled = true diff --git a/internal/service/auditing/resource_auditing.go b/internal/service/auditing/resource_auditing.go index e0c645a915..03a951d40e 100644 --- a/internal/service/auditing/resource_auditing.go +++ b/internal/service/auditing/resource_auditing.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/auditing/resource_auditing_migration_test.go b/internal/service/auditing/resource_auditing_migration_test.go index 699c41ad4b..2d0637e9f3 100644 --- a/internal/service/auditing/resource_auditing_migration_test.go +++ b/internal/service/auditing/resource_auditing_migration_test.go @@ -4,7 +4,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -15,7 +14,7 @@ func TestAccMigrationGenericAuditing_basic(t *testing.T) { var ( resourceName = "mongodbatlas_auditing.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() auditAuth = true auditFilter = "{ 'atype': 'authenticate', 'param': { 'user': 'auditAdmin', 'db': 'admin', 'mechanism': 'SCRAM-SHA-1' }}" enabled = true diff --git a/internal/service/auditing/resource_auditing_test.go b/internal/service/auditing/resource_auditing_test.go index fd44e354d9..00c340d4c1 100644 --- a/internal/service/auditing/resource_auditing_test.go +++ b/internal/service/auditing/resource_auditing_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -16,7 +15,7 @@ func TestAccGenericAuditing_basic(t *testing.T) { var ( resourceName = "mongodbatlas_auditing.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() auditAuth = true auditFilter = "{ 'atype': 'authenticate', 'param': { 'user': 'auditAdmin', 'db': 'admin', 'mechanism': 'SCRAM-SHA-1' }}" enabled = true @@ -63,7 +62,7 @@ func TestAccGenericAuditing_importBasic(t *testing.T) { var ( resourceName = "mongodbatlas_auditing.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() auditAuth = true auditFilter = "{ 'atype': 'authenticate', 'param': { 'user': 'auditAdmin', 'db': 'admin', 'mechanism': 'SCRAM-SHA-1' }}" enabled = true diff --git a/internal/service/backupcompliancepolicy/data_source_backup_compliance_policy_test.go b/internal/service/backupcompliancepolicy/data_source_backup_compliance_policy_test.go index b8c2797cb2..a3b53be697 100644 --- a/internal/service/backupcompliancepolicy/data_source_backup_compliance_policy_test.go +++ b/internal/service/backupcompliancepolicy/data_source_backup_compliance_policy_test.go @@ -1,11 +1,9 @@ package backupcompliancepolicy_test import ( - "fmt" "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -13,9 +11,11 @@ import ( const dataSourceName = "data.mongodbatlas_backup_compliance_policy.backup_policy" func TestAccGenericBackupDSBackupCompliancePolicy_basic(t *testing.T) { - projectName := fmt.Sprintf("testacc-project-%s", acctest.RandString(10)) - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectOwnerID := os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") + var ( + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectOwnerID = os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") + projectName = acc.RandomProjectName() + ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, diff --git a/internal/service/backupcompliancepolicy/resource_backup_compliance_policy.go b/internal/service/backupcompliancepolicy/resource_backup_compliance_policy.go index 4c9f0da254..3110b10932 100644 --- a/internal/service/backupcompliancepolicy/resource_backup_compliance_policy.go +++ b/internal/service/backupcompliancepolicy/resource_backup_compliance_policy.go @@ -14,7 +14,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/cloudbackupschedule" "github.com/spf13/cast" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/backupcompliancepolicy/resource_backup_compliance_policy_migration_test.go b/internal/service/backupcompliancepolicy/resource_backup_compliance_policy_migration_test.go index 87679d5ea4..80a46075d2 100644 --- a/internal/service/backupcompliancepolicy/resource_backup_compliance_policy_migration_test.go +++ b/internal/service/backupcompliancepolicy/resource_backup_compliance_policy_migration_test.go @@ -1,20 +1,19 @@ package backupcompliancepolicy_test import ( - "fmt" "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" ) func TestAccMigrationGenericBackupRSBackupCompliancePolicy_basic(t *testing.T) { var ( - projectName = fmt.Sprintf("testacc-project-%s", acctest.RandString(10)) orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectOwnerID = os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") + projectName = acc.RandomProjectName() config = configBasic(projectName, orgID, projectOwnerID) ) @@ -34,7 +33,7 @@ func TestAccMigrationGenericBackupRSBackupCompliancePolicy_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "restore_window_days", "7"), ), }, - mig.TestStep(config), + mig.TestStepCheckEmptyPlan(config), }, }) } diff --git a/internal/service/backupcompliancepolicy/resource_backup_compliance_policy_test.go b/internal/service/backupcompliancepolicy/resource_backup_compliance_policy_test.go index 4f442463c2..c963205936 100644 --- a/internal/service/backupcompliancepolicy/resource_backup_compliance_policy_test.go +++ b/internal/service/backupcompliancepolicy/resource_backup_compliance_policy_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -17,9 +16,9 @@ const resourceName = "mongodbatlas_backup_compliance_policy.backup_policy_res" func TestAccGenericBackupRSBackupCompliancePolicy_basic(t *testing.T) { var ( - projectName = fmt.Sprintf("testacc-project-%s", acctest.RandString(10)) orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectOwnerID = os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -44,9 +43,9 @@ func TestAccGenericBackupRSBackupCompliancePolicy_basic(t *testing.T) { func TestAccGenericBackupRSBackupCompliancePolicy_withFirstLastName(t *testing.T) { var ( - projectName = fmt.Sprintf("testacc-project-%s", acctest.RandString(10)) orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectOwnerID = os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -68,9 +67,9 @@ func TestAccGenericBackupRSBackupCompliancePolicy_withFirstLastName(t *testing.T func TestAccGenericBackupRSBackupCompliancePolicy_withoutOptionals(t *testing.T) { var ( - projectName = fmt.Sprintf("testacc-project-%s", acctest.RandString(10)) orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectOwnerID = os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -95,9 +94,9 @@ func TestAccGenericBackupRSBackupCompliancePolicy_withoutOptionals(t *testing.T) func TestAccGenericBackupRSBackupCompliancePolicy_withoutRestoreWindowDays(t *testing.T) { var ( - projectName = fmt.Sprintf("testacc-project-%s", acctest.RandString(10)) orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectOwnerID = os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -119,9 +118,9 @@ func TestAccGenericBackupRSBackupCompliancePolicy_withoutRestoreWindowDays(t *te func TestAccGenericBackupRSBackupCompliancePolicy_importBasic(t *testing.T) { var ( - projectName = fmt.Sprintf("testacc-project-%s", acctest.RandString(10)) orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectOwnerID = os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/cloudbackupschedule/resource_cloud_backup_schedule.go b/internal/service/cloudbackupschedule/resource_cloud_backup_schedule.go index 936a6da67c..e4d3fff7f2 100644 --- a/internal/service/cloudbackupschedule/resource_cloud_backup_schedule.go +++ b/internal/service/cloudbackupschedule/resource_cloud_backup_schedule.go @@ -11,7 +11,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/spf13/cast" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/cloudbackupschedule/resource_cloud_backup_schedule_migration_test.go b/internal/service/cloudbackupschedule/resource_cloud_backup_schedule_migration_test.go index 15e2eee1cf..ae4910e10f 100644 --- a/internal/service/cloudbackupschedule/resource_cloud_backup_schedule_migration_test.go +++ b/internal/service/cloudbackupschedule/resource_cloud_backup_schedule_migration_test.go @@ -7,7 +7,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccMigrationBackupRSCloudBackupSchedule_basic(t *testing.T) { diff --git a/internal/service/cloudbackupschedule/resource_cloud_backup_schedule_test.go b/internal/service/cloudbackupschedule/resource_cloud_backup_schedule_test.go index 4b78419e95..5621b746a2 100644 --- a/internal/service/cloudbackupschedule/resource_cloud_backup_schedule_test.go +++ b/internal/service/cloudbackupschedule/resource_cloud_backup_schedule_test.go @@ -11,7 +11,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) var ( diff --git a/internal/service/cloudbackupsnapshot/data_source_cloud_backup_snapshots.go b/internal/service/cloudbackupsnapshot/data_source_cloud_backup_snapshots.go index 75241560d4..549542fdf2 100644 --- a/internal/service/cloudbackupsnapshot/data_source_cloud_backup_snapshots.go +++ b/internal/service/cloudbackupsnapshot/data_source_cloud_backup_snapshots.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func PluralDataSource() *schema.Resource { diff --git a/internal/service/cloudbackupsnapshot/model_cloud_backup_snapshot.go b/internal/service/cloudbackupsnapshot/model_cloud_backup_snapshot.go index 19c4cca02c..804461502b 100644 --- a/internal/service/cloudbackupsnapshot/model_cloud_backup_snapshot.go +++ b/internal/service/cloudbackupsnapshot/model_cloud_backup_snapshot.go @@ -4,7 +4,7 @@ import ( "errors" "regexp" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func SplitSnapshotImportID(id string) (*admin.GetReplicaSetBackupApiParams, error) { diff --git a/internal/service/cloudbackupsnapshot/model_cloud_backup_snapshot_test.go b/internal/service/cloudbackupsnapshot/model_cloud_backup_snapshot_test.go index 05cccc7c37..fb3c4fcbb2 100644 --- a/internal/service/cloudbackupsnapshot/model_cloud_backup_snapshot_test.go +++ b/internal/service/cloudbackupsnapshot/model_cloud_backup_snapshot_test.go @@ -5,7 +5,7 @@ import ( "github.com/go-test/deep" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/cloudbackupsnapshot" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestSplitSnapshotImportID(t *testing.T) { diff --git a/internal/service/cloudbackupsnapshot/resource_cloud_backup_snapshot.go b/internal/service/cloudbackupsnapshot/resource_cloud_backup_snapshot.go index 068670f143..8e82df89bb 100644 --- a/internal/service/cloudbackupsnapshot/resource_cloud_backup_snapshot.go +++ b/internal/service/cloudbackupsnapshot/resource_cloud_backup_snapshot.go @@ -14,7 +14,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/cluster" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func Resource() *schema.Resource { diff --git a/internal/service/clusteroutagesimulation/data_source_cluster_outage_simulation_test.go b/internal/service/clusteroutagesimulation/data_source_cluster_outage_simulation_test.go index 2153d017ef..9e8118c9df 100644 --- a/internal/service/clusteroutagesimulation/data_source_cluster_outage_simulation_test.go +++ b/internal/service/clusteroutagesimulation/data_source_cluster_outage_simulation_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -14,8 +13,8 @@ func TestAccOutageSimulationClusterDS_SingleRegion_basic(t *testing.T) { var ( dataSourceName = "data.mongodbatlas_cluster_outage_simulation.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-project") - clusterName = acctest.RandomWithPrefix("test-acc-cluster") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() ) resource.ParallelTest(t, resource.TestCase{ @@ -42,8 +41,8 @@ func TestAccOutageSimulationClusterDS_MultiRegion_basic(t *testing.T) { var ( dataSourceName = "data.mongodbatlas_cluster_outage_simulation.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-project") - clusterName = acctest.RandomWithPrefix("test-acc-cluster") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/clusteroutagesimulation/resource_cluster_outage_simulation.go b/internal/service/clusteroutagesimulation/resource_cluster_outage_simulation.go index 3268c75e0e..60ef80dd7a 100644 --- a/internal/service/clusteroutagesimulation/resource_cluster_outage_simulation.go +++ b/internal/service/clusteroutagesimulation/resource_cluster_outage_simulation.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/clusteroutagesimulation/resource_cluster_outage_simulation_migration_test.go b/internal/service/clusteroutagesimulation/resource_cluster_outage_simulation_migration_test.go index bd583ec6c2..7cf35c4a5c 100644 --- a/internal/service/clusteroutagesimulation/resource_cluster_outage_simulation_migration_test.go +++ b/internal/service/clusteroutagesimulation/resource_cluster_outage_simulation_migration_test.go @@ -4,8 +4,8 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" ) @@ -13,8 +13,8 @@ func TestAccMigrationOutageSimulationCluster_SingleRegion_basic(t *testing.T) { var ( resourceName = "mongodbatlas_cluster_outage_simulation.test_outage" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-project") - clusterName = acctest.RandomWithPrefix("test-acc-cluster") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() config = configSingleRegion(projectName, orgID, clusterName) ) @@ -34,7 +34,7 @@ func TestAccMigrationOutageSimulationCluster_SingleRegion_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "state"), ), }, - mig.TestStep(config), + mig.TestStepCheckEmptyPlan(config), }, }) } @@ -43,8 +43,8 @@ func TestAccMigrationOutageSimulationCluster_MultiRegion_basic(t *testing.T) { var ( resourceName = "mongodbatlas_cluster_outage_simulation.test_outage" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-project") - clusterName = acctest.RandomWithPrefix("test-acc-cluster") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() config = configMultiRegion(projectName, orgID, clusterName) ) @@ -64,7 +64,7 @@ func TestAccMigrationOutageSimulationCluster_MultiRegion_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "state"), ), }, - mig.TestStep(config), + mig.TestStepCheckEmptyPlan(config), }, }) } diff --git a/internal/service/clusteroutagesimulation/resource_cluster_outage_simulation_test.go b/internal/service/clusteroutagesimulation/resource_cluster_outage_simulation_test.go index 1998b5768f..a0d4cf5825 100644 --- a/internal/service/clusteroutagesimulation/resource_cluster_outage_simulation_test.go +++ b/internal/service/clusteroutagesimulation/resource_cluster_outage_simulation_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -17,8 +16,8 @@ func TestAccOutageSimulationCluster_SingleRegion_basic(t *testing.T) { var ( dataSourceName = "mongodbatlas_cluster_outage_simulation.test_outage" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-project") - clusterName = acctest.RandomWithPrefix("test-acc-cluster") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() ) resource.ParallelTest(t, resource.TestCase{ @@ -45,8 +44,8 @@ func TestAccOutageSimulationCluster_MultiRegion_basic(t *testing.T) { var ( dataSourceName = "mongodbatlas_cluster_outage_simulation.test_outage" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-project") - clusterName = acctest.RandomWithPrefix("test-acc-cluster") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/customdbrole/data_source_custom_db_roles.go b/internal/service/customdbrole/data_source_custom_db_roles.go index aab8306950..af44dedb10 100644 --- a/internal/service/customdbrole/data_source_custom_db_roles.go +++ b/internal/service/customdbrole/data_source_custom_db_roles.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func PluralDataSource() *schema.Resource { diff --git a/internal/service/customdbrole/resource_custom_db_role.go b/internal/service/customdbrole/resource_custom_db_role.go index 8bbf98723b..ad96e5e722 100644 --- a/internal/service/customdbrole/resource_custom_db_role.go +++ b/internal/service/customdbrole/resource_custom_db_role.go @@ -17,7 +17,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/spf13/cast" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func Resource() *schema.Resource { diff --git a/internal/service/customdnsconfigurationclusteraws/resource_custom_dns_configuration_cluster_aws.go b/internal/service/customdnsconfigurationclusteraws/resource_custom_dns_configuration_cluster_aws.go index 4f81faf21d..52f82965cc 100644 --- a/internal/service/customdnsconfigurationclusteraws/resource_custom_dns_configuration_cluster_aws.go +++ b/internal/service/customdnsconfigurationclusteraws/resource_custom_dns_configuration_cluster_aws.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/databaseuser/data_source_database_user_test.go b/internal/service/databaseuser/data_source_database_user_test.go index dc040afb7b..d915053972 100644 --- a/internal/service/databaseuser/data_source_database_user_test.go +++ b/internal/service/databaseuser/data_source_database_user_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccConfigDSDatabaseUser_basic(t *testing.T) { diff --git a/internal/service/databaseuser/model_database_user.go b/internal/service/databaseuser/model_database_user.go index fe8d8267b7..635521d5e7 100644 --- a/internal/service/databaseuser/model_database_user.go +++ b/internal/service/databaseuser/model_database_user.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func NewMongoDBDatabaseUser(ctx context.Context, dbUserModel *TfDatabaseUserModel) (*admin.CloudDatabaseUser, diag.Diagnostics) { diff --git a/internal/service/databaseuser/model_database_user_test.go b/internal/service/databaseuser/model_database_user_test.go index 87d33036f0..d9299384f0 100644 --- a/internal/service/databaseuser/model_database_user_test.go +++ b/internal/service/databaseuser/model_database_user_test.go @@ -9,7 +9,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/databaseuser" "github.com/stretchr/testify/assert" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) var ( diff --git a/internal/service/databaseuser/resource_database_user_migration_test.go b/internal/service/databaseuser/resource_database_user_migration_test.go index 65eb35c789..fdfe24d693 100644 --- a/internal/service/databaseuser/resource_database_user_migration_test.go +++ b/internal/service/databaseuser/resource_database_user_migration_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" diff --git a/internal/service/databaseuser/resource_database_user_test.go b/internal/service/databaseuser/resource_database_user_test.go index 7523e2b0c4..ba2cfb25e3 100644 --- a/internal/service/databaseuser/resource_database_user_test.go +++ b/internal/service/databaseuser/resource_database_user_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccConfigRSDatabaseUser_basic(t *testing.T) { diff --git a/internal/service/datalakepipeline/data_source_data_lake_pipeline_run.go b/internal/service/datalakepipeline/data_source_data_lake_pipeline_run.go index 611b2e9110..c4f09cbc3c 100644 --- a/internal/service/datalakepipeline/data_source_data_lake_pipeline_run.go +++ b/internal/service/datalakepipeline/data_source_data_lake_pipeline_run.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const errorDataLakePipelineRunRead = "error reading MongoDB Atlas DataLake Run (%s): %s" diff --git a/internal/service/datalakepipeline/data_source_data_lake_pipeline_runs.go b/internal/service/datalakepipeline/data_source_data_lake_pipeline_runs.go index 5c1b1c2044..2cc6748e59 100644 --- a/internal/service/datalakepipeline/data_source_data_lake_pipeline_runs.go +++ b/internal/service/datalakepipeline/data_source_data_lake_pipeline_runs.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const errorDataLakePipelineRunList = "error reading MongoDB Atlas DataLake Runs (%s): %s" diff --git a/internal/service/datalakepipeline/data_source_data_lake_pipeline_test.go b/internal/service/datalakepipeline/data_source_data_lake_pipeline_test.go index e216352de2..2e9b9e20e9 100644 --- a/internal/service/datalakepipeline/data_source_data_lake_pipeline_test.go +++ b/internal/service/datalakepipeline/data_source_data_lake_pipeline_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -13,10 +12,10 @@ import ( func TestAccDataLakeDS_basic(t *testing.T) { var ( resourceName = "mongodbatlas_data_lake_pipeline.test" - clusterName = acctest.RandomWithPrefix("test-acc-index") - name = acctest.RandomWithPrefix("test-acc-index") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() + name = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, diff --git a/internal/service/datalakepipeline/data_source_data_lake_pipelines.go b/internal/service/datalakepipeline/data_source_data_lake_pipelines.go index 819296b0fb..0c8bee9f25 100644 --- a/internal/service/datalakepipeline/data_source_data_lake_pipelines.go +++ b/internal/service/datalakepipeline/data_source_data_lake_pipelines.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const errorDataLakePipelineList = "error creating MongoDB Atlas DataLake Pipelines: %s" diff --git a/internal/service/datalakepipeline/data_source_data_lake_pipelines_test.go b/internal/service/datalakepipeline/data_source_data_lake_pipelines_test.go index 1558523789..783752f790 100644 --- a/internal/service/datalakepipeline/data_source_data_lake_pipelines_test.go +++ b/internal/service/datalakepipeline/data_source_data_lake_pipelines_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -14,13 +13,14 @@ func TestAccDataLakeDSPlural_basic(t *testing.T) { var ( resourceName = "mongodbatlas_data_lake_pipeline.test" dataSourceName = "data.mongodbatlas_data_lake_pipelines.testDataSource" - firstClusterName = acctest.RandomWithPrefix("test-acc-index") - secondClusterName = acctest.RandomWithPrefix("test-acc-index") - firstPipelineName = acctest.RandomWithPrefix("test-acc-index") - secondPipelineName = acctest.RandomWithPrefix("test-acc-index") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + firstClusterName = acc.RandomClusterName() + secondClusterName = acc.RandomClusterName() + firstPipelineName = acc.RandomName() + secondPipelineName = acc.RandomName() + projectName = acc.RandomProjectName() ) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, diff --git a/internal/service/datalakepipeline/resource_data_lake_pipeline.go b/internal/service/datalakepipeline/resource_data_lake_pipeline.go index b33ca6ab7a..607c5f942a 100644 --- a/internal/service/datalakepipeline/resource_data_lake_pipeline.go +++ b/internal/service/datalakepipeline/resource_data_lake_pipeline.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/datalakepipeline/resource_data_lake_pipeline_migration_test.go b/internal/service/datalakepipeline/resource_data_lake_pipeline_migration_test.go index c0c489796f..a5d7915d16 100644 --- a/internal/service/datalakepipeline/resource_data_lake_pipeline_migration_test.go +++ b/internal/service/datalakepipeline/resource_data_lake_pipeline_migration_test.go @@ -4,18 +4,18 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" ) func TestAccMigrationcDataLakePipeline_basic(t *testing.T) { var ( resourceName = "mongodbatlas_data_lake_pipeline.test" - clusterName = acctest.RandomWithPrefix("test-acc-index") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - name = acctest.RandomWithPrefix("test-acc-index") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() + name = acc.RandomName() config = configBasic(orgID, projectName, clusterName, name) ) resource.ParallelTest(t, resource.TestCase{ @@ -32,7 +32,7 @@ func TestAccMigrationcDataLakePipeline_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "state", "ACTIVE"), ), }, - mig.TestStep(config), + mig.TestStepCheckEmptyPlan(config), }, }) } diff --git a/internal/service/datalakepipeline/resource_data_lake_pipeline_test.go b/internal/service/datalakepipeline/resource_data_lake_pipeline_test.go index 82584490ed..72ea2a1ea6 100644 --- a/internal/service/datalakepipeline/resource_data_lake_pipeline_test.go +++ b/internal/service/datalakepipeline/resource_data_lake_pipeline_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -16,10 +15,10 @@ import ( func TestAccDataLakePipeline_basic(t *testing.T) { var ( resourceName = "mongodbatlas_data_lake_pipeline.test" - clusterName = acctest.RandomWithPrefix("test-acc-index") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - name = acctest.RandomWithPrefix("test-acc-index") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() + name = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, diff --git a/internal/service/encryptionatrest/model_encryption_at_rest.go b/internal/service/encryptionatrest/model_encryption_at_rest.go index a0a6778006..69429ec7eb 100644 --- a/internal/service/encryptionatrest/model_encryption_at_rest.go +++ b/internal/service/encryptionatrest/model_encryption_at_rest.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func NewTfEncryptionAtRestRSModel(ctx context.Context, projectID string, encryptionResp *admin.EncryptionAtRest) *TfEncryptionAtRestRSModel { diff --git a/internal/service/encryptionatrest/model_encryption_at_rest_test.go b/internal/service/encryptionatrest/model_encryption_at_rest_test.go index 17703ca882..ec488145df 100644 --- a/internal/service/encryptionatrest/model_encryption_at_rest_test.go +++ b/internal/service/encryptionatrest/model_encryption_at_rest_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/encryptionatrest" "github.com/stretchr/testify/assert" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) var ( diff --git a/internal/service/encryptionatrest/resource_encryption_at_rest.go b/internal/service/encryptionatrest/resource_encryption_at_rest.go index 47878a126e..728b4358af 100644 --- a/internal/service/encryptionatrest/resource_encryption_at_rest.go +++ b/internal/service/encryptionatrest/resource_encryption_at_rest.go @@ -24,7 +24,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/validate" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/project" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/encryptionatrest/resource_encryption_at_rest_migration_test.go b/internal/service/encryptionatrest/resource_encryption_at_rest_migration_test.go index 434b48cec5..08245c03b9 100644 --- a/internal/service/encryptionatrest/resource_encryption_at_rest_migration_test.go +++ b/internal/service/encryptionatrest/resource_encryption_at_rest_migration_test.go @@ -4,13 +4,12 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccMigrationEncryptionAtRest_basicAWS(t *testing.T) { @@ -63,8 +62,8 @@ func TestAccMigrationEncryptionAtRest_withRole_basicAWS(t *testing.T) { projectID = os.Getenv("MONGODB_ATLAS_PROJECT_ID") accessKeyID = os.Getenv("AWS_ACCESS_KEY_ID") secretKey = os.Getenv("AWS_SECRET_ACCESS_KEY") - policyName = acctest.RandomWithPrefix("test-aws-policy") - roleName = acctest.RandomWithPrefix("test-aws-role") + policyName = acc.RandomName() + roleName = acc.RandomName() awsKms = admin.AWSKMSConfiguration{ Enabled: conversion.Pointer(true), diff --git a/internal/service/encryptionatrest/resource_encryption_at_rest_test.go b/internal/service/encryptionatrest/resource_encryption_at_rest_test.go index 2cf4f7b909..48b051db8b 100644 --- a/internal/service/encryptionatrest/resource_encryption_at_rest_test.go +++ b/internal/service/encryptionatrest/resource_encryption_at_rest_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -18,7 +17,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mocksvc" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( @@ -294,10 +293,9 @@ func TestAccEncryptionAtRestWithRole_basicAWS(t *testing.T) { projectID = os.Getenv("MONGODB_ATLAS_PROJECT_ID") accessKeyID = os.Getenv("AWS_ACCESS_KEY_ID") secretKey = os.Getenv("AWS_SECRET_ACCESS_KEY") - policyName = acctest.RandomWithPrefix("test-aws-policy") - roleName = acctest.RandomWithPrefix("test-aws-role") - - awsKms = admin.AWSKMSConfiguration{ + policyName = acc.RandomName() + roleName = acc.RandomName() + awsKms = admin.AWSKMSConfiguration{ Enabled: conversion.Pointer(true), CustomerMasterKeyID: conversion.StringPtr(os.Getenv("AWS_CUSTOMER_MASTER_KEY_ID")), Region: conversion.StringPtr(os.Getenv("AWS_REGION")), diff --git a/internal/service/encryptionatrest/service_encryption_at_rest.go b/internal/service/encryptionatrest/service_encryption_at_rest.go index d1f3df22b8..efd81cbbb8 100644 --- a/internal/service/encryptionatrest/service_encryption_at_rest.go +++ b/internal/service/encryptionatrest/service_encryption_at_rest.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) type EarService interface { diff --git a/internal/service/eventtrigger/data_source_event_trigger_test.go b/internal/service/eventtrigger/data_source_event_trigger_test.go index cabf891ffc..ab96686385 100644 --- a/internal/service/eventtrigger/data_source_event_trigger_test.go +++ b/internal/service/eventtrigger/data_source_event_trigger_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "go.mongodb.org/realm/realm" @@ -22,7 +21,7 @@ func TestAccEventTriggerDS_basic(t *testing.T) { eventResp = realm.EventTrigger{} ) event := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "DATABASE", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), diff --git a/internal/service/eventtrigger/data_source_event_triggers_test.go b/internal/service/eventtrigger/data_source_event_triggers_test.go index 6ac52258b0..bcf73ad601 100644 --- a/internal/service/eventtrigger/data_source_event_triggers_test.go +++ b/internal/service/eventtrigger/data_source_event_triggers_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -21,7 +20,7 @@ func TestAccEventTriggerDSPlural_basic(t *testing.T) { eventResp = realm.EventTrigger{} ) event := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "DATABASE", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), diff --git a/internal/service/eventtrigger/resource_event_trigger_test.go b/internal/service/eventtrigger/resource_event_trigger_test.go index 553f9657b1..b21f9e9e15 100644 --- a/internal/service/eventtrigger/resource_event_trigger_test.go +++ b/internal/service/eventtrigger/resource_event_trigger_test.go @@ -7,7 +7,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -24,7 +23,7 @@ func TestAccEventTrigger_basic(t *testing.T) { eventResp = realm.EventTrigger{} ) event := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "DATABASE", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -37,7 +36,7 @@ func TestAccEventTrigger_basic(t *testing.T) { }, } eventUpdated := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "DATABASE", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -89,7 +88,7 @@ func TestAccEventTriggerDatabase_eventProccesor(t *testing.T) { eventResp = realm.EventTrigger{} ) event := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "DATABASE", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -102,7 +101,7 @@ func TestAccEventTriggerDatabase_eventProccesor(t *testing.T) { }, } eventUpdated := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "DATABASE", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -153,7 +152,7 @@ func TestAccEventTriggerAuth_basic(t *testing.T) { eventResp = realm.EventTrigger{} ) event := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "AUTHENTICATION", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -163,7 +162,7 @@ func TestAccEventTriggerAuth_basic(t *testing.T) { }, } eventUpdated := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "AUTHENTICATION", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -214,7 +213,7 @@ func TestAccEventTriggerAuth_eventProcessor(t *testing.T) { eventResp = realm.EventTrigger{} ) event := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "AUTHENTICATION", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -224,7 +223,7 @@ func TestAccEventTriggerAuth_eventProcessor(t *testing.T) { }, } eventUpdated := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "AUTHENTICATION", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -273,7 +272,7 @@ func TestAccEventTriggerSchedule_basic(t *testing.T) { eventResp = realm.EventTrigger{} ) event := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "SCHEDULED", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -282,7 +281,7 @@ func TestAccEventTriggerSchedule_basic(t *testing.T) { }, } eventUpdated := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "SCHEDULED", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -331,7 +330,7 @@ func TestAccEventTriggerSchedule_eventProcessor(t *testing.T) { eventResp = realm.EventTrigger{} ) event := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "SCHEDULED", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -340,7 +339,7 @@ func TestAccEventTriggerSchedule_eventProcessor(t *testing.T) { }, } eventUpdated := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "SCHEDULED", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -387,7 +386,7 @@ func TestAccEventTriggerFunction_basic(t *testing.T) { eventResp = realm.EventTrigger{} ) event := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "SCHEDULED", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), @@ -396,7 +395,7 @@ func TestAccEventTriggerFunction_basic(t *testing.T) { }, } eventUpdated := realm.EventTriggerRequest{ - Name: acctest.RandomWithPrefix("test-acc"), + Name: acc.RandomName(), Type: "SCHEDULED", FunctionID: os.Getenv("MONGODB_REALM_FUNCTION_ID"), Disabled: conversion.Pointer(false), diff --git a/internal/service/federateddatabaseinstance/data_source_federated_database_instance_test.go b/internal/service/federateddatabaseinstance/data_source_federated_database_instance_test.go index cef40f287c..d10669dc0f 100644 --- a/internal/service/federateddatabaseinstance/data_source_federated_database_instance_test.go +++ b/internal/service/federateddatabaseinstance/data_source_federated_database_instance_test.go @@ -7,20 +7,19 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccFederatedDatabaseInstanceDS_basic(t *testing.T) { var ( resourceName = "data.mongodbatlas_federated_database_instance.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - name = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + name = acc.RandomName() federatedInstance = admin.DataLakeTenant{} ) @@ -50,10 +49,10 @@ func TestAccFederatedDatabaseInstanceDS_s3Bucket(t *testing.T) { var ( resourceName = "data.mongodbatlas_federated_database_instance.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - name = acctest.RandomWithPrefix("test-acc") - policyName = acctest.RandomWithPrefix("test-acc") - roleName = acctest.RandomWithPrefix("mongodb-atlas-test-acc-fed") + projectName = acc.RandomProjectName() + name = acc.RandomName() + policyName = acc.RandomName() + roleName = acc.RandomName() testS3Bucket = os.Getenv("AWS_S3_BUCKET") region = "VIRGINIA_USA" federatedInstance = admin.DataLakeTenant{} diff --git a/internal/service/federateddatabaseinstance/data_source_federated_database_instances.go b/internal/service/federateddatabaseinstance/data_source_federated_database_instances.go index 93b9bfe713..c6715e7646 100644 --- a/internal/service/federateddatabaseinstance/data_source_federated_database_instances.go +++ b/internal/service/federateddatabaseinstance/data_source_federated_database_instances.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" diff --git a/internal/service/federateddatabaseinstance/data_source_federated_database_instances_test.go b/internal/service/federateddatabaseinstance/data_source_federated_database_instances_test.go index 81cf3c512c..e9b9a13f52 100644 --- a/internal/service/federateddatabaseinstance/data_source_federated_database_instances_test.go +++ b/internal/service/federateddatabaseinstance/data_source_federated_database_instances_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -14,11 +13,11 @@ func TestAccFederatedDatabaseInstanceDSPlural_basic(t *testing.T) { var ( resourceName = "data.mongodbatlas_federated_database_instances.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - firstName = acctest.RandomWithPrefix("test-acc") - secondName = acctest.RandomWithPrefix("test-acc") - policyName = acctest.RandomWithPrefix("test-acc") - roleName = acctest.RandomWithPrefix("mongodb-atlas-test-acc-fed") + projectName = acc.RandomProjectName() + firstName = acc.RandomName() + secondName = acc.RandomName() + policyName = acc.RandomName() + roleName = acc.RandomName() testS3Bucket = os.Getenv("AWS_S3_BUCKET") region = "VIRGINIA_USA" ) diff --git a/internal/service/federateddatabaseinstance/resource_federated_database_instance.go b/internal/service/federateddatabaseinstance/resource_federated_database_instance.go index 7b70710fe4..94c0729fdb 100644 --- a/internal/service/federateddatabaseinstance/resource_federated_database_instance.go +++ b/internal/service/federateddatabaseinstance/resource_federated_database_instance.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/service/federateddatabaseinstance/resource_federated_database_instance_migration_test.go b/internal/service/federateddatabaseinstance/resource_federated_database_instance_migration_test.go index 95a1c27ac6..e90a880032 100644 --- a/internal/service/federateddatabaseinstance/resource_federated_database_instance_migration_test.go +++ b/internal/service/federateddatabaseinstance/resource_federated_database_instance_migration_test.go @@ -4,7 +4,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -15,8 +14,8 @@ func TestAccMigrationFederatedDatabaseInstance_basic(t *testing.T) { var ( resourceName = "mongodbatlas_federated_database_instance.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - name = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + name = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/federateddatabaseinstance/resource_federated_database_instance_test.go b/internal/service/federateddatabaseinstance/resource_federated_database_instance_test.go index c8e9d3c329..d1a813326b 100644 --- a/internal/service/federateddatabaseinstance/resource_federated_database_instance_test.go +++ b/internal/service/federateddatabaseinstance/resource_federated_database_instance_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/hashicorp/terraform-plugin-testing/terraform" @@ -17,8 +16,8 @@ func TestAccFederatedDatabaseInstance_basic(t *testing.T) { var ( resourceName = "mongodbatlas_federated_database_instance.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - name = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + name = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ @@ -73,10 +72,10 @@ func TestAccFederatedDatabaseInstance_s3bucket(t *testing.T) { var ( resourceName = "mongodbatlas_federated_database_instance.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - name = acctest.RandomWithPrefix("test-acc") - policyName = acctest.RandomWithPrefix("test-acc") - roleName = acctest.RandomWithPrefix("mongodb-atlas-test-acc-fed") + projectName = acc.RandomProjectName() + name = acc.RandomName() + policyName = acc.RandomName() + roleName = acc.RandomName() testS3Bucket = os.Getenv("AWS_S3_BUCKET") region = "VIRGINIA_USA" ) @@ -109,8 +108,8 @@ func TestAccFederatedDatabaseInstance_atlasCluster(t *testing.T) { var ( resourceName = "mongodbatlas_federated_database_instance.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - name = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + name = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/federatedquerylimit/data_source_federated_query_limit_test.go b/internal/service/federatedquerylimit/data_source_federated_query_limit_test.go index 708a023b3f..a46a4daa62 100644 --- a/internal/service/federatedquerylimit/data_source_federated_query_limit_test.go +++ b/internal/service/federatedquerylimit/data_source_federated_query_limit_test.go @@ -7,7 +7,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -20,15 +19,14 @@ func TestAccFederatedDatabaseQueryLimitDS_basic(t *testing.T) { var ( resourceName = "data.mongodbatlas_federated_query_limit.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-project") - tenantName = acctest.RandomWithPrefix("test-acc-tenant") - limitName = "bytesProcessed.monthly" - policyName = acctest.RandomWithPrefix("test-acc") - roleName = acctest.RandomWithPrefix("test-acc") testS3Bucket = os.Getenv("AWS_S3_BUCKET") region = "VIRGINIA_USA" - - queryLimit = matlas.DataFederationQueryLimit{} + limitName = "bytesProcessed.monthly" + projectName = acc.RandomProjectName() + tenantName = acc.RandomName() + policyName = acc.RandomName() + roleName = acc.RandomName() + queryLimit = matlas.DataFederationQueryLimit{} ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/federatedquerylimit/data_source_federated_query_limits_test.go b/internal/service/federatedquerylimit/data_source_federated_query_limits_test.go index a45263ee99..6bf11fa282 100644 --- a/internal/service/federatedquerylimit/data_source_federated_query_limits_test.go +++ b/internal/service/federatedquerylimit/data_source_federated_query_limits_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -15,12 +14,12 @@ func TestAccFederatedDatabaseQueryLimitDSPlural_basic(t *testing.T) { var ( resourceName = "data.mongodbatlas_federated_query_limits.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-project") - tenantName = acctest.RandomWithPrefix("test-acc-tenant") - policyName = acctest.RandomWithPrefix("test-acc") - roleName = acctest.RandomWithPrefix("test-acc") testS3Bucket = os.Getenv("AWS_S3_BUCKET") region = "VIRGINIA_USA" + projectName = acc.RandomProjectName() + tenantName = acc.RandomName() + policyName = acc.RandomName() + roleName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/federatedquerylimit/resource_federated_query_limit_test.go b/internal/service/federatedquerylimit/resource_federated_query_limit_test.go index 27ac9ca0f4..eb439109f7 100644 --- a/internal/service/federatedquerylimit/resource_federated_query_limit_test.go +++ b/internal/service/federatedquerylimit/resource_federated_query_limit_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -18,13 +17,13 @@ func TestAccFederatedDatabaseQueryLimit_basic(t *testing.T) { var ( resourceName = "mongodbatlas_federated_query_limit.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-project") - tenantName = acctest.RandomWithPrefix("test-acc-tenant") - limitName = "bytesProcessed.monthly" - policyName = acctest.RandomWithPrefix("test-acc") - roleName = acctest.RandomWithPrefix("test-acc") testS3Bucket = os.Getenv("AWS_S3_BUCKET") region = "VIRGINIA_USA" + limitName = "bytesProcessed.monthly" + projectName = acc.RandomProjectName() + tenantName = acc.RandomName() + policyName = acc.RandomName() + roleName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/federatedsettingsidentityprovider/data_source_federated_settings_identity_providers.go b/internal/service/federatedsettingsidentityprovider/data_source_federated_settings_identity_providers.go index 1f27868990..b7091b6531 100644 --- a/internal/service/federatedsettingsidentityprovider/data_source_federated_settings_identity_providers.go +++ b/internal/service/federatedsettingsidentityprovider/data_source_federated_settings_identity_providers.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func PluralDataSource() *schema.Resource { diff --git a/internal/service/federatedsettingsidentityprovider/model_federated_settings_identity_provider.go b/internal/service/federatedsettingsidentityprovider/model_federated_settings_identity_provider.go index b24fb168e4..6043c8f4d8 100644 --- a/internal/service/federatedsettingsidentityprovider/model_federated_settings_identity_provider.go +++ b/internal/service/federatedsettingsidentityprovider/model_federated_settings_identity_provider.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func FlattenFederatedSettingsIdentityProvider(federatedSettingsIdentityProvider []admin.FederationIdentityProvider) []map[string]any { diff --git a/internal/service/federatedsettingsidentityprovider/model_federated_settings_identity_provider_test.go b/internal/service/federatedsettingsidentityprovider/model_federated_settings_identity_provider_test.go index 25014476d9..73397bec71 100644 --- a/internal/service/federatedsettingsidentityprovider/model_federated_settings_identity_provider_test.go +++ b/internal/service/federatedsettingsidentityprovider/model_federated_settings_identity_provider_test.go @@ -7,7 +7,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/federatedsettingsidentityprovider" "github.com/stretchr/testify/assert" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) var ( diff --git a/internal/service/federatedsettingsidentityprovider/resource_federated_settings_identity_provider.go b/internal/service/federatedsettingsidentityprovider/resource_federated_settings_identity_provider.go index 3b7d13c092..8cd85352d1 100644 --- a/internal/service/federatedsettingsidentityprovider/resource_federated_settings_identity_provider.go +++ b/internal/service/federatedsettingsidentityprovider/resource_federated_settings_identity_provider.go @@ -8,7 +8,7 @@ import ( "regexp" admin20231001002 "go.mongodb.org/atlas-sdk/v20231001002/admin" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/service/federatedsettingsidentityprovider/resource_federated_settings_identity_provider_test.go b/internal/service/federatedsettingsidentityprovider/resource_federated_settings_identity_provider_test.go index c65f4b157d..1c24c016ba 100644 --- a/internal/service/federatedsettingsidentityprovider/resource_federated_settings_identity_provider_test.go +++ b/internal/service/federatedsettingsidentityprovider/resource_federated_settings_identity_provider_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccFederatedSettingsIdentityProviderRS_basic(t *testing.T) { diff --git a/internal/service/globalclusterconfig/resource_global_cluster_config.go b/internal/service/globalclusterconfig/resource_global_cluster_config.go index 7c0e631e2d..eb19fa2cac 100644 --- a/internal/service/globalclusterconfig/resource_global_cluster_config.go +++ b/internal/service/globalclusterconfig/resource_global_cluster_config.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/globalclusterconfig/resource_global_cluster_config_migration_test.go b/internal/service/globalclusterconfig/resource_global_cluster_config_migration_test.go index 9e04879beb..55e7011d9e 100644 --- a/internal/service/globalclusterconfig/resource_global_cluster_config_migration_test.go +++ b/internal/service/globalclusterconfig/resource_global_cluster_config_migration_test.go @@ -33,7 +33,7 @@ func TestAccMigrationClusterRSGlobalCluster_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "managed_namespaces.0.is_shard_key_unique", "false"), ), }, - mig.TestStep(config), + mig.TestStepCheckEmptyPlan(config), }, }) } diff --git a/internal/service/ldapconfiguration/data_source_ldap_configuration_test.go b/internal/service/ldapconfiguration/data_source_ldap_configuration_test.go index f8d37bf095..0954a791fe 100644 --- a/internal/service/ldapconfiguration/data_source_ldap_configuration_test.go +++ b/internal/service/ldapconfiguration/data_source_ldap_configuration_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "github.com/spf13/cast" @@ -17,12 +16,12 @@ func TestAccLDAPConfigurationDS_basic(t *testing.T) { ldapConfiguration matlas.LDAPConfiguration resourceName = "mongodbatlas_ldap_configuration.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") hostname = os.Getenv("MONGODB_ATLAS_LDAP_HOSTNAME") username = os.Getenv("MONGODB_ATLAS_LDAP_USERNAME") password = os.Getenv("MONGODB_ATLAS_LDAP_PASSWORD") - authEnabled = true port = os.Getenv("MONGODB_ATLAS_LDAP_PORT") + authEnabled = true + projectName = acc.RandomProjectName() ) resource.Test(t, resource.TestCase{ diff --git a/internal/service/ldapconfiguration/resource_ldap_configuration_test.go b/internal/service/ldapconfiguration/resource_ldap_configuration_test.go index 9ee540ad6a..be164d6f91 100644 --- a/internal/service/ldapconfiguration/resource_ldap_configuration_test.go +++ b/internal/service/ldapconfiguration/resource_ldap_configuration_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -19,12 +18,12 @@ func TestAccLDAPConfiguration_basic(t *testing.T) { ldapConfiguration matlas.LDAPConfiguration resourceName = "mongodbatlas_ldap_configuration.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - authEnabled = true hostname = os.Getenv("MONGODB_ATLAS_LDAP_HOSTNAME") username = os.Getenv("MONGODB_ATLAS_LDAP_USERNAME") password = os.Getenv("MONGODB_ATLAS_LDAP_PASSWORD") port = os.Getenv("MONGODB_ATLAS_LDAP_PORT") + authEnabled = true + projectName = acc.RandomProjectName() ) resource.Test(t, resource.TestCase{ @@ -55,8 +54,8 @@ func TestAccLDAPConfiguration_withVerify_CACertificateComplete(t *testing.T) { resourceName = "mongodbatlas_ldap_configuration.test" resourceVerifyName = "mongodbatlas_ldap_verify.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - clusterName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() hostname = os.Getenv("MONGODB_ATLAS_LDAP_HOSTNAME") username = os.Getenv("MONGODB_ATLAS_LDAP_USERNAME") password = os.Getenv("MONGODB_ATLAS_LDAP_PASSWORD") @@ -103,12 +102,12 @@ func TestAccLDAPConfiguration_importBasic(t *testing.T) { ldapConf = matlas.LDAPConfiguration{} resourceName = "mongodbatlas_ldap_configuration.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - authEnabled = true hostname = os.Getenv("MONGODB_ATLAS_LDAP_HOSTNAME") username = os.Getenv("MONGODB_ATLAS_LDAP_USERNAME") password = os.Getenv("MONGODB_ATLAS_LDAP_PASSWORD") port = os.Getenv("MONGODB_ATLAS_LDAP_PORT") + authEnabled = true + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/ldapverify/data_source_ldap_verify_test.go b/internal/service/ldapverify/data_source_ldap_verify_test.go index 21f921bc76..8034b5b854 100644 --- a/internal/service/ldapverify/data_source_ldap_verify_test.go +++ b/internal/service/ldapverify/data_source_ldap_verify_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "github.com/spf13/cast" @@ -18,8 +17,8 @@ func TestAccLDAPVerifyDS_basic(t *testing.T) { ldapVerify matlas.LDAPConfiguration resourceName = "mongodbatlas_ldap_verify.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - clusterName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() hostname = os.Getenv("MONGODB_ATLAS_LDAP_HOSTNAME") username = os.Getenv("MONGODB_ATLAS_LDAP_USERNAME") password = os.Getenv("MONGODB_ATLAS_LDAP_PASSWORD") diff --git a/internal/service/ldapverify/resource_ldap_verify_test.go b/internal/service/ldapverify/resource_ldap_verify_test.go index 7a87df56e1..5ba7d12628 100644 --- a/internal/service/ldapverify/resource_ldap_verify_test.go +++ b/internal/service/ldapverify/resource_ldap_verify_test.go @@ -9,8 +9,6 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "github.com/spf13/cast" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" - "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" matlas "go.mongodb.org/atlas/mongodbatlas" @@ -21,8 +19,8 @@ func TestAccLDAPVerify_basic(t *testing.T) { ldapVerify matlas.LDAPConfiguration resourceName = "mongodbatlas_ldap_verify.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - clusterName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() hostname = os.Getenv("MONGODB_ATLAS_LDAP_HOSTNAME") username = os.Getenv("MONGODB_ATLAS_LDAP_USERNAME") password = os.Getenv("MONGODB_ATLAS_LDAP_PASSWORD") @@ -56,8 +54,8 @@ func TestAccLDAPVerify_withConfiguration_CACertificate(t *testing.T) { ldapVerify matlas.LDAPConfiguration resourceName = "mongodbatlas_ldap_verify.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - clusterName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() hostname = os.Getenv("MONGODB_ATLAS_LDAP_HOSTNAME") username = os.Getenv("MONGODB_ATLAS_LDAP_USERNAME") password = os.Getenv("MONGODB_ATLAS_LDAP_PASSWORD") @@ -98,8 +96,8 @@ func TestAccLDAPVerify_importBasic(t *testing.T) { ldapConf = matlas.LDAPConfiguration{} resourceName = "mongodbatlas_ldap_verify.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - clusterName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() hostname = os.Getenv("MONGODB_ATLAS_LDAP_HOSTNAME") username = os.Getenv("MONGODB_ATLAS_LDAP_USERNAME") password = os.Getenv("MONGODB_ATLAS_LDAP_PASSWORD") diff --git a/internal/service/maintenancewindow/resource_maintenance_window.go b/internal/service/maintenancewindow/resource_maintenance_window.go index b71120a76e..df8893a339 100644 --- a/internal/service/maintenancewindow/resource_maintenance_window.go +++ b/internal/service/maintenancewindow/resource_maintenance_window.go @@ -10,7 +10,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/spf13/cast" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/networkcontainer/data_source_network_containers.go b/internal/service/networkcontainer/data_source_network_containers.go index a01d60b69e..5fd6f83e03 100644 --- a/internal/service/networkcontainer/data_source_network_containers.go +++ b/internal/service/networkcontainer/data_source_network_containers.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func PluralDataSource() *schema.Resource { diff --git a/internal/service/networkcontainer/resource_network_container.go b/internal/service/networkcontainer/resource_network_container.go index 121c2639f2..4ef25ab795 100644 --- a/internal/service/networkcontainer/resource_network_container.go +++ b/internal/service/networkcontainer/resource_network_container.go @@ -18,7 +18,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/spf13/cast" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/onlinearchive/resource_online_archive.go b/internal/service/onlinearchive/resource_online_archive.go index bac45d6b7b..d91df7315b 100644 --- a/internal/service/onlinearchive/resource_online_archive.go +++ b/internal/service/onlinearchive/resource_online_archive.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/organization/data_source_organizations.go b/internal/service/organization/data_source_organizations.go index 2c739afcce..bd073d3417 100644 --- a/internal/service/organization/data_source_organizations.go +++ b/internal/service/organization/data_source_organizations.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" diff --git a/internal/service/organization/resource_organization.go b/internal/service/organization/resource_organization.go index 3fda39daef..e101f30bbf 100644 --- a/internal/service/organization/resource_organization.go +++ b/internal/service/organization/resource_organization.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/service/organization/resource_organization_migration_test.go b/internal/service/organization/resource_organization_migration_test.go index 75d01b9b2c..f227ed7f67 100644 --- a/internal/service/organization/resource_organization_migration_test.go +++ b/internal/service/organization/resource_organization_migration_test.go @@ -1,11 +1,9 @@ package organization_test import ( - "fmt" "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" @@ -18,7 +16,7 @@ func TestAccMigrationConfigRSOrganization_Basic(t *testing.T) { var ( resourceName = "mongodbatlas_organization.test" orgOwnerID = os.Getenv("MONGODB_ATLAS_ORG_OWNER_ID") - name = fmt.Sprintf("test-acc-organization-%s", acctest.RandString(5)) + name = acc.RandomName() description = "test Key for Acceptance tests" roleName = "ORG_OWNER" ) diff --git a/internal/service/organization/resource_organization_test.go b/internal/service/organization/resource_organization_test.go index ef786382f8..516fcba985 100644 --- a/internal/service/organization/resource_organization_test.go +++ b/internal/service/organization/resource_organization_test.go @@ -7,9 +7,8 @@ import ( "regexp" "testing" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" @@ -24,8 +23,8 @@ func TestAccConfigRSOrganization_Basic(t *testing.T) { var ( resourceName = "mongodbatlas_organization.test" orgOwnerID = os.Getenv("MONGODB_ATLAS_ORG_OWNER_ID") - name = fmt.Sprintf("test-acc-organization-%s", acctest.RandString(5)) - updatedName = fmt.Sprintf("test-acc-organization-updated-%s", acctest.RandString(5)) + name = acc.RandomName() + updatedName = acc.RandomName() description = "test Key for Acceptance tests" roleName = "ORG_OWNER" ) @@ -65,7 +64,7 @@ func TestAccConfigRSOrganization_BasicAccess(t *testing.T) { acc.SkipTestForCI(t) var ( orgOwnerID = os.Getenv("MONGODB_ATLAS_ORG_OWNER_ID") - name = fmt.Sprintf("test-acc-organization-%s", acctest.RandString(5)) + name = acc.RandomName() description = "test Key for Acceptance tests" roleName = "ORG_BILLING_ADMIN" ) @@ -88,7 +87,7 @@ func TestAccConfigRSOrganization_Settings(t *testing.T) { var ( resourceName = "mongodbatlas_organization.test" orgOwnerID = os.Getenv("MONGODB_ATLAS_ORG_OWNER_ID") - name = fmt.Sprintf("test-acc-organization-%s", acctest.RandString(5)) + name = acc.RandomName() description = "test Key for Acceptance tests" roleName = "ORG_OWNER" diff --git a/internal/service/orginvitation/data_source_org_invitation_test.go b/internal/service/orginvitation/data_source_org_invitation_test.go index a3f13a001b..eee4b19c17 100644 --- a/internal/service/orginvitation/data_source_org_invitation_test.go +++ b/internal/service/orginvitation/data_source_org_invitation_test.go @@ -6,7 +6,6 @@ import ( "strings" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -15,7 +14,7 @@ func TestAccConfigDSOrgInvitation_basic(t *testing.T) { var ( dataSourceName = "mongodbatlas_org_invitation.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - name = fmt.Sprintf("test-acc-%s@mongodb.com", acctest.RandString(10)) + name = acc.RandomEmail() initialRole = []string{"ORG_OWNER"} ) diff --git a/internal/service/orginvitation/resource_org_invitation.go b/internal/service/orginvitation/resource_org_invitation.go index 2954e936e0..c251c84acd 100644 --- a/internal/service/orginvitation/resource_org_invitation.go +++ b/internal/service/orginvitation/resource_org_invitation.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func Resource() *schema.Resource { diff --git a/internal/service/orginvitation/resource_org_invitation_migration_test.go b/internal/service/orginvitation/resource_org_invitation_migration_test.go index 4adfdbdda8..749ea75894 100644 --- a/internal/service/orginvitation/resource_org_invitation_migration_test.go +++ b/internal/service/orginvitation/resource_org_invitation_migration_test.go @@ -1,11 +1,9 @@ package orginvitation_test import ( - "fmt" "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" @@ -15,7 +13,7 @@ func TestAccMigrationConfigOrgInvitation_basic(t *testing.T) { var ( resourceName = "mongodbatlas_org_invitation.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - name = fmt.Sprintf("test-acc-%s@mongodb.com", acctest.RandString(10)) + name = acc.RandomEmail() roles = []string{"ORG_GROUP_CREATOR", "ORG_BILLING_ADMIN"} config = configBasic(orgID, name, roles) ) diff --git a/internal/service/orginvitation/resource_org_invitation_test.go b/internal/service/orginvitation/resource_org_invitation_test.go index afa051574d..ad044f4727 100644 --- a/internal/service/orginvitation/resource_org_invitation_test.go +++ b/internal/service/orginvitation/resource_org_invitation_test.go @@ -7,7 +7,6 @@ import ( "strings" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -18,7 +17,7 @@ func TestAccConfigRSOrgInvitation_basic(t *testing.T) { var ( resourceName = "mongodbatlas_org_invitation.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - name = fmt.Sprintf("test-acc-%s@mongodb.com", acctest.RandString(10)) + name = acc.RandomEmail() initialRole = []string{"ORG_OWNER"} updateRoles = []string{"ORG_GROUP_CREATOR", "ORG_BILLING_ADMIN"} ) @@ -59,7 +58,7 @@ func TestAccConfigRSOrgInvitation_importBasic(t *testing.T) { var ( resourceName = "mongodbatlas_org_invitation.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - name = fmt.Sprintf("test-acc-%s@mongodb.com", acctest.RandString(10)) + name = acc.RandomEmail() initialRole = []string{"ORG_OWNER"} ) diff --git a/internal/service/privatelinkendpoint/resource_privatelink_endpoint.go b/internal/service/privatelinkendpoint/resource_privatelink_endpoint.go index 7b776d232a..54220bde1a 100644 --- a/internal/service/privatelinkendpoint/resource_privatelink_endpoint.go +++ b/internal/service/privatelinkendpoint/resource_privatelink_endpoint.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/privatelinkendpointserverless/resource_privatelink_endpoint_serverless.go b/internal/service/privatelinkendpointserverless/resource_privatelink_endpoint_serverless.go index 4d067018f2..29bd7e7ba7 100644 --- a/internal/service/privatelinkendpointserverless/resource_privatelink_endpoint_serverless.go +++ b/internal/service/privatelinkendpointserverless/resource_privatelink_endpoint_serverless.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" diff --git a/internal/service/privatelinkendpointservicedatafederationonlinearchive/data_source_privatelink_endpoint_service_data_federation_online_archives.go b/internal/service/privatelinkendpointservicedatafederationonlinearchive/data_source_privatelink_endpoint_service_data_federation_online_archives.go index fcf84705a0..c512de378a 100644 --- a/internal/service/privatelinkendpointservicedatafederationonlinearchive/data_source_privatelink_endpoint_service_data_federation_online_archives.go +++ b/internal/service/privatelinkendpointservicedatafederationonlinearchive/data_source_privatelink_endpoint_service_data_federation_online_archives.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/datalakepipeline" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const errorPrivateEndpointServiceDataFederationOnlineArchiveList = "error reading Private Endpoings for projectId %s: %s" diff --git a/internal/service/privatelinkendpointservicedatafederationonlinearchive/resource_privatelink_endpoint_service_data_federation_online_archive.go b/internal/service/privatelinkendpointservicedatafederationonlinearchive/resource_privatelink_endpoint_service_data_federation_online_archive.go index c01868a34b..d2f7163867 100644 --- a/internal/service/privatelinkendpointservicedatafederationonlinearchive/resource_privatelink_endpoint_service_data_federation_online_archive.go +++ b/internal/service/privatelinkendpointservicedatafederationonlinearchive/resource_privatelink_endpoint_service_data_federation_online_archive.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/service/privatelinkendpointserviceserverless/data_source_privatelink_endpoints_service_serverless.go b/internal/service/privatelinkendpointserviceserverless/data_source_privatelink_endpoints_service_serverless.go index 6f4175bcb9..2f9ff17c72 100644 --- a/internal/service/privatelinkendpointserviceserverless/data_source_privatelink_endpoints_service_serverless.go +++ b/internal/service/privatelinkendpointserviceserverless/data_source_privatelink_endpoints_service_serverless.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func PluralDataSource() *schema.Resource { diff --git a/internal/service/privatelinkendpointserviceserverless/resource_privatelink_endpoint_service_serverless.go b/internal/service/privatelinkendpointserviceserverless/resource_privatelink_endpoint_service_serverless.go index af19336347..4292da8632 100644 --- a/internal/service/privatelinkendpointserviceserverless/resource_privatelink_endpoint_service_serverless.go +++ b/internal/service/privatelinkendpointserviceserverless/resource_privatelink_endpoint_service_serverless.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/project/data_source_project.go b/internal/service/project/data_source_project.go index c7219ac263..f7aa9b37b0 100644 --- a/internal/service/project/data_source_project.go +++ b/internal/service/project/data_source_project.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/datasource" diff --git a/internal/service/project/data_source_project_test.go b/internal/service/project/data_source_project_test.go index 51a5b55fc3..afbf8f67e4 100644 --- a/internal/service/project/data_source_project_test.go +++ b/internal/service/project/data_source_project_test.go @@ -5,9 +5,8 @@ import ( "os" "testing" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -17,7 +16,7 @@ const dataSourceName = "data.mongodbatlas_project.test" func TestAccProjectDSProject_byID(t *testing.T) { var ( - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") ) resource.ParallelTest(t, resource.TestCase{ @@ -50,7 +49,7 @@ func TestAccProjectDSProject_byID(t *testing.T) { func TestAccProjectDSProject_byName(t *testing.T) { var ( - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") ) resource.ParallelTest(t, resource.TestCase{ @@ -83,7 +82,7 @@ func TestAccProjectDSProject_byName(t *testing.T) { func TestAccProjectDSProject_defaultFlags(t *testing.T) { var ( - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") ) resource.ParallelTest(t, resource.TestCase{ @@ -122,7 +121,7 @@ func TestAccProjectDSProject_defaultFlags(t *testing.T) { func TestAccProjectDSProject_limits(t *testing.T) { var ( - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/project/data_source_projects.go b/internal/service/project/data_source_projects.go index ed12f1b662..c38a1db168 100644 --- a/internal/service/project/data_source_projects.go +++ b/internal/service/project/data_source_projects.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const projectsDataSourceName = "projects" diff --git a/internal/service/project/data_source_projects_test.go b/internal/service/project/data_source_projects_test.go index c2f9158f04..5a9aba3e5d 100644 --- a/internal/service/project/data_source_projects_test.go +++ b/internal/service/project/data_source_projects_test.go @@ -5,9 +5,8 @@ import ( "os" "testing" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -15,8 +14,8 @@ import ( func TestAccProjectDSProjects_basic(t *testing.T) { var ( - projectName = fmt.Sprintf("test-datasource-project-%s", acctest.RandString(10)) orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t); acc.PreCheckProjectTeamsIDsWithMinCount(t, 2) }, @@ -50,9 +49,10 @@ func TestAccProjectDSProjects_basic(t *testing.T) { func TestAccProjectDSProjects_withPagination(t *testing.T) { var ( - projectName = fmt.Sprintf("test-datasource-project-%s", acctest.RandString(10)) orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() ) + resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t); acc.PreCheckProjectTeamsIDsWithMinCount(t, 2) }, ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, diff --git a/internal/service/project/model_project.go b/internal/service/project/model_project.go index 4749f5d44b..29ab27d35c 100644 --- a/internal/service/project/model_project.go +++ b/internal/service/project/model_project.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func NewTFProjectDataSourceModel(ctx context.Context, project *admin.Group, projectProps AdditionalProperties) (*TFProjectDSModel, diag.Diagnostics) { diff --git a/internal/service/project/model_project_test.go b/internal/service/project/model_project_test.go index 2ef516bae0..886c14e0e4 100644 --- a/internal/service/project/model_project_test.go +++ b/internal/service/project/model_project_test.go @@ -8,7 +8,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/project" "github.com/stretchr/testify/assert" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/project/resource_project.go b/internal/service/project/resource_project.go index dabacc2f83..d324f5677c 100644 --- a/internal/service/project/resource_project.go +++ b/internal/service/project/resource_project.go @@ -9,7 +9,7 @@ import ( "sort" "time" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/path" diff --git a/internal/service/project/resource_project_migration_test.go b/internal/service/project/resource_project_migration_test.go index 99c8f81bcd..aee3cc1084 100644 --- a/internal/service/project/resource_project_migration_test.go +++ b/internal/service/project/resource_project_migration_test.go @@ -6,9 +6,8 @@ import ( "strings" "testing" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -18,9 +17,10 @@ import ( func TestAccMigrationProjectRS_withNoProps(t *testing.T) { var ( resourceName = "mongodbatlas_project.test" - projectName = acctest.RandomWithPrefix("test-acc-migration") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() ) + resource.Test(t, resource.TestCase{ PreCheck: func() { mig.PreCheckBasic(t) }, CheckDestroy: acc.CheckDestroyProject, @@ -61,8 +61,8 @@ func TestAccMigrationProjectRS_withTeams(t *testing.T) { var ( project admin.Group resourceName = "mongodbatlas_project.test" - projectName = acctest.RandomWithPrefix("test-acc-teams") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() clusterCount = "0" configWithTeams = acc.ConfigProject(projectName, orgID, []*admin.TeamRole{ @@ -110,9 +110,9 @@ func TestAccMigrationProjectRS_withFalseDefaultSettings(t *testing.T) { var ( project admin.Group resourceName = "mongodbatlas_project.test" - projectName = acctest.RandomWithPrefix("tf-acc-project") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectOwnerID = os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") + projectName = acc.RandomProjectName() configWithTeams = acc.ConfigProjectWithFalseDefaultSettings(projectName, orgID, projectOwnerID) ) @@ -147,8 +147,8 @@ func TestAccMigrationProjectRS_withFalseDefaultSettings(t *testing.T) { func TestAccMigrationProjectRS_withLimits(t *testing.T) { var ( resourceName = "mongodbatlas_project.test" - projectName = acctest.RandomWithPrefix("tf-acc-project") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() config = acc.ConfigProjectWithLimits(projectName, orgID, []*admin.DataFederationLimit{ { Name: "atlas.project.deployment.clusters", @@ -192,11 +192,13 @@ func TestAccMigrationProjectRS_withLimits(t *testing.T) { } func TestAccMigrationProjectRSProjectIPAccesslist_withSettingIPAddress(t *testing.T) { - resourceName := "mongodbatlas_project_ip_access_list.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName := acctest.RandomWithPrefix("test-acc") - ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) - comment := fmt.Sprintf("TestAcc for ipAddress (%s)", ipAddress) + var ( + resourceName = "mongodbatlas_project_ip_access_list.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + ipAddress = acc.RandomIP(179, 154, 226) + comment = fmt.Sprintf("TestAcc for ipAddress (%s)", ipAddress) + ) resource.Test(t, resource.TestCase{ PreCheck: func() { mig.PreCheckBasic(t) }, @@ -228,11 +230,13 @@ func TestAccMigrationProjectRSProjectIPAccesslist_withSettingIPAddress(t *testin } func TestAccMigrationProjectRSProjectIPAccessList_withSettingCIDRBlock(t *testing.T) { - resourceName := "mongodbatlas_project_ip_access_list.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName := acctest.RandomWithPrefix("test-acc") - cidrBlock := fmt.Sprintf("179.154.226.%d/32", acctest.RandIntRange(0, 255)) - comment := fmt.Sprintf("TestAcc for cidrBlock (%s)", cidrBlock) + var ( + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + resourceName = "mongodbatlas_project_ip_access_list.test" + projectName = acc.RandomProjectName() + cidrBlock = acc.RandomIP(179, 154, 226) + "/32" + comment = fmt.Sprintf("TestAcc for cidrBlock (%s)", cidrBlock) + ) resource.Test(t, resource.TestCase{ PreCheck: func() { mig.PreCheckBasic(t) }, @@ -264,11 +268,13 @@ func TestAccMigrationProjectRSProjectIPAccessList_withSettingCIDRBlock(t *testin } func TestAccMigrationProjectRSProjectIPAccessList_withMultipleSetting(t *testing.T) { - resourceName := "mongodbatlas_project_ip_access_list.test_1" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName := acctest.RandomWithPrefix("test-acc") - const ipWhiteListCount = 20 - accessList := make([]map[string]string, 0) + var ( + resourceName = "mongodbatlas_project_ip_access_list.test_1" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + accessList = make([]map[string]string, 0) + ipWhiteListCount = 20 + projectName = acc.RandomProjectName() + ) for i := 0; i < ipWhiteListCount; i++ { entry := make(map[string]string) @@ -277,11 +283,11 @@ func TestAccMigrationProjectRSProjectIPAccessList_withMultipleSetting(t *testing if i%2 == 0 { entryName = "cidr_block" - entry["cidr_block"] = fmt.Sprintf("%d.2.3.%d/32", i, acctest.RandIntRange(0, 255)) + entry["cidr_block"] = acc.RandomIP(byte(i), 2, 3) + "/32" ipAddr = entry["cidr_block"] } else { entryName = "ip_address" - entry["ip_address"] = fmt.Sprintf("%d.2.3.%d", i, acctest.RandIntRange(0, 255)) + entry["ip_address"] = acc.RandomIP(byte(i), 2, 3) ipAddr = entry["ip_address"] } entry["comment"] = fmt.Sprintf("TestAcc for %s (%s)", entryName, ipAddr) diff --git a/internal/service/project/resource_project_test.go b/internal/service/project/resource_project_test.go index 350d3d4e83..2b9194ff91 100644 --- a/internal/service/project/resource_project_test.go +++ b/internal/service/project/resource_project_test.go @@ -10,7 +10,6 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -18,7 +17,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mocksvc" "github.com/stretchr/testify/mock" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) var ( @@ -477,11 +476,10 @@ const resourceName = "mongodbatlas_project.test" func TestAccProjectRSProject_basic(t *testing.T) { var ( - group admin.Group - - projectName = acctest.RandomWithPrefix("test-acc") + group admin.Group orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") clusterCount = "0" + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t); acc.PreCheckProjectTeamsIDsWithMinCount(t, 3) }, @@ -567,9 +565,9 @@ func TestAccProjectRSProject_basic(t *testing.T) { func TestAccProjectRSProject_withProjectOwner(t *testing.T) { var ( group admin.Group - projectName = acctest.RandomWithPrefix("test-acc") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectOwnerID = os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -593,9 +591,9 @@ func TestAccProjectRSProject_withProjectOwner(t *testing.T) { func TestAccProjectRSGovProject_withProjectOwner(t *testing.T) { var ( group admin.Group - projectName = acctest.RandomWithPrefix("tf-acc-project") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID_GOV") projectOwnerID = os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID_GOV") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -618,9 +616,9 @@ func TestAccProjectRSGovProject_withProjectOwner(t *testing.T) { func TestAccProjectRSProject_withFalseDefaultSettings(t *testing.T) { var ( group admin.Group - projectName = acctest.RandomWithPrefix("tf-acc-project") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectOwnerID = os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -644,9 +642,9 @@ func TestAccProjectRSProject_withFalseDefaultSettings(t *testing.T) { func TestAccProjectRSProject_withUpdatedSettings(t *testing.T) { var ( group admin.Group - projectName = acctest.RandomWithPrefix("tf-acc-project") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectOwnerID = os.Getenv("MONGODB_ATLAS_PROJECT_OWNER_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -705,8 +703,8 @@ func TestAccProjectRSProject_withUpdatedSettings(t *testing.T) { func TestAccProjectRSProject_withUpdatedRole(t *testing.T) { var ( - projectName = acctest.RandomWithPrefix("tf-acc-project") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() roleName = "GROUP_DATA_ACCESS_ADMIN" roleNameUpdated = "GROUP_READ_ONLY" clusterCount = "0" @@ -739,7 +737,7 @@ func TestAccProjectRSProject_withUpdatedRole(t *testing.T) { func TestAccProjectRSProject_updatedToEmptyRoles(t *testing.T) { var ( group admin.Group - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") ) resource.ParallelTest(t, resource.TestCase{ @@ -780,8 +778,8 @@ func TestAccProjectRSProject_updatedToEmptyRoles(t *testing.T) { func TestAccProjectRSProject_importBasic(t *testing.T) { var ( - projectName = acctest.RandomWithPrefix("tf-acc-project") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -807,8 +805,8 @@ func TestAccProjectRSProject_importBasic(t *testing.T) { func TestAccProjectRSProject_withUpdatedLimits(t *testing.T) { var ( - projectName = acctest.RandomWithPrefix("tf-acc-project") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -900,8 +898,8 @@ func TestAccProjectRSProject_withUpdatedLimits(t *testing.T) { func TestAccProjectRSProject_updatedToEmptyLimits(t *testing.T) { var ( - projectName = acctest.RandomWithPrefix("tf-acc-project") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -933,8 +931,8 @@ func TestAccProjectRSProject_updatedToEmptyLimits(t *testing.T) { func TestAccProjectRSProject_withInvalidLimitName(t *testing.T) { var ( - projectName = acctest.RandomWithPrefix("tf-acc-project") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -957,8 +955,8 @@ func TestAccProjectRSProject_withInvalidLimitName(t *testing.T) { func TestAccProjectRSProject_withInvalidLimitNameOnUpdate(t *testing.T) { var ( - projectName = acctest.RandomWithPrefix("tf-acc-project") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/project/service_project.go b/internal/service/project/service_project.go index 34ccf6fdae..7e5b23827f 100644 --- a/internal/service/project/service_project.go +++ b/internal/service/project/service_project.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) type GroupProjectService interface { diff --git a/internal/service/projectapikey/resource_project_api_key.go b/internal/service/projectapikey/resource_project_api_key.go index 9ff659aef0..f8c29e3170 100644 --- a/internal/service/projectapikey/resource_project_api_key.go +++ b/internal/service/projectapikey/resource_project_api_key.go @@ -12,7 +12,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" matlas "go.mongodb.org/atlas/mongodbatlas" ) diff --git a/internal/service/projectapikey/resource_project_api_key_test.go b/internal/service/projectapikey/resource_project_api_key_test.go index e29a7d7033..f1e17276b2 100644 --- a/internal/service/projectapikey/resource_project_api_key_test.go +++ b/internal/service/projectapikey/resource_project_api_key_test.go @@ -8,7 +8,6 @@ import ( "strings" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -237,9 +236,9 @@ func TestAccConfigRSProjectAPIKey_RecreateWhenDeletedExternally(t *testing.T) { var ( resourceName = "mongodbatlas_project_api_key.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - descriptionPrefix = "test-acc-project-to-delete-api-key" - description = fmt.Sprintf("%s-%s", descriptionPrefix, acctest.RandString(5)) + projectName = acc.RandomProjectName() + descriptionPrefix = "test-acc-delete-api-key-" + description = descriptionPrefix + acc.RandomName() roleName = "GROUP_OWNER" ) diff --git a/internal/service/projectinvitation/data_source_project_invitation_test.go b/internal/service/projectinvitation/data_source_project_invitation_test.go index 9556458673..7e08420b82 100644 --- a/internal/service/projectinvitation/data_source_project_invitation_test.go +++ b/internal/service/projectinvitation/data_source_project_invitation_test.go @@ -6,7 +6,6 @@ import ( "strings" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -15,8 +14,8 @@ func TestAccProjectDSProjectInvitation_basic(t *testing.T) { var ( dataSourceName = "mongodbatlas_project_invitation.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - name = fmt.Sprintf("test-acc-%s@mongodb.com", acctest.RandString(10)) + projectName = acc.RandomProjectName() + name = acc.RandomEmail() initialRole = []string{"GROUP_OWNER"} ) diff --git a/internal/service/projectinvitation/resource_project_invitation.go b/internal/service/projectinvitation/resource_project_invitation.go index 087a6cd8d3..42d1b4575b 100644 --- a/internal/service/projectinvitation/resource_project_invitation.go +++ b/internal/service/projectinvitation/resource_project_invitation.go @@ -11,7 +11,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func Resource() *schema.Resource { diff --git a/internal/service/projectinvitation/resource_project_invitation_migration_test.go b/internal/service/projectinvitation/resource_project_invitation_migration_test.go index 74976fea68..d5f2333534 100644 --- a/internal/service/projectinvitation/resource_project_invitation_migration_test.go +++ b/internal/service/projectinvitation/resource_project_invitation_migration_test.go @@ -1,11 +1,9 @@ package projectinvitation_test import ( - "fmt" "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -16,8 +14,8 @@ func TestAccMigrationProjectInvitation_basic(t *testing.T) { var ( resourceName = "mongodbatlas_project_invitation.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - name = fmt.Sprintf("test-acc-%s@mongodb.com", acctest.RandString(10)) + projectName = acc.RandomProjectName() + name = acc.RandomEmail() roles = []string{"GROUP_DATA_ACCESS_ADMIN", "GROUP_CLUSTER_MANAGER"} ) diff --git a/internal/service/projectinvitation/resource_project_invitation_test.go b/internal/service/projectinvitation/resource_project_invitation_test.go index 7b433cccc9..651e857d72 100644 --- a/internal/service/projectinvitation/resource_project_invitation_test.go +++ b/internal/service/projectinvitation/resource_project_invitation_test.go @@ -7,7 +7,6 @@ import ( "strings" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -18,8 +17,8 @@ func TestAccProjectRSProjectInvitation_basic(t *testing.T) { var ( resourceName = "mongodbatlas_project_invitation.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - name = fmt.Sprintf("test-acc-%s@mongodb.com", acctest.RandString(10)) + projectName = acc.RandomProjectName() + name = acc.RandomEmail() initialRole = []string{"GROUP_OWNER"} updateRoles = []string{"GROUP_DATA_ACCESS_ADMIN", "GROUP_CLUSTER_MANAGER"} ) @@ -60,8 +59,8 @@ func TestAccProjectRSProjectInvitation_importBasic(t *testing.T) { var ( resourceName = "mongodbatlas_project_invitation.test" orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") - name = fmt.Sprintf("test-acc-%s@mongodb.com", acctest.RandString(10)) + projectName = acc.RandomProjectName() + name = acc.RandomEmail() initialRole = []string{"GROUP_OWNER"} ) diff --git a/internal/service/projectipaccesslist/data_source_project_ip_access_list_migration_test.go b/internal/service/projectipaccesslist/data_source_project_ip_access_list_migration_test.go index 1b9b49881f..f511fe4d89 100644 --- a/internal/service/projectipaccesslist/data_source_project_ip_access_list_migration_test.go +++ b/internal/service/projectipaccesslist/data_source_project_ip_access_list_migration_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -13,11 +12,13 @@ import ( ) func TestAccMigrationProjectDSProjectIPAccessList_SettingIPAddress(t *testing.T) { - dataSourceName := "data.mongodbatlas_project_ip_access_list.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName := acctest.RandomWithPrefix("test-acc") - ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) - comment := fmt.Sprintf("TestAcc for ipAddress (%s)", ipAddress) + var ( + dataSourceName = "data.mongodbatlas_project_ip_access_list.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + ipAddress = acc.RandomIP(179, 154, 226) + comment = fmt.Sprintf("TestAcc for ipAddress (%s)", ipAddress) + ) resource.Test(t, resource.TestCase{ PreCheck: func() { mig.PreCheckBasic(t) }, @@ -48,11 +49,13 @@ func TestAccMigrationProjectDSProjectIPAccessList_SettingIPAddress(t *testing.T) } func TestAccMigrationProjectDSProjectIPAccessList_SettingCIDRBlock(t *testing.T) { - dataSourceName := "data.mongodbatlas_project_ip_access_list.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName := acctest.RandomWithPrefix("test-acc") - cidrBlock := fmt.Sprintf("179.154.226.%d/32", acctest.RandIntRange(0, 255)) - comment := fmt.Sprintf("TestAcc for cidrBlock (%s)", cidrBlock) + var ( + dataSourceName = "data.mongodbatlas_project_ip_access_list.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + cidrBlock = acc.RandomIP(179, 154, 226) + "/32" + comment = fmt.Sprintf("TestAcc for cidrBlock (%s)", cidrBlock) + ) resource.Test(t, resource.TestCase{ PreCheck: func() { mig.PreCheckBasic(t) }, @@ -83,17 +86,18 @@ func TestAccMigrationProjectDSProjectIPAccessList_SettingCIDRBlock(t *testing.T) } func TestAccMigrationProjectDSProjectIPAccessList_SettingAWSSecurityGroup(t *testing.T) { - projectName := acctest.RandomWithPrefix("test-acc-migration-project-aws") - dataSourceName := "data.mongodbatlas_project_ip_access_list.test" - vpcID := os.Getenv("AWS_VPC_ID") - vpcCIDRBlock := os.Getenv("AWS_VPC_CIDR_BLOCK") - awsAccountID := os.Getenv("AWS_ACCOUNT_ID") - awsRegion := os.Getenv("AWS_REGION") - providerName := "AWS" - - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - awsSGroup := os.Getenv("AWS_SECURITY_GROUP_1") - comment := fmt.Sprintf("TestAcc for awsSecurityGroup (%s)", awsSGroup) + var ( + dataSourceName = "data.mongodbatlas_project_ip_access_list.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + awsSGroup = os.Getenv("AWS_SECURITY_GROUP_1") + vpcID = os.Getenv("AWS_VPC_ID") + vpcCIDRBlock = os.Getenv("AWS_VPC_CIDR_BLOCK") + awsAccountID = os.Getenv("AWS_ACCOUNT_ID") + awsRegion = os.Getenv("AWS_REGION") + providerName = "AWS" + projectName = acc.RandomProjectName() + comment = fmt.Sprintf("TestAcc for awsSecurityGroup (%s)", awsSGroup) + ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, diff --git a/internal/service/projectipaccesslist/data_source_project_ip_access_list_test.go b/internal/service/projectipaccesslist/data_source_project_ip_access_list_test.go index 2a86654a46..fb448c65c6 100644 --- a/internal/service/projectipaccesslist/data_source_project_ip_access_list_test.go +++ b/internal/service/projectipaccesslist/data_source_project_ip_access_list_test.go @@ -5,17 +5,18 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) func TestAccProjectDSProjectIPAccessList_SettingIPAddress(t *testing.T) { - resourceName := "mongodbatlas_project_ip_access_list.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName := acctest.RandomWithPrefix("test-acc") - ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) - comment := fmt.Sprintf("TestAcc for ipAddress (%s)", ipAddress) + var ( + resourceName = "mongodbatlas_project_ip_access_list.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + ipAddress = acc.RandomIP(179, 154, 226) + comment = fmt.Sprintf("TestAcc for ipAddress (%s)", ipAddress) + ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -36,11 +37,13 @@ func TestAccProjectDSProjectIPAccessList_SettingIPAddress(t *testing.T) { } func TestAccProjectDSProjectIPAccessList_SettingCIDRBlock(t *testing.T) { - resourceName := "mongodbatlas_project_ip_access_list.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName := acctest.RandomWithPrefix("test-acc") - cidrBlock := fmt.Sprintf("179.154.226.%d/32", acctest.RandIntRange(0, 255)) - comment := fmt.Sprintf("TestAcc for cidrBlock (%s)", cidrBlock) + var ( + resourceName = "mongodbatlas_project_ip_access_list.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + cidrBlock = acc.RandomIP(179, 154, 226) + "/32" + comment = fmt.Sprintf("TestAcc for cidrBlock (%s)", cidrBlock) + ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -62,17 +65,18 @@ func TestAccProjectDSProjectIPAccessList_SettingCIDRBlock(t *testing.T) { } func TestAccProjectDSProjectIPAccessList_SettingAWSSecurityGroup(t *testing.T) { - resourceName := "mongodbatlas_project_ip_access_list.test" - projectName := acctest.RandomWithPrefix("test-acc-project-ds-aws") - vpcID := os.Getenv("AWS_VPC_ID") - vpcCIDRBlock := os.Getenv("AWS_VPC_CIDR_BLOCK") - awsAccountID := os.Getenv("AWS_ACCOUNT_ID") - awsRegion := os.Getenv("AWS_REGION") - providerName := "AWS" - - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - awsSGroup := os.Getenv("AWS_SECURITY_GROUP_1") - comment := fmt.Sprintf("TestAcc for awsSecurityGroup (%s)", awsSGroup) + var ( + resourceName = "mongodbatlas_project_ip_access_list.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + vpcID = os.Getenv("AWS_VPC_ID") + vpcCIDRBlock = os.Getenv("AWS_VPC_CIDR_BLOCK") + awsAccountID = os.Getenv("AWS_ACCOUNT_ID") + awsRegion = os.Getenv("AWS_REGION") + awsSGroup = os.Getenv("AWS_SECURITY_GROUP_1") + providerName = "AWS" + projectName = acc.RandomProjectName() + comment = fmt.Sprintf("TestAcc for awsSecurityGroup (%s)", awsSGroup) + ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, diff --git a/internal/service/projectipaccesslist/model_project_ip_access_list.go b/internal/service/projectipaccesslist/model_project_ip_access_list.go index a33674e174..c88ce3c603 100644 --- a/internal/service/projectipaccesslist/model_project_ip_access_list.go +++ b/internal/service/projectipaccesslist/model_project_ip_access_list.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func NewMongoDBProjectIPAccessList(projectIPAccessListModel *TfProjectIPAccessListModel) *[]admin.NetworkPermissionEntry { diff --git a/internal/service/projectipaccesslist/model_project_ip_access_list_test.go b/internal/service/projectipaccesslist/model_project_ip_access_list_test.go index a47dcd8bed..d21aa35585 100644 --- a/internal/service/projectipaccesslist/model_project_ip_access_list_test.go +++ b/internal/service/projectipaccesslist/model_project_ip_access_list_test.go @@ -9,7 +9,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/projectipaccesslist" "github.com/stretchr/testify/assert" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) var ( diff --git a/internal/service/projectipaccesslist/resource_project_ip_access_list.go b/internal/service/projectipaccesslist/resource_project_ip_access_list.go index 5239f44a01..9a4ddca20a 100644 --- a/internal/service/projectipaccesslist/resource_project_ip_access_list.go +++ b/internal/service/projectipaccesslist/resource_project_ip_access_list.go @@ -20,7 +20,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/validate" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/projectipaccesslist/resource_project_ip_access_list_test.go b/internal/service/projectipaccesslist/resource_project_ip_access_list_test.go index 98950cc623..c05be8f852 100644 --- a/internal/service/projectipaccesslist/resource_project_ip_access_list_test.go +++ b/internal/service/projectipaccesslist/resource_project_ip_access_list_test.go @@ -6,20 +6,20 @@ import ( "regexp" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) func TestAccProjectRSProjectIPAccesslist_SettingIPAddress(t *testing.T) { - resourceName := "mongodbatlas_project_ip_access_list.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName := acctest.RandomWithPrefix("test-acc") - ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) - comment := fmt.Sprintf("TestAcc for ipAddress (%s)", ipAddress) - - updatedIPAddress := fmt.Sprintf("179.154.228.%d", acctest.RandIntRange(0, 255)) - updatedComment := fmt.Sprintf("TestAcc for ipAddress updated (%s)", updatedIPAddress) + var ( + resourceName = "mongodbatlas_project_ip_access_list.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + ipAddress = acc.RandomIP(179, 154, 226) + comment = fmt.Sprintf("TestAcc for ipAddress (%s)", ipAddress) + updatedIPAddress = acc.RandomIP(179, 154, 228) + updatedComment = fmt.Sprintf("TestAcc for ipAddress updated (%s)", updatedIPAddress) + ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -53,14 +53,15 @@ func TestAccProjectRSProjectIPAccesslist_SettingIPAddress(t *testing.T) { } func TestAccProjectRSProjectIPAccessList_SettingCIDRBlock(t *testing.T) { - resourceName := "mongodbatlas_project_ip_access_list.test" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName := acctest.RandomWithPrefix("test-acc") - cidrBlock := fmt.Sprintf("179.154.226.%d/32", acctest.RandIntRange(0, 255)) - comment := fmt.Sprintf("TestAcc for cidrBlock (%s)", cidrBlock) - - updatedCIDRBlock := fmt.Sprintf("179.154.228.%d/32", acctest.RandIntRange(0, 255)) - updatedComment := fmt.Sprintf("TestAcc for cidrBlock updated (%s)", updatedCIDRBlock) + var ( + resourceName = "mongodbatlas_project_ip_access_list.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + cidrBlock = acc.RandomIP(179, 154, 226) + "/32" + comment = fmt.Sprintf("TestAcc for cidrBlock (%s)", cidrBlock) + updatedCIDRBlock = acc.RandomIP(179, 154, 228) + "/32" + updatedComment = fmt.Sprintf("TestAcc for cidrBlock updated (%s)", updatedCIDRBlock) + ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -94,20 +95,20 @@ func TestAccProjectRSProjectIPAccessList_SettingCIDRBlock(t *testing.T) { } func TestAccProjectRSProjectIPAccessList_SettingAWSSecurityGroup(t *testing.T) { - resourceName := "mongodbatlas_project_ip_access_list.test" - projectName := acctest.RandomWithPrefix("test-acc-project-aws") - vpcID := os.Getenv("AWS_VPC_ID") - vpcCIDRBlock := os.Getenv("AWS_VPC_CIDR_BLOCK") - awsAccountID := os.Getenv("AWS_ACCOUNT_ID") - awsRegion := os.Getenv("AWS_REGION") - providerName := "AWS" - - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - awsSGroup := os.Getenv("AWS_SECURITY_GROUP_1") - comment := fmt.Sprintf("TestAcc for awsSecurityGroup (%s)", awsSGroup) - - updatedAWSSgroup := os.Getenv("AWS_SECURITY_GROUP_2") - updatedComment := fmt.Sprintf("TestAcc for awsSecurityGroup updated (%s)", updatedAWSSgroup) + var ( + resourceName = "mongodbatlas_project_ip_access_list.test" + vpcID = os.Getenv("AWS_VPC_ID") + vpcCIDRBlock = os.Getenv("AWS_VPC_CIDR_BLOCK") + awsAccountID = os.Getenv("AWS_ACCOUNT_ID") + awsRegion = os.Getenv("AWS_REGION") + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + awsSGroup = os.Getenv("AWS_SECURITY_GROUP_1") + updatedAWSSgroup = os.Getenv("AWS_SECURITY_GROUP_2") + providerName = "AWS" + projectName = acc.RandomProjectName() + comment = fmt.Sprintf("TestAcc for awsSecurityGroup (%s)", awsSGroup) + updatedComment = fmt.Sprintf("TestAcc for awsSecurityGroup updated (%s)", updatedAWSSgroup) + ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -141,11 +142,13 @@ func TestAccProjectRSProjectIPAccessList_SettingAWSSecurityGroup(t *testing.T) { } func TestAccProjectRSProjectIPAccessList_SettingMultiple(t *testing.T) { - resourceName := "mongodbatlas_project_ip_access_list.test_%d" - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName := acctest.RandomWithPrefix("test-acc") - const ipWhiteListCount = 20 - accessList := make([]map[string]string, 0) + var ( + resourceName = "mongodbatlas_project_ip_access_list.test_%d" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + ipWhiteListCount = 20 + accessList = make([]map[string]string, 0) + ) for i := 0; i < ipWhiteListCount; i++ { entry := make(map[string]string) @@ -154,11 +157,11 @@ func TestAccProjectRSProjectIPAccessList_SettingMultiple(t *testing.T) { if i%2 == 0 { entryName = "cidr_block" - entry["cidr_block"] = fmt.Sprintf("%d.2.3.%d/32", i, acctest.RandIntRange(0, 255)) + entry["cidr_block"] = acc.RandomIP(byte(i), 2, 3) + "/32" ipAddr = entry["cidr_block"] } else { entryName = "ip_address" - entry["ip_address"] = fmt.Sprintf("%d.2.3.%d", i, acctest.RandIntRange(0, 255)) + entry["ip_address"] = acc.RandomIP(byte(i), 2, 3) ipAddr = entry["ip_address"] } entry["comment"] = fmt.Sprintf("TestAcc for %s (%s)", entryName, ipAddr) @@ -192,11 +195,13 @@ func TestAccProjectRSProjectIPAccessList_SettingMultiple(t *testing.T) { } func TestAccProjectRSProjectIPAccessList_importBasic(t *testing.T) { - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName := acctest.RandomWithPrefix("test-acc") - ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) - comment := fmt.Sprintf("TestAcc for ipaddres (%s)", ipAddress) - resourceName := "mongodbatlas_project_ip_access_list.test" + var ( + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + ipAddress = acc.RandomIP(179, 154, 226) + comment = fmt.Sprintf("TestAcc for ipaddres (%s)", ipAddress) + resourceName = "mongodbatlas_project_ip_access_list.test" + ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -217,11 +222,13 @@ func TestAccProjectRSProjectIPAccessList_importBasic(t *testing.T) { } func TestAccProjectRSProjectIPAccessList_importIncorrectId(t *testing.T) { - orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName := acctest.RandomWithPrefix("test-acc") - ipAddress := fmt.Sprintf("179.154.226.%d", acctest.RandIntRange(0, 255)) - comment := fmt.Sprintf("TestAcc for ipaddres (%s)", ipAddress) - resourceName := "mongodbatlas_project_ip_access_list.test" + var ( + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + ipAddress = acc.RandomIP(179, 154, 226) + comment = fmt.Sprintf("TestAcc for ipaddres (%s)", ipAddress) + resourceName = "mongodbatlas_project_ip_access_list.test" + ) resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, diff --git a/internal/service/searchdeployment/model_search_deployment.go b/internal/service/searchdeployment/model_search_deployment.go index 736ad1828c..37ab1dde86 100644 --- a/internal/service/searchdeployment/model_search_deployment.go +++ b/internal/service/searchdeployment/model_search_deployment.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func NewSearchDeploymentReq(ctx context.Context, searchDeploymentPlan *TFSearchDeploymentRSModel) admin.ApiSearchDeploymentRequest { diff --git a/internal/service/searchdeployment/model_search_deployment_test.go b/internal/service/searchdeployment/model_search_deployment_test.go index 504236342d..5f8906f14e 100644 --- a/internal/service/searchdeployment/model_search_deployment_test.go +++ b/internal/service/searchdeployment/model_search_deployment_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/searchdeployment" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) type sdkToTFModelTestCase struct { diff --git a/internal/service/searchdeployment/service_search_deployment.go b/internal/service/searchdeployment/service_search_deployment.go index bfdd924a4c..cf405ff688 100644 --- a/internal/service/searchdeployment/service_search_deployment.go +++ b/internal/service/searchdeployment/service_search_deployment.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) type DeploymentService interface { diff --git a/internal/service/searchdeployment/state_transition_search_deployment.go b/internal/service/searchdeployment/state_transition_search_deployment.go index 15e76df5f1..3efc41ad3a 100644 --- a/internal/service/searchdeployment/state_transition_search_deployment.go +++ b/internal/service/searchdeployment/state_transition_search_deployment.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/retrystrategy" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const SearchDeploymentDoesNotExistsError = "ATLAS_FTS_DEPLOYMENT_DOES_NOT_EXIST" diff --git a/internal/service/searchdeployment/state_transition_search_deployment_test.go b/internal/service/searchdeployment/state_transition_search_deployment_test.go index 6b7511f0ce..be61f2ffe4 100644 --- a/internal/service/searchdeployment/state_transition_search_deployment_test.go +++ b/internal/service/searchdeployment/state_transition_search_deployment_test.go @@ -12,7 +12,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/searchdeployment" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mocksvc" "github.com/stretchr/testify/assert" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) var ( diff --git a/internal/service/searchindex/data_source_search_indexes.go b/internal/service/searchindex/data_source_search_indexes.go index cebdf6ceea..a429e2128c 100644 --- a/internal/service/searchindex/data_source_search_indexes.go +++ b/internal/service/searchindex/data_source_search_indexes.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func PluralDataSource() *schema.Resource { diff --git a/internal/service/searchindex/resource_search_index.go b/internal/service/searchindex/resource_search_index.go index a284c45257..eab30c0f0b 100644 --- a/internal/service/searchindex/resource_search_index.go +++ b/internal/service/searchindex/resource_search_index.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/searchindex/resource_search_index_test.go b/internal/service/searchindex/resource_search_index_test.go index 6f146864d8..dfcee94773 100644 --- a/internal/service/searchindex/resource_search_index_test.go +++ b/internal/service/searchindex/resource_search_index_test.go @@ -5,7 +5,6 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -15,8 +14,8 @@ import ( func TestAccSearchIndexRS_basic(t *testing.T) { var ( clusterInfo = acc.GetClusterInfo(nil) - indexName = acctest.RandomWithPrefix("test-acc-index") - databaseName = acctest.RandomWithPrefix("test-acc-db") + indexName = acc.RandomName() + databaseName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -54,8 +53,8 @@ func TestAccSearchIndexRS_basic(t *testing.T) { func TestAccSearchIndexRS_withSearchType(t *testing.T) { var ( clusterInfo = acc.GetClusterInfo(nil) - indexName = acctest.RandomWithPrefix("test-acc-index") - databaseName = acctest.RandomWithPrefix("test-acc-db") + indexName = acc.RandomName() + databaseName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -93,8 +92,8 @@ func TestAccSearchIndexRS_withSearchType(t *testing.T) { func TestAccSearchIndexRS_withMapping(t *testing.T) { var ( clusterInfo = acc.GetClusterInfo(nil) - indexName = acctest.RandomWithPrefix("test-acc-index") - databaseName = acctest.RandomWithPrefix("test-acc-db") + indexName = acc.RandomName() + databaseName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -137,8 +136,8 @@ func TestAccSearchIndexRS_withMapping(t *testing.T) { func TestAccSearchIndexRS_withSynonyms(t *testing.T) { var ( clusterInfo = acc.GetClusterInfo(nil) - indexName = acctest.RandomWithPrefix("test-acc-index") - databaseName = acctest.RandomWithPrefix("test-acc-db") + indexName = acc.RandomName() + databaseName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -185,8 +184,8 @@ func TestAccSearchIndexRS_withSynonyms(t *testing.T) { func TestAccSearchIndexRS_updatedToEmptySynonyms(t *testing.T) { var ( clusterInfo = acc.GetClusterInfo(nil) - indexName = acctest.RandomWithPrefix("test-acc-index") - databaseName = acctest.RandomWithPrefix("test-acc-db") + indexName = acc.RandomName() + databaseName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -217,8 +216,8 @@ func TestAccSearchIndexRS_updatedToEmptySynonyms(t *testing.T) { func TestAccSearchIndexRS_updatedToEmptyAnalyzers(t *testing.T) { var ( clusterInfo = acc.GetClusterInfo(nil) - indexName = acctest.RandomWithPrefix("test-acc-index") - databaseName = acctest.RandomWithPrefix("test-acc-db") + indexName = acc.RandomName() + databaseName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -246,8 +245,8 @@ func TestAccSearchIndexRS_updatedToEmptyAnalyzers(t *testing.T) { func TestAccSearchIndexRS_updatedToEmptyMappingsFields(t *testing.T) { var ( clusterInfo = acc.GetClusterInfo(nil) - indexName = acctest.RandomWithPrefix("test-acc-index") - databaseName = acctest.RandomWithPrefix("test-acc-db") + indexName = acc.RandomName() + databaseName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -275,8 +274,8 @@ func TestAccSearchIndexRS_updatedToEmptyMappingsFields(t *testing.T) { func TestAccSearchIndexRS_importBasic(t *testing.T) { var ( clusterInfo = acc.GetClusterInfo(nil) - indexName = acctest.RandomWithPrefix("test-acc-index") - databaseName = acctest.RandomWithPrefix("test-acc-db") + indexName = acc.RandomName() + databaseName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, @@ -306,8 +305,8 @@ func TestAccSearchIndexRS_importBasic(t *testing.T) { func TestAccSearchIndexRS_withVector(t *testing.T) { var ( clusterInfo = acc.GetClusterInfo(nil) - indexName = acctest.RandomWithPrefix("test-acc-index") - databaseName = acctest.RandomWithPrefix("test-acc-db") + indexName = acc.RandomName() + databaseName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/serverlessinstance/data_source_serverless_instances.go b/internal/service/serverlessinstance/data_source_serverless_instances.go index a9d5547766..b21617ee92 100644 --- a/internal/service/serverlessinstance/data_source_serverless_instances.go +++ b/internal/service/serverlessinstance/data_source_serverless_instances.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func PluralDataSource() *schema.Resource { diff --git a/internal/service/serverlessinstance/resource_serverless_instance.go b/internal/service/serverlessinstance/resource_serverless_instance.go index 4504f366e7..4c5213ac7e 100644 --- a/internal/service/serverlessinstance/resource_serverless_instance.go +++ b/internal/service/serverlessinstance/resource_serverless_instance.go @@ -15,7 +15,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedcluster" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/serverlessinstance/resource_serverless_instance_test.go b/internal/service/serverlessinstance/resource_serverless_instance_test.go index 5a534c6074..68bfd51a65 100644 --- a/internal/service/serverlessinstance/resource_serverless_instance_test.go +++ b/internal/service/serverlessinstance/resource_serverless_instance_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/sharedtier/data_source_cloud_shared_tier_restore_jobs.go b/internal/service/sharedtier/data_source_cloud_shared_tier_restore_jobs.go index 962d937ca2..6141a055d1 100644 --- a/internal/service/sharedtier/data_source_cloud_shared_tier_restore_jobs.go +++ b/internal/service/sharedtier/data_source_cloud_shared_tier_restore_jobs.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" diff --git a/internal/service/sharedtier/data_source_shared_tier_snapshots.go b/internal/service/sharedtier/data_source_shared_tier_snapshots.go index e0eb0e2bd8..a27d6f31b6 100644 --- a/internal/service/sharedtier/data_source_shared_tier_snapshots.go +++ b/internal/service/sharedtier/data_source_shared_tier_snapshots.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" diff --git a/internal/service/streamconnection/data_source_stream_connection_test.go b/internal/service/streamconnection/data_source_stream_connection_test.go index e66b0aaa08..a9b3451fb4 100644 --- a/internal/service/streamconnection/data_source_stream_connection_test.go +++ b/internal/service/streamconnection/data_source_stream_connection_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -13,9 +12,9 @@ import ( func TestAccStreamDSStreamConnection_kafkaPlaintext(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-instance") - dataSourceName = "data.mongodbatlas_stream_connection.test" + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() + dataSourceName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) }, @@ -33,8 +32,8 @@ func TestAccStreamDSStreamConnection_kafkaPlaintext(t *testing.T) { func TestAccStreamDSStreamConnection_kafkaSSL(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-instance") + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() dataSourceName = "data.mongodbatlas_stream_connection.test" ) resource.ParallelTest(t, resource.TestCase{ @@ -52,9 +51,9 @@ func TestAccStreamDSStreamConnection_kafkaSSL(t *testing.T) { func TestAccStreamDSStreamConnection_cluster(t *testing.T) { var ( - clusterInfo = acc.GetClusterInfo(nil) - instanceName = acctest.RandomWithPrefix("test-acc-name") dataSourceName = "data.mongodbatlas_stream_connection.test" + clusterInfo = acc.GetClusterInfo(nil) + instanceName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) }, diff --git a/internal/service/streamconnection/data_source_stream_connections.go b/internal/service/streamconnection/data_source_stream_connections.go index 3084f0266d..891b4e9592 100644 --- a/internal/service/streamconnection/data_source_stream_connections.go +++ b/internal/service/streamconnection/data_source_stream_connections.go @@ -10,7 +10,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/dsschema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) var _ datasource.DataSource = &streamConnectionsDS{} diff --git a/internal/service/streamconnection/data_source_stream_connections_test.go b/internal/service/streamconnection/data_source_stream_connections_test.go index 1e74d3f6be..6bab38ec6d 100644 --- a/internal/service/streamconnection/data_source_stream_connections_test.go +++ b/internal/service/streamconnection/data_source_stream_connections_test.go @@ -5,18 +5,17 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccStreamDSStreamConnections_basic(t *testing.T) { var ( - orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-instance") dataSourceName = "data.mongodbatlas_stream_connections.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) }, @@ -33,10 +32,10 @@ func TestAccStreamDSStreamConnections_basic(t *testing.T) { func TestAccStreamDSStreamConnections_withPageConfig(t *testing.T) { var ( - orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-instance") dataSourceName = "data.mongodbatlas_stream_connections.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) }, diff --git a/internal/service/streamconnection/model_stream_connection.go b/internal/service/streamconnection/model_stream_connection.go index 79fcf8351f..b929a6572f 100644 --- a/internal/service/streamconnection/model_stream_connection.go +++ b/internal/service/streamconnection/model_stream_connection.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func NewStreamConnectionReq(ctx context.Context, plan *TFStreamConnectionModel) (*admin.StreamsConnection, diag.Diagnostics) { diff --git a/internal/service/streamconnection/model_stream_connection_test.go b/internal/service/streamconnection/model_stream_connection_test.go index 3f01cbbba1..f79ce52dbc 100644 --- a/internal/service/streamconnection/model_stream_connection_test.go +++ b/internal/service/streamconnection/model_stream_connection_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/streamconnection" "github.com/stretchr/testify/assert" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/streamconnection/resource_stream_connection_migration_test.go b/internal/service/streamconnection/resource_stream_connection_migration_test.go index 60c1a3902e..9cbf19cf3e 100644 --- a/internal/service/streamconnection/resource_stream_connection_migration_test.go +++ b/internal/service/streamconnection/resource_stream_connection_migration_test.go @@ -5,7 +5,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -14,10 +13,10 @@ import ( func TestAccMigrationStreamRSStreamConnection_kafkaPlaintext(t *testing.T) { var ( - orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-name") resourceName = "mongodbatlas_stream_connection.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() ) mig.SkipIfVersionBelow(t, "1.14.0") @@ -46,10 +45,10 @@ func TestAccMigrationStreamRSStreamConnection_kafkaPlaintext(t *testing.T) { func TestAccMigrationStreamRSStreamConnection_kafkaSSL(t *testing.T) { var ( - orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-name") resourceName = "mongodbatlas_stream_connection.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() ) mig.SkipIfVersionBelow(t, "1.14.0") @@ -78,9 +77,9 @@ func TestAccMigrationStreamRSStreamConnection_kafkaSSL(t *testing.T) { func TestAccMigrationStreamRSStreamConnection_cluster(t *testing.T) { var ( - clusterInfo = acc.GetClusterInfo(nil) - instanceName = acctest.RandomWithPrefix("test-acc-name") resourceName = "mongodbatlas_stream_connection.test" + clusterInfo = acc.GetClusterInfo(nil) + instanceName = acc.RandomName() ) mig.SkipIfVersionBelow(t, "1.14.0") diff --git a/internal/service/streamconnection/resource_stream_connection_test.go b/internal/service/streamconnection/resource_stream_connection_test.go index 397a2d586b..ffa2632ef8 100644 --- a/internal/service/streamconnection/resource_stream_connection_test.go +++ b/internal/service/streamconnection/resource_stream_connection_test.go @@ -7,7 +7,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -18,10 +17,10 @@ var DummyCACert string func TestAccStreamRSStreamConnection_kafkaPlaintext(t *testing.T) { var ( - orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-name") resourceName = "mongodbatlas_stream_connection.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) }, @@ -49,10 +48,10 @@ func TestAccStreamRSStreamConnection_kafkaPlaintext(t *testing.T) { func TestAccStreamRSStreamConnection_kafkaSSL(t *testing.T) { var ( - orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-name") resourceName = "mongodbatlas_stream_connection.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) }, @@ -76,9 +75,9 @@ func TestAccStreamRSStreamConnection_kafkaSSL(t *testing.T) { func TestAccStreamRSStreamConnection_cluster(t *testing.T) { var ( - clusterInfo = acc.GetClusterInfo(nil) - instanceName = acctest.RandomWithPrefix("test-acc-name") resourceName = "mongodbatlas_stream_connection.test" + clusterInfo = acc.GetClusterInfo(nil) + instanceName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) }, diff --git a/internal/service/streaminstance/data_source_stream_instance_test.go b/internal/service/streaminstance/data_source_stream_instance_test.go index 5cff9423b5..8948e62dec 100644 --- a/internal/service/streaminstance/data_source_stream_instance_test.go +++ b/internal/service/streaminstance/data_source_stream_instance_test.go @@ -5,18 +5,18 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) func TestAccStreamDSStreamInstance_basic(t *testing.T) { var ( - orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-name") dataSourceName = "data.mongodbatlas_stream_instance.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() ) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) }, ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, diff --git a/internal/service/streaminstance/data_source_stream_instances.go b/internal/service/streaminstance/data_source_stream_instances.go index bfa538c630..f13bbbfa3a 100644 --- a/internal/service/streaminstance/data_source_stream_instances.go +++ b/internal/service/streaminstance/data_source_stream_instances.go @@ -10,7 +10,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/dsschema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) var _ datasource.DataSource = &streamInstancesDS{} diff --git a/internal/service/streaminstance/data_source_stream_instances_test.go b/internal/service/streaminstance/data_source_stream_instances_test.go index 15d1eed439..2fff69c393 100644 --- a/internal/service/streaminstance/data_source_stream_instances_test.go +++ b/internal/service/streaminstance/data_source_stream_instances_test.go @@ -5,18 +5,17 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func TestAccStreamDSStreamInstances_basic(t *testing.T) { var ( - orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-name") dataSourceName = "data.mongodbatlas_stream_instances.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) }, @@ -33,11 +32,12 @@ func TestAccStreamDSStreamInstances_basic(t *testing.T) { func TestAccStreamDSStreamInstances_withPageConfig(t *testing.T) { var ( - orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-name") dataSourceName = "data.mongodbatlas_stream_instances.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() ) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) }, ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, diff --git a/internal/service/streaminstance/model_stream_instance.go b/internal/service/streaminstance/model_stream_instance.go index 00e9946135..aff5afa185 100644 --- a/internal/service/streaminstance/model_stream_instance.go +++ b/internal/service/streaminstance/model_stream_instance.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func NewStreamInstanceCreateReq(ctx context.Context, plan *TFStreamInstanceModel) (*admin.StreamsTenant, diag.Diagnostics) { diff --git a/internal/service/streaminstance/model_stream_instance_test.go b/internal/service/streaminstance/model_stream_instance_test.go index dc4f486a34..b543428495 100644 --- a/internal/service/streaminstance/model_stream_instance_test.go +++ b/internal/service/streaminstance/model_stream_instance_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/streaminstance" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/streaminstance/resource_stream_instance_migration_test.go b/internal/service/streaminstance/resource_stream_instance_migration_test.go index 865134e982..86bff01b15 100644 --- a/internal/service/streaminstance/resource_stream_instance_migration_test.go +++ b/internal/service/streaminstance/resource_stream_instance_migration_test.go @@ -4,7 +4,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" @@ -15,9 +14,9 @@ import ( func TestAccMigrationStreamRSStreamInstance_basic(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-name") resourceName = "mongodbatlas_stream_instance.test" + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() ) mig.SkipIfVersionBelow(t, "1.14.0") diff --git a/internal/service/streaminstance/resource_stream_instance_test.go b/internal/service/streaminstance/resource_stream_instance_test.go index de964af2ff..a7cad8c1aa 100644 --- a/internal/service/streaminstance/resource_stream_instance_test.go +++ b/internal/service/streaminstance/resource_stream_instance_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -14,10 +13,10 @@ import ( func TestAccStreamRSStreamInstance_basic(t *testing.T) { var ( - orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc-stream") - instanceName = acctest.RandomWithPrefix("test-acc-name") resourceName = "mongodbatlas_stream_instance.test" + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + instanceName = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) }, diff --git a/internal/service/teams/data_source_teams.go b/internal/service/teams/data_source_teams.go index f7eaafa0ef..a890ef84a0 100644 --- a/internal/service/teams/data_source_teams.go +++ b/internal/service/teams/data_source_teams.go @@ -10,7 +10,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func DataSource() *schema.Resource { diff --git a/internal/service/teams/resource_teams.go b/internal/service/teams/resource_teams.go index 08c2bfc173..54e9058545 100644 --- a/internal/service/teams/resource_teams.go +++ b/internal/service/teams/resource_teams.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( @@ -133,7 +133,7 @@ func resourceUpdate(ctx context.Context, d *schema.ResourceData, meta any) diag. if d.HasChange("name") { _, _, err := connV2.TeamsApi.RenameTeam(ctx, orgID, teamID, - &admin.Team{Name: d.Get("name").(string)}, + &admin.TeamUpdate{Name: d.Get("name").(string)}, ).Execute() if err != nil { return diag.FromErr(fmt.Errorf(errorTeamUpdate, err)) diff --git a/internal/service/x509authenticationdatabaseuser/resource_x509_authentication_database_user.go b/internal/service/x509authenticationdatabaseuser/resource_x509_authentication_database_user.go index b6ed7f3f3c..0cb9bfe807 100644 --- a/internal/service/x509authenticationdatabaseuser/resource_x509_authentication_database_user.go +++ b/internal/service/x509authenticationdatabaseuser/resource_x509_authentication_database_user.go @@ -11,7 +11,7 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/spf13/cast" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/service/x509authenticationdatabaseuser/resource_x509_authentication_database_user_migration_test.go b/internal/service/x509authenticationdatabaseuser/resource_x509_authentication_database_user_migration_test.go index c5106efd49..9651934f98 100644 --- a/internal/service/x509authenticationdatabaseuser/resource_x509_authentication_database_user_migration_test.go +++ b/internal/service/x509authenticationdatabaseuser/resource_x509_authentication_database_user_migration_test.go @@ -4,7 +4,6 @@ import ( "os" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" @@ -13,9 +12,9 @@ import ( func TestAccMigrationGenericX509AuthDBUser_basic(t *testing.T) { var ( - username = acctest.RandomWithPrefix("test-acc") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + username = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ @@ -52,7 +51,7 @@ func TestAccMigrationGenericX509AuthDBUser_withCustomerX509(t *testing.T) { var ( cas = os.Getenv("CA_CERT") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/x509authenticationdatabaseuser/resource_x509_authentication_database_user_test.go b/internal/service/x509authenticationdatabaseuser/resource_x509_authentication_database_user_test.go index becefb9a21..c171465164 100644 --- a/internal/service/x509authenticationdatabaseuser/resource_x509_authentication_database_user_test.go +++ b/internal/service/x509authenticationdatabaseuser/resource_x509_authentication_database_user_test.go @@ -21,9 +21,9 @@ const ( func TestAccGenericX509AuthDBUser_basic(t *testing.T) { var ( - username = acctest.RandomWithPrefix("test-acc") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + username = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ @@ -51,7 +51,7 @@ func TestAccGenericX509AuthDBUser_withCustomerX509(t *testing.T) { dataSourceName = "data.mongodbatlas_x509_authentication_database_user.test" cas = os.Getenv("CA_CERT") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -74,9 +74,9 @@ func TestAccGenericX509AuthDBUser_withCustomerX509(t *testing.T) { func TestAccGenericX509AuthDBUser_importBasic(t *testing.T) { var ( - username = acctest.RandomWithPrefix("test-acc") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() + username = acc.RandomName() ) resource.ParallelTest(t, resource.TestCase{ @@ -100,9 +100,9 @@ func TestAccGenericX509AuthDBUser_importBasic(t *testing.T) { func TestAccGenericX509AuthDBUser_withDatabaseUser(t *testing.T) { var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - username = fmt.Sprintf("test-acc-%s", acctest.RandString(10)) + username = acc.RandomName() months = acctest.RandIntRange(1, 24) - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ @@ -128,7 +128,7 @@ func TestAccGenericX509AuthDBUser_importWithCustomerX509(t *testing.T) { var ( cas = os.Getenv("CA_CERT") orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acctest.RandomWithPrefix("test-acc") + projectName = acc.RandomProjectName() ) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/testutil/acc/database_user.go b/internal/testutil/acc/database_user.go index d2572be3af..f4e8b7103b 100644 --- a/internal/testutil/acc/database_user.go +++ b/internal/testutil/acc/database_user.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/databaseuser" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func CheckDatabaseUserExists(resourceName string, dbUser *admin.CloudDatabaseUser) resource.TestCheckFunc { diff --git a/internal/testutil/acc/factory.go b/internal/testutil/acc/factory.go index d86cafd712..b011ae0bfd 100644 --- a/internal/testutil/acc/factory.go +++ b/internal/testutil/acc/factory.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-go/tfprotov6" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/mongodb/terraform-provider-mongodbatlas/internal/provider" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) const ( diff --git a/internal/testutil/acc/name.go b/internal/testutil/acc/name.go index 0039b9d0ff..256e96e7ec 100644 --- a/internal/testutil/acc/name.go +++ b/internal/testutil/acc/name.go @@ -1,6 +1,8 @@ package acc import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" ) @@ -21,3 +23,11 @@ func RandomProjectName() string { func RandomClusterName() string { return acctest.RandomWithPrefix(prefixCluster) } + +func RandomIP(a, b, c byte) string { + return fmt.Sprintf("%d.%d.%d.%d", a, b, c, acctest.RandIntRange(0, 255)) +} + +func RandomEmail() string { + return fmt.Sprintf("%s-%s@mongodb.com", prefixName, acctest.RandString(10)) +} diff --git a/internal/testutil/acc/project.go b/internal/testutil/acc/project.go index 25ca053728..17756047b7 100644 --- a/internal/testutil/acc/project.go +++ b/internal/testutil/acc/project.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func CheckProjectExists(resourceName string, project *admin.Group) resource.TestCheckFunc { diff --git a/internal/testutil/acc/serverless.go b/internal/testutil/acc/serverless.go index e58f79f5e1..3eb9e4bfe8 100644 --- a/internal/testutil/acc/serverless.go +++ b/internal/testutil/acc/serverless.go @@ -3,7 +3,7 @@ package acc import ( "fmt" - "go.mongodb.org/atlas-sdk/v20231115006/admin" + "go.mongodb.org/atlas-sdk/v20231115007/admin" ) func ConfigServerlessInstanceBasic(orgID, projectName, name string, ignoreConnectionStrings bool) string { diff --git a/internal/testutil/mig/test_step.go b/internal/testutil/mig/test_step.go index 9e0a04fbc3..4de74c2f24 100644 --- a/internal/testutil/mig/test_step.go +++ b/internal/testutil/mig/test_step.go @@ -6,11 +6,6 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) -// TestStep is being deprecated in favor of TestStepCheckEmptyPlan -func TestStep(config string) resource.TestStep { - return TestStepCheckEmptyPlan(config) -} - func TestStepCheckEmptyPlan(config string) resource.TestStep { return resource.TestStep{ ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, diff --git a/internal/testutil/mocksvc/cluster_service.go b/internal/testutil/mocksvc/cluster_service.go index 424bbb329e..3e0fb8ecac 100644 --- a/internal/testutil/mocksvc/cluster_service.go +++ b/internal/testutil/mocksvc/cluster_service.go @@ -3,7 +3,7 @@ package mocksvc import ( - admin "go.mongodb.org/atlas-sdk/v20231115006/admin" + admin "go.mongodb.org/atlas-sdk/v20231115007/admin" context "context" diff --git a/internal/testutil/mocksvc/deployment_service.go b/internal/testutil/mocksvc/deployment_service.go index e302a7d138..1c5dd23fcc 100644 --- a/internal/testutil/mocksvc/deployment_service.go +++ b/internal/testutil/mocksvc/deployment_service.go @@ -5,7 +5,7 @@ package mocksvc import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20231115006/admin" + admin "go.mongodb.org/atlas-sdk/v20231115007/admin" http "net/http" diff --git a/internal/testutil/mocksvc/ear_service.go b/internal/testutil/mocksvc/ear_service.go index 29d016e80a..d1e9d8f8ca 100644 --- a/internal/testutil/mocksvc/ear_service.go +++ b/internal/testutil/mocksvc/ear_service.go @@ -5,7 +5,7 @@ package mocksvc import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20231115006/admin" + admin "go.mongodb.org/atlas-sdk/v20231115007/admin" http "net/http" diff --git a/internal/testutil/mocksvc/group_project_service.go b/internal/testutil/mocksvc/group_project_service.go index f421f80919..83e5afae6e 100644 --- a/internal/testutil/mocksvc/group_project_service.go +++ b/internal/testutil/mocksvc/group_project_service.go @@ -5,7 +5,7 @@ package mocksvc import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20231115006/admin" + admin "go.mongodb.org/atlas-sdk/v20231115007/admin" http "net/http"