diff --git a/.changelog/3276.txt b/.changelog/3276.txt new file mode 100644 index 0000000000..f30a890a58 --- /dev/null +++ b/.changelog/3276.txt @@ -0,0 +1,11 @@ +```release-note:note +resource/mongodbatlas_resource_policy: Enables usage without preview environment flag +``` + +```release-note:note +data-source/mongodbatlas_resource_policy: Enables usage without preview environment flag +``` + +```release-note:note +data-source/mongodbatlas_resource_policies: Enables usage without preview environment flag +``` diff --git a/.github/workflows/acceptance-tests-runner.yml b/.github/workflows/acceptance-tests-runner.yml index 6798347d7c..2002553fc2 100644 --- a/.github/workflows/acceptance-tests-runner.yml +++ b/.github/workflows/acceptance-tests-runner.yml @@ -984,7 +984,6 @@ jobs: MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.mongodb_atlas_rp_public_key }} MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.mongodb_atlas_rp_private_key }} MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - MONGODB_ATLAS_ENABLE_PREVIEW: "true" ACCTEST_PACKAGES: | ./internal/service/resourcepolicy run: make testacc diff --git a/docs/data-sources/resource_policies.md b/docs/data-sources/resource_policies.md index 2c79bf7f9c..08b4254301 100644 --- a/docs/data-sources/resource_policies.md +++ b/docs/data-sources/resource_policies.md @@ -2,10 +2,6 @@ `mongodbatlas_resource_policies` returns all resource policies in an organization. --> **NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions: -1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)). -2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands. - ## Example Usages ```terraform resource "mongodbatlas_resource_policy" "project_ip_access_list" { diff --git a/docs/data-sources/resource_policy.md b/docs/data-sources/resource_policy.md index c5e306fef0..cc88238a8f 100644 --- a/docs/data-sources/resource_policy.md +++ b/docs/data-sources/resource_policy.md @@ -2,10 +2,6 @@ `mongodbatlas_resource_policy` describes a resource policy in an organization. --> **NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions: -1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)). -2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands. - ## Example Usages ```terraform resource "mongodbatlas_resource_policy" "project_ip_access_list" { diff --git a/docs/resources/resource_policy.md b/docs/resources/resource_policy.md index 3f6624be6f..1906b0b64c 100644 --- a/docs/resources/resource_policy.md +++ b/docs/resources/resource_policy.md @@ -2,10 +2,6 @@ `mongodbatlas_resource_policy` provides a Resource Policy resource. The resource lets you create, edit and delete resource policies to prevent misconfigurations and reduce the need for corrective interventions in your organization. --> **NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions: -1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)). -2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands. - ## Example Usages diff --git a/examples/mongodbatlas_resource_policy/README.md b/examples/mongodbatlas_resource_policy/README.md index 3e8179f3bd..5c4d60397c 100644 --- a/examples/mongodbatlas_resource_policy/README.md +++ b/examples/mongodbatlas_resource_policy/README.md @@ -1,11 +1,6 @@ # MongoDB Atlas Provider -- Atlas Resource Policy This example creates three different resource policies in an organization. -**NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions: -1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)). -2. Enable the [Preview Features](../../README.md#preview-features) when running `terraform` commands. - - Variables Required to be set: - `public_key`: Atlas public key - `private_key`: Atlas private key diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 44c26bf2e0..d73336fb49 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -456,14 +456,13 @@ func (p *MongodbtlasProvider) DataSources(context.Context) []func() datasource.D flexsnapshot.PluralDataSource, flexrestorejob.DataSource, flexrestorejob.PluralDataSource, + resourcepolicy.DataSource, + resourcepolicy.PluralDataSource, } if config.PreviewProviderV2AdvancedCluster() { dataSources = append(dataSources, advancedclustertpf.DataSource, advancedclustertpf.PluralDataSource) } - previewDataSources := []func() datasource.DataSource{ - resourcepolicy.DataSource, - resourcepolicy.PluralDataSource, - } // Data sources not yet in GA + previewDataSources := []func() datasource.DataSource{} // Data sources not yet in GA if providerEnablePreview { dataSources = append(dataSources, previewDataSources...) } @@ -486,13 +485,12 @@ func (p *MongodbtlasProvider) Resources(context.Context) []func() resource.Resou mongodbemployeeaccessgrant.Resource, streamprivatelinkendpoint.Resource, flexcluster.Resource, + resourcepolicy.Resource, } if config.PreviewProviderV2AdvancedCluster() { resources = append(resources, advancedclustertpf.Resource) } - previewResources := []func() resource.Resource{ - resourcepolicy.Resource, - } // Resources not yet in GA + previewResources := []func() resource.Resource{} // Resources not yet in GA if providerEnablePreview { resources = append(resources, previewResources...) } diff --git a/templates/data-sources/resource_policies.md.tmpl b/templates/data-sources/resource_policies.md.tmpl index d33600ae2e..f11ece93be 100644 --- a/templates/data-sources/resource_policies.md.tmpl +++ b/templates/data-sources/resource_policies.md.tmpl @@ -2,10 +2,6 @@ `{{.Name}}` returns all resource policies in an organization. --> **NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions: -1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)). -2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands. - ## Example Usages {{ tffile (printf "examples/mongodbatlas_resource_policy/main.tf" )}} diff --git a/templates/data-sources/resource_policy.md.tmpl b/templates/data-sources/resource_policy.md.tmpl index 2db73d1923..c9cca70438 100644 --- a/templates/data-sources/resource_policy.md.tmpl +++ b/templates/data-sources/resource_policy.md.tmpl @@ -2,10 +2,6 @@ `{{.Name}}` describes a resource policy in an organization. --> **NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions: -1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)). -2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands. - ## Example Usages {{ tffile (printf "examples/%s/main.tf" .Name )}} diff --git a/templates/resources/resource_policy.md.tmpl b/templates/resources/resource_policy.md.tmpl index f3d7fbe8e5..995383b8d5 100644 --- a/templates/resources/resource_policy.md.tmpl +++ b/templates/resources/resource_policy.md.tmpl @@ -2,10 +2,6 @@ `{{.Name}}` provides a Resource Policy resource. The resource lets you create, edit and delete resource policies to prevent misconfigurations and reduce the need for corrective interventions in your organization. --> **NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions: -1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)). -2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands. - ## Example Usages