Skip to content

Commit a9e6cd7

Browse files
authored
feat: Update Resource Policy resource to GA - to be merged after upstream GA (#3276)
1 parent 661da59 commit a9e6cd7

File tree

10 files changed

+16
-37
lines changed

10 files changed

+16
-37
lines changed

.changelog/3276.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
```release-note:note
2+
resource/mongodbatlas_resource_policy: Enables usage without preview environment flag
3+
```
4+
5+
```release-note:note
6+
data-source/mongodbatlas_resource_policy: Enables usage without preview environment flag
7+
```
8+
9+
```release-note:note
10+
data-source/mongodbatlas_resource_policies: Enables usage without preview environment flag
11+
```

.github/workflows/acceptance-tests-runner.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,6 @@ jobs:
984984
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.mongodb_atlas_rp_public_key }}
985985
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.mongodb_atlas_rp_private_key }}
986986
MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }}
987-
MONGODB_ATLAS_ENABLE_PREVIEW: "true"
988987
ACCTEST_PACKAGES: |
989988
./internal/service/resourcepolicy
990989
run: make testacc

docs/data-sources/resource_policies.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
`mongodbatlas_resource_policies` returns all resource policies in an organization.
44

5-
-> **NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions:
6-
1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)).
7-
2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands.
8-
95
## Example Usages
106
```terraform
117
resource "mongodbatlas_resource_policy" "project_ip_access_list" {

docs/data-sources/resource_policy.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
`mongodbatlas_resource_policy` describes a resource policy in an organization.
44

5-
-> **NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions:
6-
1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)).
7-
2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands.
8-
95
## Example Usages
106
```terraform
117
resource "mongodbatlas_resource_policy" "project_ip_access_list" {

docs/resources/resource_policy.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
`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.
44

5-
-> **NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions:
6-
1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)).
7-
2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands.
8-
95

106
## Example Usages
117

examples/mongodbatlas_resource_policy/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# MongoDB Atlas Provider -- Atlas Resource Policy
22
This example creates three different resource policies in an organization.
33

4-
**NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions:
5-
1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)).
6-
2. Enable the [Preview Features](../../README.md#preview-features) when running `terraform` commands.
7-
8-
94
Variables Required to be set:
105
- `public_key`: Atlas public key
116
- `private_key`: Atlas private key

internal/provider/provider.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -456,14 +456,13 @@ func (p *MongodbtlasProvider) DataSources(context.Context) []func() datasource.D
456456
flexsnapshot.PluralDataSource,
457457
flexrestorejob.DataSource,
458458
flexrestorejob.PluralDataSource,
459+
resourcepolicy.DataSource,
460+
resourcepolicy.PluralDataSource,
459461
}
460462
if config.PreviewProviderV2AdvancedCluster() {
461463
dataSources = append(dataSources, advancedclustertpf.DataSource, advancedclustertpf.PluralDataSource)
462464
}
463-
previewDataSources := []func() datasource.DataSource{
464-
resourcepolicy.DataSource,
465-
resourcepolicy.PluralDataSource,
466-
} // Data sources not yet in GA
465+
previewDataSources := []func() datasource.DataSource{} // Data sources not yet in GA
467466
if providerEnablePreview {
468467
dataSources = append(dataSources, previewDataSources...)
469468
}
@@ -486,13 +485,12 @@ func (p *MongodbtlasProvider) Resources(context.Context) []func() resource.Resou
486485
mongodbemployeeaccessgrant.Resource,
487486
streamprivatelinkendpoint.Resource,
488487
flexcluster.Resource,
488+
resourcepolicy.Resource,
489489
}
490490
if config.PreviewProviderV2AdvancedCluster() {
491491
resources = append(resources, advancedclustertpf.Resource)
492492
}
493-
previewResources := []func() resource.Resource{
494-
resourcepolicy.Resource,
495-
} // Resources not yet in GA
493+
previewResources := []func() resource.Resource{} // Resources not yet in GA
496494
if providerEnablePreview {
497495
resources = append(resources, previewResources...)
498496
}

templates/data-sources/resource_policies.md.tmpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
`{{.Name}}` returns all resource policies in an organization.
44

5-
-> **NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions:
6-
1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)).
7-
2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands.
8-
95
## Example Usages
106
{{ tffile (printf "examples/mongodbatlas_resource_policy/main.tf" )}}
117

templates/data-sources/resource_policy.md.tmpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
`{{.Name}}` describes a resource policy in an organization.
44

5-
-> **NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions:
6-
1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)).
7-
2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands.
8-
95
## Example Usages
106
{{ tffile (printf "examples/%s/main.tf" .Name )}}
117

templates/resources/resource_policy.md.tmpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
`{{.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.
44

5-
-> **NOTE**: Resource Policies are currently in Public Preview. To use this feature, you must take the following actions:
6-
1. Enable the `Atlas Resource Policies` Preview Feature in your organization (contact [MongoDB Support](https://www.mongodb.com/services/support)).
7-
2. Enable the [Preview Features](https://github.com/mongodb/terraform-provider-mongodbatlas?tab=readme-ov-file#preview-features) when running `terraform` commands.
8-
95

106
## Example Usages
117

0 commit comments

Comments
 (0)