Skip to content

Commit eb20483

Browse files
authored
refactor: Renames MONGODB_ATLAS_ENABLE_BETA to MONGODB_ATLAS_ENABLE_PREVIEW for features in preview (#2004)
1 parent 8beb615 commit eb20483

22 files changed

+47
-44
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ jobs:
310310
terraform_wrapper: false
311311
- name: Acceptance Tests
312312
env:
313-
MONGODB_ATLAS_ENABLE_BETA: ${{ vars.MONGODB_ATLAS_ENABLE_BETA }}
313+
MONGODB_ATLAS_ENABLE_PREVIEW: ${{ vars.MONGODB_ATLAS_ENABLE_PREVIEW }}
314314
TEST_REGEX: "^TestAccStream"
315315
run: make testacc
316316

.github/workflows/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313

1414
env:
1515
AWS_DEFAULT_REGION: us-west-2
16-
MONGODB_ATLAS_ENABLE_BETA: ${{ vars.MONGODB_ATLAS_ENABLE_BETA }}
16+
MONGODB_ATLAS_ENABLE_PREVIEW: ${{ vars.MONGODB_ATLAS_ENABLE_PREVIEW }}
1717

1818
jobs:
1919
tf-validate:

.github/workflows/migration-tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ jobs:
265265
terraform_wrapper: false
266266
- name: Migration Tests
267267
env:
268-
MONGODB_ATLAS_ENABLE_BETA: ${{ vars.MONGODB_ATLAS_ENABLE_BETA }}
268+
MONGODB_ATLAS_ENABLE_PREVIEW: "true"
269+
# can be removed when MONGODB_ATLAS_LAST_VERSION supports the new MONGODB_ATLAS_ENABLE_PREVIEW flag
270+
MONGODB_ATLAS_ENABLE_BETA: "true"
269271
MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }}
270272
TEST_REGEX: "^TestAccMigrationStream"
271273
run: make testacc

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ To use a released provider in your Terraform environment, run [`terraform init`]
2727

