diff --git a/.github/workflows/acceptance-tests-runner.yml b/.github/workflows/acceptance-tests-runner.yml index 2002553fc2..e5308ad453 100644 --- a/.github/workflows/acceptance-tests-runner.yml +++ b/.github/workflows/acceptance-tests-runner.yml @@ -94,9 +94,6 @@ on: mongodb_atlas_project_ear_pe_id: type: string required: true - mongodb_atlas_enable_preview: - type: string - required: true azure_private_endpoint_region: type: string required: true @@ -661,7 +658,6 @@ jobs: AZURE_KEY_IDENTIFIER: ${{ secrets.azure_key_identifier }} AZURE_KEY_VAULT_NAME_UPDATED: ${{ secrets.azure_key_vault_name_updated }} AZURE_KEY_IDENTIFIER_UPDATED: ${{ secrets.azure_key_identifier_updated }} - MONGODB_ATLAS_ENABLE_PREVIEW: ${{ inputs.mongodb_atlas_enable_preview }} AWS_REGION: ${{ vars.AWS_REGION_LOWERCASE }} AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index 1f090e54f3..6d40b741cf 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -125,7 +125,6 @@ jobs: mongodb_atlas_project_ear_pe_id: ${{ inputs.atlas_cloud_env == 'qa' && vars.MONGODB_ATLAS_PROJECT_EAR_PE_ID_QA || vars.MONGODB_ATLAS_PROJECT_EAR_PE_ID_DEV }} mongodb_atlas_project_ear_pe_aws_id: ${{ inputs.atlas_cloud_env == 'qa' && vars.MONGODB_ATLAS_PROJECT_EAR_PE_AWS_ID_QA || vars.MONGODB_ATLAS_PROJECT_EAR_PE_AWS_ID_DEV }} aws_ear_role_id: ${{ inputs.atlas_cloud_env == 'qa' && vars.AWS_EAR_ROLE_ID_QA || vars.AWS_EAR_ROLE_ID_DEV }} - mongodb_atlas_enable_preview: ${{ vars.MONGODB_ATLAS_ENABLE_PREVIEW }} azure_private_endpoint_region: ${{ vars.AZURE_PRIVATE_ENDPOINT_REGION }} mongodb_atlas_rp_org_id: ${{ inputs.atlas_cloud_env == 'qa' && vars.MONGODB_ATLAS_RP_ORG_ID_QA || vars.MONGODB_ATLAS_RP_ORG_ID_DEV }} confluent_cloud_network_id: ${{ vars.CONFLUENT_CLOUD_NETWORK_ID }} diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 81147486aa..4e51271ebf 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -10,7 +10,6 @@ on: env: AWS_DEFAULT_REGION: us-west-2 - MONGODB_ATLAS_ENABLE_PREVIEW: "true" jobs: tf-validate: diff --git a/README.md b/README.md index ea50b98e8b..40b979baf2 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,6 @@ To use a released provider in your Terraform environment, run [`terraform init`] Documentation about the provider specific configuration options can be found on the [provider's website](https://www.terraform.io/docs/providers/). -## Preview Features -In order to use and/or test preview resources and datasources in this provider you'll need to set the environment variable `MONGODB_ATLAS_ENABLE_PREVIEW` to true. - - -```bash -export MONGODB_ATLAS_ENABLE_PREVIEW=true -``` ## Logs To help with issues, you can turn on Logs with `export TF_LOG=TRACE`. Note: this is very noisy. diff --git a/internal/provider/provider.go b/internal/provider/provider.go index d73336fb49..d7b0812b9a 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -5,7 +5,6 @@ import ( "log" "os" "regexp" - "strconv" "time" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" @@ -50,10 +49,6 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/version" ) -var ( - providerEnablePreview, _ = strconv.ParseBool(os.Getenv("MONGODB_ATLAS_ENABLE_PREVIEW")) -) - const ( MongodbGovCloudURL = "https://cloud.mongodbgov.com" MongodbGovCloudQAURL = "https://cloud-qa.mongodbgov.com" @@ -462,10 +457,6 @@ func (p *MongodbtlasProvider) DataSources(context.Context) []func() datasource.D if config.PreviewProviderV2AdvancedCluster() { dataSources = append(dataSources, advancedclustertpf.DataSource, advancedclustertpf.PluralDataSource) } - previewDataSources := []func() datasource.DataSource{} // Data sources not yet in GA - if providerEnablePreview { - dataSources = append(dataSources, previewDataSources...) - } return dataSources } @@ -490,10 +481,6 @@ func (p *MongodbtlasProvider) Resources(context.Context) []func() resource.Resou if config.PreviewProviderV2AdvancedCluster() { resources = append(resources, advancedclustertpf.Resource) } - previewResources := []func() resource.Resource{} // Resources not yet in GA - if providerEnablePreview { - resources = append(resources, previewResources...) - } return resources } diff --git a/internal/service/resourcepolicy/resource_migration_test.go b/internal/service/resourcepolicy/resource_migration_test.go index 85f5c1a0d0..ab089fe773 100644 --- a/internal/service/resourcepolicy/resource_migration_test.go +++ b/internal/service/resourcepolicy/resource_migration_test.go @@ -7,12 +7,6 @@ import ( ) func TestMigResourcePolicy_basic(t *testing.T) { - mig.SkipIfVersionBelow(t, "1.22.0") // this feature was introduced in provider version 1.21.0, plural data source schema was changed in 1.22.0 - - var description *string - if mig.IsProviderVersionAtLeast("1.32.0") { - description = descriptionPtr - } - - mig.CreateAndRunTestNonParallel(t, basicTestCase(t, description)) + mig.SkipIfVersionBelow(t, "1.33.0") // this feature was GA (no need of MONGODB_ATLAS_ENABLE_PREVIEW env variable) in 1.33.0 + mig.CreateAndRunTestNonParallel(t, basicTestCase(t)) } diff --git a/internal/service/resourcepolicy/resource_test.go b/internal/service/resourcepolicy/resource_test.go index 2cd8cacf45..c067b0dc5e 100644 --- a/internal/service/resourcepolicy/resource_test.go +++ b/internal/service/resourcepolicy/resource_test.go @@ -10,7 +10,6 @@ import ( "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" ) @@ -52,33 +51,31 @@ var ( when { context.project.ipAccessList.contains(ip("0.0.0.0/0")) };` - descriptionPtr = conversion.StringPtr("test-description") + description = "test-description" ) func TestAccResourcePolicy_basic(t *testing.T) { - tc := basicTestCase(t, descriptionPtr) + tc := basicTestCase(t) resource.Test(t, *tc) } -func basicTestCase(t *testing.T, description *string) *resource.TestCase { +func basicTestCase(t *testing.T) *resource.TestCase { t.Helper() var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") policyName = "test-policy" updatedName = "updated-policy" ) - var updatedDescription string - if description != nil { - updatedDescription = fmt.Sprintf("updated-%s", *description) - } + updatedDescription := fmt.Sprintf("updated-%s", description) + return &resource.TestCase{ // Need sequential execution for assertions to be deterministic (plural data source) PreCheck: func() { acc.PreCheckBasic(t) }, ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, CheckDestroy: checkDestroy, Steps: []resource.TestStep{ { - Config: configBasic(orgID, policyName, description), - Check: checksResourcePolicy(orgID, policyName, description, 1), + Config: configBasic(orgID, policyName, &description), + Check: checksResourcePolicy(orgID, policyName, &description, 1), }, { Config: configBasic(orgID, updatedName, nil), diff --git a/internal/testutil/acc/pre_check.go b/internal/testutil/acc/pre_check.go index 44dbe29c97..e07e0039d3 100644 --- a/internal/testutil/acc/pre_check.go +++ b/internal/testutil/acc/pre_check.go @@ -74,14 +74,6 @@ func PreCheckCert(tb testing.TB) { } } -// PreCheckPreviewFlag is used for resources not yet in GA -func PreCheckPreviewFlag(tb testing.TB) { - tb.Helper() - if os.Getenv("MONGODB_ATLAS_ENABLE_PREVIEW") == "" { - tb.Fatal("`MONGODB_ATLAS_ENABLE_PREVIEW` must be set for running this acceptance test") - } -} - func PreCheckCloudProviderAccessAzure(tb testing.TB) { tb.Helper() PreCheckBasic(tb) diff --git a/scripts/generate-doc.sh b/scripts/generate-doc.sh index fd2ed391ec..b580ffbcfa 100755 --- a/scripts/generate-doc.sh +++ b/scripts/generate-doc.sh @@ -67,9 +67,6 @@ if [ ! -f "${TEMPLATE_FOLDER_PATH}/data-sources/${resource_name}s.md.tmpl" ]; th printf "Skipping this check: We assume that the resource does not have a plural data source.\n\n" fi -# ensure preview resource and data sources are also included during generation -export MONGODB_ATLAS_ENABLE_PREVIEW="true" - trap 'rm -R docs-out/' EXIT # temp dir cleanup when script exits tfplugindocs generate --tf-version "${TF_VERSION}" --website-source-dir "${TEMPLATE_FOLDER_PATH}" --rendered-website-dir "docs-out" diff --git a/scripts/generate-docs-all.sh b/scripts/generate-docs-all.sh index 7c61c81054..a60cc25515 100755 --- a/scripts/generate-docs-all.sh +++ b/scripts/generate-docs-all.sh @@ -29,9 +29,6 @@ set -euo pipefail TF_VERSION="${TF_VERSION:-"1.11.4"}" # TF version to use when running tfplugindocs. Default: 1.11.4 TEMPLATE_FOLDER_PATH="${TEMPLATE_FOLDER_PATH:-"templates"}" # PATH to the templates folder. Default: templates -# ensure preview resource and data sources are also included during generation -export MONGODB_ATLAS_ENABLE_PREVIEW="true" - trap 'rm -R docs-out/' EXIT # temp dir cleanup when script exits tfplugindocs generate --tf-version "${TF_VERSION}" --website-source-dir "${TEMPLATE_FOLDER_PATH}" --rendered-website-dir "docs-out" --provider-name "mongodbatlas"