2828
Documentation about the provider specific configuration options can be found on the [provider's website](https://www.terraform.io/docs/providers/).
2929

30-
## Beta Features
31-
In order to use and/or test beta resources and datasources in this provider you'll need to set the environment variable `MONGODB_ATLAS_ENABLE_BETA` to true.
30+
## Preview Features
31+
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.
3232

3333

3434
```bash
35-
export MONGODB_ATLAS_ENABLE_BETA = true
35+
export MONGODB_ATLAS_ENABLE_PREVIEW=true
3636
```
3737
## Logs
3838
To help with issues, you can turn on Logs with `export TF_LOG=TRACE`. Note: this is very noisy.

examples/mongodbatlas_stream_instance/atlas-streams-user-journey.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ Atlas Stream Processing is composed of multiple components, and users can levera
77
- `mongodbatlas_stream_instance`: Enables creating, modifying, and deleting Stream Instances. as part of this resource, a computed `hostnames` attribute is available for connecting to the created instance.
88
- `mongodbatlas_stream_connection`: Enables creating, modifying, and deleting Stream Instance Connections, which serve as data sources and sinks for your instance.
99

10-
**NOTE**: To leverage these resources you'll need to set the environment variable `MONGODB_ATLAS_ENABLE_BETA=true` as this functionality is currently in preview. Also see [Limitations](https://www.mongodb.com/docs/atlas/atlas-sp/limitations/#std-label-atlas-sp-limitations) of Atlas Streams Processing during this preview period.
10+
**NOTE**: To leverage these resources you'll need to set the environment variable `MONGODB_ATLAS_ENABLE_PREVIEW=true` as this functionality is currently in preview. Also see [Limitations](https://www.mongodb.com/docs/atlas/atlas-sp/limitations/#std-label-atlas-sp-limitations) of Atlas Streams Processing during this preview period.
1111

1212
### Managing Stream Processors
1313

1414
Once a stream instance and its connections have been defined, `Stream Processors` can be created to define how your data will be processed in your instance. There are currently no resources defined in Terraform to provide this configuration. To obtain information on how this can be configured refer to [Manage Stream Processors](https://www.mongodb.com/docs/atlas/atlas-sp/manage-stream-processor/#manage-stream-processors).
1515

1616
Connect to your stream instance defined in terraform using the following code block:
17+
1718
```
1819
output "stream_instance_hostname" {
1920
value = mongodbatlas_stream_instance.test.hostnames
2021
}
2122
```
2223

23-
This value can then be used to connect to the stream instance using `mongosh`, as described in the [Get Started Tutorial](https://www.mongodb.com/docs/atlas/atlas-sp/tutorial/).
24+
This value can then be used to connect to the stream instance using `mongosh`, as described in the [Get Started Tutorial](https://www.mongodb.com/docs/atlas/atlas-sp/tutorial/).

internal/provider/provider.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,14 @@ func (p *MongodbtlasProvider) DataSources(context.Context) []func() datasource.D
417417
atlasuser.PluralDataSource,
418418
searchdeployment.DataSource,
419419
}
420-
betaDataSources := []func() datasource.DataSource{
420+
previewDataSources := []func() datasource.DataSource{
421421
streaminstance.DataSource,
422422
streaminstance.PluralDataSource,
423423
streamconnection.DataSource,
424424
streamconnection.PluralDataSource,
425425
}
426-
if ProviderEnableBeta {
427-
dataSources = append(dataSources, betaDataSources...)
426+
if ProviderEnablePreview {
427+
dataSources = append(dataSources, previewDataSources...)
428428
}
429429
return dataSources
430430
}
@@ -438,12 +438,12 @@ func (p *MongodbtlasProvider) Resources(context.Context) []func() resource.Resou
438438
projectipaccesslist.Resource,
439439
searchdeployment.Resource,
440440
}
441-
betaResources := []func() resource.Resource{
441+
previewResources := []func() resource.Resource{
442442
streaminstance.Resource,
443443
streamconnection.Resource,
444444
}
445-
if ProviderEnableBeta {
446-
resources = append(resources, betaResources...)
445+
if ProviderEnablePreview {
446+
resources = append(resources, previewResources...)
447447
}
448448
return resources
449449
}

internal/provider/provider_sdk2.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ import (
6363
)
6464

6565
var (
66-
ProviderEnableBeta, _ = strconv.ParseBool(os.Getenv("MONGODB_ATLAS_ENABLE_BETA"))
66+
ProviderEnablePreview, _ = strconv.ParseBool(os.Getenv("MONGODB_ATLAS_ENABLE_PREVIEW"))
6767
)
6868

6969
type SecretData struct {
@@ -137,7 +137,7 @@ func NewSdkV2Provider() *schema.Provider {
137137
ResourcesMap: getResourcesMap(),
138138
ConfigureContextFunc: providerConfigure,
139139
}
140-
addBetaFeatures(provider)
140+
addPreviewFeatures(provider)
141141
return provider
142142
}
143143

@@ -277,8 +277,8 @@ func getResourcesMap() map[string]*schema.Resource {
277277
return resourcesMap
278278
}
279279

280-
func addBetaFeatures(provider *schema.Provider) {
281-
if ProviderEnableBeta {
280+
func addPreviewFeatures(provider *schema.Provider) {
281+
if ProviderEnablePreview {
282282
return
283283
}
284284
}

internal/service/streamconnection/data_source_stream_connection_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestAccStreamDSStreamConnection_kafkaPlaintext(t *testing.T) {
1717
instanceName = acc.RandomName()
1818
)
1919
resource.ParallelTest(t, resource.TestCase{
20-
PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) },
20+
PreCheck: func() { acc.PreCheckPreviewFlag(t); acc.PreCheckBasic(t) },
2121
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
2222
CheckDestroy: CheckDestroyStreamConnection,
2323
Steps: []resource.TestStep{
@@ -37,7 +37,7 @@ func TestAccStreamDSStreamConnection_kafkaSSL(t *testing.T) {
3737
dataSourceName = "data.mongodbatlas_stream_connection.test"
3838
)
3939
resource.ParallelTest(t, resource.TestCase{
40-
PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) },
40+
PreCheck: func() { acc.PreCheckPreviewFlag(t); acc.PreCheckBasic(t) },
4141
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
4242
CheckDestroy: CheckDestroyStreamConnection,
4343
Steps: []resource.TestStep{
@@ -56,7 +56,7 @@ func TestAccStreamDSStreamConnection_cluster(t *testing.T) {
5656
instanceName = acc.RandomName()
5757
)
5858
resource.ParallelTest(t, resource.TestCase{
59-
PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) },
59+
PreCheck: func() { acc.PreCheckPreviewFlag(t); acc.PreCheckBasic(t) },
6060
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
6161
CheckDestroy: CheckDestroyStreamConnection,
6262
Steps: []resource.TestStep{

internal/service/streamconnection/data_source_stream_connections_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestAccStreamDSStreamConnections_basic(t *testing.T) {
1818
instanceName = acc.RandomName()
1919
)
2020
resource.ParallelTest(t, resource.TestCase{
21-
PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) },
21+
PreCheck: func() { acc.PreCheckPreviewFlag(t); acc.PreCheckBasic(t) },
2222
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
2323
CheckDestroy: CheckDestroyStreamConnection,
2424
Steps: []resource.TestStep{
@@ -38,7 +38,7 @@ func TestAccStreamDSStreamConnections_withPageConfig(t *testing.T) {
3838
instanceName = acc.RandomName()
3939
)
4040
resource.ParallelTest(t, resource.TestCase{
41-
PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) },
41+
PreCheck: func() { acc.PreCheckPreviewFlag(t); acc.PreCheckBasic(t) },
4242
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
4343
CheckDestroy: CheckDestroyStreamConnection,
4444
Steps: []resource.TestStep{

internal/service/streamconnection/resource_stream_connection_migration_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func TestAccMigrationStreamRSStreamConnection_kafkaPlaintext(t *testing.T) {
2121
mig.SkipIfVersionBelow(t, "1.14.0")
2222

2323
resource.ParallelTest(t, resource.TestCase{
24-
PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) },
24+
PreCheck: func() { acc.PreCheckPreviewFlag(t); acc.PreCheckBasic(t) },
2525
CheckDestroy: CheckDestroyStreamConnection,
2626
Steps: []resource.TestStep{
2727
{
@@ -53,7 +53,7 @@ func TestAccMigrationStreamRSStreamConnection_kafkaSSL(t *testing.T) {
5353
mig.SkipIfVersionBelow(t, "1.14.0")
5454

5555
resource.ParallelTest(t, resource.TestCase{
56-
PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) },
56+
PreCheck: func() { acc.PreCheckPreviewFlag(t); acc.PreCheckBasic(t) },
5757
CheckDestroy: CheckDestroyStreamConnection,
5858
Steps: []resource.TestStep{
5959
{
@@ -84,7 +84,7 @@ func TestAccMigrationStreamRSStreamConnection_cluster(t *testing.T) {
8484
mig.SkipIfVersionBelow(t, "1.15.2")
8585

8686
resource.ParallelTest(t, resource.TestCase{
87-
PreCheck: func() { acc.PreCheckBetaFlag(t); acc.PreCheckBasic(t) },
87+
PreCheck: func() { acc.PreCheckPreviewFlag(t); acc.PreCheckBasic(t) },
8888
CheckDestroy: CheckDestroyStreamConnection,
8989
Steps: []resource.TestStep{
9090
{

0 commit comments

Comments
 (0)