Skip to content

Commit

Permalink
feat: Adds mongodbatlas_flex_cluster resource and data sources (#2816)
Browse files Browse the repository at this point in the history
* use SDK dev-preview

* chore: Generate Flex Cluster file structure and resource schema  (#2702)

* generate resource and schema

* pr comments

* correct Map

* feat: Implements `mongodbatlas_flex_cluster` resource (#2716)

* create implementation

* read implementation

* update and delete implementation

* Implement model

* schema refactor

* format

* wip: model tests

* initial model test

* test for NewTFModel

* Test NewAtlasCreateReq

* test NewAtlasUpdateReq

* fix tests

* refactor for tags

* fixes

* implement import

* simplify update

* basic acceptance test

* wip: acc tests

* fix model test

* final changes on tests

* changelog entry

* add resource to fallback template

* Update .changelog/2716.txt

Co-authored-by: Agustin Bettati <[email protected]>

* set resource to preview

---------

Co-authored-by: Melanija Cvetic <[email protected]>
Co-authored-by: Agustin Bettati <[email protected]>

* chore: Enable mongodbatlas_flex_cluster test in CI (#2720)

* create implementation

* read implementation

* update and delete implementation

* initial model test

* Test NewAtlasCreateReq

* fixes

* changelong and fix to acceptance-tests-runner.yml

* fix to changelog

* removed changelog

* resolve rebase issue

* fix to implementation

* change test to use existing project id

* Adjusting predeployed project id name and added preview enable

* fix the naming convension of env var

---------

Co-authored-by: Oriol Arbusi <[email protected]>

* chore: Generate Flex Cluster data source file and schemas (#2725)

* generate data source file and schema for singular Flex Cluster

* Generate plural data source schema

* Changing type of tags in schema

* Fix to data source schema

* chore: Adds state transition logic to mongodbatlas_flex_cluster resource (#2721)

* implements state transition

* use state transition in create, update and delete

* PR comments

* chore: Update operation improvements for `mongodbatlas_flex_cluster` resource (#2729)

* schema refactors

* revert rename

* implement isUpdateAllowed

* failed update test case

* refactor equal checks

* make more exhaustive the failed update test

* remove UseStateForUnknown in state_name

* wip: use plan modifier for non updatable fields

* wip: use plan modifiers on all non updatable attributes

* use plan modifiers to fail on update of certain attributes

* rename planmodifier

* simplify planmodifier

* PR comments

* remove attribute parameter

* markdowndescription over description

* test: Enable mongodbatlas_flex_cluster tests in QA environment (#2741)

* feat: Implements and tests `mongodbatlas_flex_cluster` data source (#2738)

* Implementing read funciton in data source

* Acc test for data source

* Added changelog

* implementing review suggestions

* fix to rebase

* Adjusting default timeout of `flex_cluster` to 3 hours (#2757)

* chore: Rebase dev_branch onto master_branch (#2764)

* feat: Adds `is_slow_operation_thresholding_enabled` attribute to `mongodbatlas_project` (#2698)

* feat: Initial support for is_slow_operation_thresholding_enabled

* test: fix test cases

* chore: add changelog entry

* test: Add extra check for plural data source

* refactor: only set SetSlowOperationThresholding once during update

* chore: fix lint error

* fix: need to set SetSlowOperationThresholding before reading project props from API

* chore: address PR comment

* doc: Add documentation for `is_slow_operation_thresholding_enabled` to project (#2700)

* chore: Updates CHANGELOG.md for #2698

* chore: Use `qa` for TestSuite on Sundays (#2701)

* build(deps): bump go.mongodb.org/atlas-sdk (#2705)

Co-authored-by: lantoli <[email protected]>

* wait in second test (#2707)

* chore: Supports running Test Suite in QA on sundays (#2711)

* Revert "chore: Use `qa` for TestSuite on Sundays (#2701)"

This reverts commit 942e097.

* chore: Supports running qa only on Sundays

* address PR comments

* refactor: move job to steps of variables

* chore: Add top level description

* chore: Adds SDK Preview (#2713)

* add client

* SDK update GHA

* simulate Preview update

* example of use for Admin Preview

* Revert "example of use for Admin Preview"

This reverts commit c5edef5.

* rename adminPreview to adminpreview in client

* example of use of SDK Preview

* reverse example

* go mod tidy

* build(deps): bump go.mongodb.org/atlas-sdk (#2715)

Co-authored-by: lantoli <[email protected]>

* ci: fix env-vars for azure QA (#2709)

* doc: Advanced Cluster Differences and TF Core Upgrades  (#2633)

* adv cluster differences doc updates

* Update docs/index.md

* Update index.md

* Update advanced_cluster.md

* Update advanced_cluster.md

* Update advanced_cluster.md

* Update cluster.md

* Update docs/index.md

Co-authored-by: maastha <[email protected]>

* Update docs/resources/cluster.md

Co-authored-by: maastha <[email protected]>

* Update docs/resources/cluster.md

Co-authored-by: Melissa Plunkett <[email protected]>

* Update advanced_cluster.md

* Update cluster-to-advanced-cluster-migration-guide.md

---------

Co-authored-by: maastha <[email protected]>
Co-authored-by: Melissa Plunkett <[email protected]>

* revert SDK preview changes (#2719)

* fix: Fixes inconsistent result when using a multi-region cluster by always using a single spec (#2685)

* fix: Initial workaround for multiple specs issuing a warning of spec missmatch

* fix: can only use multiple specs in data source (schema limitation)

* test: Add a test to confirm multi-region cluster can be used with search deployment

* chore: changelog file

* chore: fix test enum value

* chore: revert timeout changes

* Update .changelog/2685.txt

Co-authored-by: kanchana-mongodb <[email protected]>

---------

Co-authored-by: Leo Antoli <[email protected]>
Co-authored-by: kanchana-mongodb <[email protected]>

* chore: Updates CHANGELOG.md for #2685

* chore: Updates examples link in index.md for v1.21.2 release

* chore: Updates CHANGELOG.md header for v1.21.2 release

* fix TestAccBackupSnapshotExportJob_basic (#2723)

* chore: Bump github.com/hashicorp/terraform-plugin-framework-validators (#2727)

Bumps [github.com/hashicorp/terraform-plugin-framework-validators](https://github.com/hashicorp/terraform-plugin-framework-validators) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/hashicorp/terraform-plugin-framework-validators/releases)
- [Changelog](https://github.com/hashicorp/terraform-plugin-framework-validators/blob/main/CHANGELOG.md)
- [Commits](hashicorp/terraform-plugin-framework-validators@v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/terraform-plugin-framework-validators
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Fixes `mongodbatlas_project` when user doesn't have project owner permission  (#2731)

* update doc

* add deprecated message

* changelog

* deprecate params

* initial TestAccProject_slowOperationNotOwner

* update version to 1.24.0

* changeRoles

* Revert "changeRoles"

This reverts commit c8ba3c8.

* Revert "initial TestAccProject_slowOperationNotOwner"

This reverts commit d147371.

* don't update the value if it's in Create so value is unknown

* pass warnings

* Update internal/service/project/resource_project.go

Co-authored-by: Marco Suma <[email protected]>

* apply feedback in doc

* clarify docs

---------

Co-authored-by: Marco Suma <[email protected]>

* chore: Updates CHANGELOG.md for #2731

* chore: Merging schema generation internal tool PoC into master branch (#2735)

* feat: Adds initial schema and config models for PoC - Model generation  (#2638)

* update computability type (#2668)

* chore: PoC - Model generation - support primitive types at root level (#2673)

* chore: PoC - Schema code generation - Initial support of primitive types (#2682)

* initial commit with schema generation function and test fixture

* small changes wip

* include specific type generators

* handling element types and imports

* remove unrelated file

* extract template logic to separate file

* small revert change

* extract import to const

* follow up adjustments from PR comments and sync with Aastha

* chore: PoC - Schema code generation - Supporting nested attributes  (#2689)

* support nested attribute types

* rebasing changes related to unit testing adjustment

* chore: PoC - Model generation - Supporting nested schema (List, ListNested, Set & SetNested) (#2693)

* chore: PoC - Model generation - Supporting nested schema (objects - Map, MapNested, SingleNested Attributes) (#2704)

* chore: PoC - Schema code generation - Supporting generation of typed model (#2703)

* support typed model generation inlcuding root and nested attributes

* minor fix for type of types map

* add clarifying comment

* improve name of generated object types, refactor function naming for readability

* fix list map and set nested attribute generation (#2708)

* chore: PoC - Model generation - support config aliases, ignores, and description overrides (#2712)

* chore: PoC - Define make command to call code generation logic (#2706)

* wip

* iterating over all resources

* add config for search deployment

* update golden file test with fix in package name

* use xstring implementation for pascal case

* simplify write file logic

* merge fixes

* chore: PoC - Support configuration of timeout in schema (#2717)

* wip

* rebase fixes

* fix logic avoiding adding timeout in nested schemas

* fix generation

* fix enum processing

* fix golden file in timeout test

* comment out unsupported config properties

* simplify interfaces for attribute generation leaving common code in a separate function

* chore: PoC - handle merging computability in nested attributes (#2722)

* adjusting contributing guide (#2732)

---------

Co-authored-by: maastha <[email protected]>
Co-authored-by: Aastha Mahendru <[email protected]>

* doc: Adds documentation for `replication_specs.*.external_id` computed attribute for `mongodbatlas_advanced_cluster`  (#2734)

* adds M0 (#2730)

* docs: Remove legacy project_id attribute in docs as it has been removed (#2733)

* chore: Updates examples link in index.md for v1.21.3 release

* chore: Updates CHANGELOG.md header for v1.21.3 release

* chore: Unify file name for plural data source schema (#2739)

* change name

* fix name

* rename to plural_data_source.go

* check cluster creation times (#2728)

* fix: Adds new attribute `results` and deprecates `resource_policies` for `mongodbatlas_resource_policies` data source (#2740)

* new attribute results and deprecate resource_policies

* changelog entry

* change test to check new attribute

* fix changelog

* changelog fix

* fix docs

* Update .changelog/2740.txt

Co-authored-by: Leo Antoli <[email protected]>

* migration test

* skip mig test until next version

* fix comment

---------

Co-authored-by: Leo Antoli <[email protected]>

* chore: Updates CHANGELOG.md for #2740

* build(deps): bump go.mongodb.org/atlas-sdk (#2745)

Co-authored-by: wtrocki <[email protected]>

* fix: Fixes change assigments in `mongodbatlas_project_api_key` (#2737)

* fix changed assigments

* fix TestAccProjectAPIKey_updateRole

* changelog

* join configMultiple to configBasic

* don't allow duplicate projectIDs

* fix TestAccProjectAPIKey_dataSources

* refactor Create

* refactor getAPIProjectAssignments and flattenProjectAssignments

* refactor Read

* refactor Delete

* fix TestAccProjectAPIKey_recreateWhenDeletedExternally

* refactor Import

* remove flattenProjectAssignments, flattenProjectAPIKeyRoles and getAPIProjectAssignments

* fix plural ds

* fix basicTestCase

* refactor Update description

* refactor Update

* refactor expandProjectAssignments

* update changelog

* initial checkAggr

* checkExists

* delete redundant TestAccProjectAPIKey_dataSources

* refactor configDuplicatedProject

* refactor configChangingProject

* model file

* more detailed changelog

* revert import

* doc

* refactor checks

* chore: Updates CHANGELOG.md for #2737

* chore: Updates examples link in index.md for v1.21.4 release

* chore: Updates CHANGELOG.md header for v1.21.4 release

* chore: Support computability override in schema generation config (#2743)

* test without parsing config options

* add support for override of computability in config

* refactor tests removing redudant code

* extract common api spec path, handle computed only case

* chore: Bump crazy-max/ghaction-import-gpg from 6.1.0 to 6.2.0 (#2754)

Bumps [crazy-max/ghaction-import-gpg](https://github.com/crazy-max/ghaction-import-gpg) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/crazy-max/ghaction-import-gpg/releases)
- [Commits](crazy-max/ghaction-import-gpg@01dd5d3...cb9bde2)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-import-gpg
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Bump actions/setup-go from 5.0.2 to 5.1.0 (#2753)

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.0.2 to 5.1.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@0a12ed9...41dfa10)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Bump github.com/pb33f/libopenapi from 0.18.1 to 0.18.6 (#2750)

Bumps [github.com/pb33f/libopenapi](https://github.com/pb33f/libopenapi) from 0.18.1 to 0.18.6.
- [Release notes](https://github.com/pb33f/libopenapi/releases)
- [Commits](pb33f/libopenapi@v0.18.1...v0.18.6)

---
updated-dependencies:
- dependency-name: github.com/pb33f/libopenapi
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Bump tj-actions/verify-changed-files (#2751)

Bumps [tj-actions/verify-changed-files](https://github.com/tj-actions/verify-changed-files) from 54483a2138ca67989bc40785aa22faee8b085894 to 530d86d0a237225c87beaa000750988f8965ee31.
- [Release notes](https://github.com/tj-actions/verify-changed-files/releases)
- [Changelog](https://github.com/tj-actions/verify-changed-files/blob/main/HISTORY.md)
- [Commits](tj-actions/verify-changed-files@54483a2...530d86d)

---
updated-dependencies:
- dependency-name: tj-actions/verify-changed-files
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Bump actions/checkout from 4.2.1 to 4.2.2 (#2752)

* chore: Bump actions/checkout from 4.2.1 to 4.2.2

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@eef6144...11bd719)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Trigger Build

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Leo Antoli <[email protected]>

* chore: Automatically updates Terraform version used in repository and test-suite (#2755)

* rename workflow (#2761)

* chore: Updates Atlas Go SDK (#2748)

* build(deps): bump go.mongodb.org/atlas-sdk

* Pin cluster POST and PATCH operations to 2024-08-05 avoiding any unintentional shard level autoscaling

* unifying version clarification in comments

* use sdk utility function for checking error code value

* adjust conditional of error checking preserving behaviour

---------

Co-authored-by: AgustinBettati <[email protected]>
Co-authored-by: Agustin Bettati <[email protected]>

* chore: Generate Flex Cluster file structure and resource schema  (#2702)

* generate resource and schema

* pr comments

* correct Map

* feat: Implements `mongodbatlas_flex_cluster` resource (#2716)

* create implementation

* read implementation

* update and delete implementation

* Implement model

* schema refactor

* format

* wip: model tests

* initial model test

* test for NewTFModel

* Test NewAtlasCreateReq

* test NewAtlasUpdateReq

* fix tests

* refactor for tags

* fixes

* implement import

* simplify update

* basic acceptance test

* wip: acc tests

* fix model test

* final changes on tests

* changelog entry

* add resource to fallback template

* Update .changelog/2716.txt

Co-authored-by: Agustin Bettati <[email protected]>

* set resource to preview

---------

Co-authored-by: Melanija Cvetic <[email protected]>
Co-authored-by: Agustin Bettati <[email protected]>

* chore: Enable mongodbatlas_flex_cluster test in CI (#2720)

* create implementation

* read implementation

* update and delete implementation

* initial model test

* Test NewAtlasCreateReq

* fixes

* changelong and fix to acceptance-tests-runner.yml

* fix to changelog

* removed changelog

* resolve rebase issue

* fix to implementation

* change test to use existing project id

* Adjusting predeployed project id name and added preview enable

* fix the naming convension of env var

---------

Co-authored-by: Oriol Arbusi <[email protected]>

* chore: Generate Flex Cluster data source file and schemas (#2725)

* generate data source file and schema for singular Flex Cluster

* Generate plural data source schema

* Changing type of tags in schema

* Fix to data source schema

* chore: Adds state transition logic to mongodbatlas_flex_cluster resource (#2721)

* implements state transition

* use state transition in create, update and delete

* PR comments

* chore: Update operation improvements for `mongodbatlas_flex_cluster` resource (#2729)

* schema refactors

* revert rename

* implement isUpdateAllowed

* failed update test case

* refactor equal checks

* make more exhaustive the failed update test

* remove UseStateForUnknown in state_name

* wip: use plan modifier for non updatable fields

* wip: use plan modifiers on all non updatable attributes

* use plan modifiers to fail on update of certain attributes

* rename planmodifier

* simplify planmodifier

* PR comments

* remove attribute parameter

* markdowndescription over description

* test: Enable mongodbatlas_flex_cluster tests in QA environment (#2741)

* feat: Implements and tests `mongodbatlas_flex_cluster` data source (#2738)

* Implementing read funciton in data source

* Acc test for data source

* Added changelog

* implementing review suggestions

* fix to rebase

* Adjusting default timeout of `flex_cluster` to 3 hours (#2757)

* fixing imports

* Adopting latest preview SDK version

* fix flex varibale names after bump

* fix atlasuser - set to continue using older SDK version

* Fix to variable type names in flex unit test

* fix duplicate

* fix to api call in atlasUser tests

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Espen Albert <[email protected]>
Co-authored-by: svc-apix-bot <[email protected]>
Co-authored-by: svc-apix-Bot <[email protected]>
Co-authored-by: lantoli <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>
Co-authored-by: maastha <[email protected]>
Co-authored-by: Melissa Plunkett <[email protected]>
Co-authored-by: kanchana-mongodb <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marco Suma <[email protected]>
Co-authored-by: Agustin Bettati <[email protected]>
Co-authored-by: Aastha Mahendru <[email protected]>
Co-authored-by: Oriol <[email protected]>
Co-authored-by: wtrocki <[email protected]>
Co-authored-by: AgustinBettati <[email protected]>

* feat: Implements `mongodbatlas_flex_cluster` plural data source (#2767)

* Fix naming convensions in plural DS schema

* Implementing plural DS read function

* testing and plural ds model

* fixes after rebase

* additional unit testing for model

* changelog

* lint fix

* removing parellel testing

* implemented review feedback

* lint fix

* chore: Improvements to SDK version update (#2770)

* comment use of older API version in atlasUser

* add connv220240805 to factory.go

* doc: Adds documentation and example for mongodbatlas_flex_cluster resource and data source (#2744)

* wip: docs and example (missing data source

* change version to make the CI check successful

* fmt

* regenerate

* data source examples

* readme created - to adjust preview feature note on release of flex to prod

* data source templates

* fix typo

* generate data source documentation

* fix to flex_cluster example

* fix to flex_cluster example

* fix to generated docs

* Added flex to dedicated migration guide

* fix typo

* Implementing feedback and improving flex-dedicated migratoin guide

* adjust flex example README.md

* fix to example

---------

Co-authored-by: Melanija Cvetic <[email protected]>

* deprecate: Deprecates Serverless functionality (#2742)

* deprecates serverless functionality

* documentation

* deprecate attributes in data sources

* set link to migration guide with supported migration paths

* doc: Adds migration guides to transition out of Serverless and Shared-tier clusters (#2746)

* wip: migration guides

* add details on 1.22 guide

* remove guide, will be in resource docs

* wip: correct details on 1.22 guide

* added migration guide for serverless to flex and serverless to dedicated

* added migration guide for shared-tier to flex

* added migration guide for serverless to free

* implementing review feedback

* implementing feedback to guide

* changes to migration guide

* Adjustments to migration guides

* put URL instead of placeholder

* move post before pre autoconversion guides, clarify serverless to dedicated

* pr comment

* pr comments

* Update docs/guides/1.22.0-upgrade-guide.md

Co-authored-by: lmkerbey-mdb <[email protected]>

* Update docs/guides/serverless-shared-migration-guide.md

Co-authored-by: lmkerbey-mdb <[email protected]>

* Update docs/guides/1.22.0-upgrade-guide.md

Co-authored-by: lmkerbey-mdb <[email protected]>

* Update docs/guides/serverless-shared-migration-guide.md

Co-authored-by: lmkerbey-mdb <[email protected]>

* Update docs/guides/serverless-shared-migration-guide.md

Co-authored-by: lmkerbey-mdb <[email protected]>

* Update docs/guides/serverless-shared-migration-guide.md

Co-authored-by: lmkerbey-mdb <[email protected]>

* Update docs/guides/serverless-shared-migration-guide.md

Co-authored-by: cveticm <[email protected]>

* Update docs/guides/serverless-shared-migration-guide.md

Co-authored-by: cveticm <[email protected]>

---------

Co-authored-by: Melanija Cvetic <[email protected]>
Co-authored-by: lmkerbey-mdb <[email protected]>
Co-authored-by: cveticm <[email protected]>

* chore: Removes mentions and examples of Serverless and Shared-tier instances (#2811)

* wip remove mentions of serverless and shared tier

* remove examples from template for serverless privatelink

* change from M5 to M0 for tenant examples of adv cluster

* add note on M0

* chore: Refactor tags attribute schema and conversion logic (#2788)

* Implements tag as common function

* Refactor project and flex cluster to use new common tag functions

* fix to testing and lint

* fix changelog entry

* january or later for shared tier autoconversion

* auto-generate singular data source, temporarily with checks

* remove singular data source check

* update Description in plural data source

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Melanija Cvetic <[email protected]>
Co-authored-by: Agustin Bettati <[email protected]>
Co-authored-by: cveticm <[email protected]>
Co-authored-by: Espen Albert <[email protected]>
Co-authored-by: svc-apix-bot <[email protected]>
Co-authored-by: svc-apix-Bot <[email protected]>
Co-authored-by: lantoli <[email protected]>
Co-authored-by: Zuhair Ahmed <[email protected]>
Co-authored-by: maastha <[email protected]>
Co-authored-by: Melissa Plunkett <[email protected]>
Co-authored-by: kanchana-mongodb <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marco Suma <[email protected]>
Co-authored-by: Aastha Mahendru <[email protected]>
Co-authored-by: wtrocki <[email protected]>
Co-authored-by: AgustinBettati <[email protected]>
Co-authored-by: lmkerbey-mdb <[email protected]>
  • Loading branch information
18 people authored Nov 26, 2024
1 parent ba55260 commit ca002b5
Show file tree
Hide file tree
Showing 85 changed files with 2,659 additions and 841 deletions.
3 changes: 3 additions & 0 deletions .changelog/2716.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
mongodbatlas_flex_cluster
```
3 changes: 3 additions & 0 deletions .changelog/2738.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-datasource
mongodbatlas_flex_cluster
```
39 changes: 39 additions & 0 deletions .changelog/2742.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
```release-note:note
resource/mongodbatlas_serverless_instance: Deprecates `continuous_backup_enabled` attribute
```

```release-note:note
resource/mongodbatlas_serverless_instance: Deprecates `auto_indexing` attribute
```

```release-note:note
data-source/mongodbatlas_serverless_instance: Deprecates `continuous_backup_enabled` attribute
```

```release-note:note
data-source/mongodbatlas_serverless_instance: Deprecates `auto_indexing` attribute
```

```release-note:note
data-source/mongodbatlas_serverless_instances: Deprecates `continuous_backup_enabled` attribute
```

```release-note:note
data-source/mongodbatlas_serverless_instances: Deprecates `auto_indexing` attribute
```

```release-note:note
resource/mongodbatlas_privatelink_endpoint_serverless: Deprecates resource
```

```release-note:note
resource/mongodbatlas_privatelink_endpoint_service_serverless: Deprecates resource
```

```release-note:note
data-source/mongodbatlas_privatelink_endpoint_service_serverless: Deprecates data source
```

```release-note:note
data-source/mongodbatlas_privatelink_endpoints_service_serverless: Deprecates data source
```
3 changes: 3 additions & 0 deletions .changelog/2767.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-datasource
mongodbatlas_flex_clusters
```
30 changes: 30 additions & 0 deletions .github/workflows/acceptance-tests-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ on:
azure_private_endpoint_region:
type: string
required: true
mongodb_atlas_flex_project_id:
type: string
required: true
secrets: # all secrets are passed explicitly in this workflow
mongodb_atlas_public_key:
required: true
Expand Down Expand Up @@ -213,6 +216,7 @@ jobs:
encryption: ${{ steps.filter.outputs.encryption == 'true' || env.mustTrigger == 'true' }}
event_trigger: ${{ steps.filter.outputs.event_trigger == 'true' || env.mustTrigger == 'true' }}
federated: ${{ steps.filter.outputs.federated == 'true' || env.mustTrigger == 'true' }}
flex_cluster: ${{ steps.filter.outputs.flex_cluster == 'true' || env.mustTrigger == 'true' }}
generic: ${{ steps.filter.outputs.generic == 'true' || env.mustTrigger == 'true' }}
global_cluster_config: ${{ steps.filter.outputs.global_cluster_config == 'true' || env.mustTrigger == 'true' }}
ldap: ${{ steps.filter.outputs.ldap == 'true' || env.mustTrigger == 'true' }}
Expand Down Expand Up @@ -278,6 +282,8 @@ jobs:
- 'internal/service/federatedsettingsidentityprovider/*.go'
- 'internal/service/federatedsettingsorgconfig/*.go'
- 'internal/service/federatedsettingsorgrolemapping/*.go'
flex_cluster:
- 'internal/service/flexcluster/*.go'
generic:
- 'internal/service/auditing/*.go'
- 'internal/service/backupcompliancepolicy/*.go'
Expand Down Expand Up @@ -654,6 +660,30 @@ jobs:
./internal/service/federatedsettingsorgrolemapping
run: make testacc

flex_cluster:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.flex_cluster == 'true' || inputs.test_group == 'flex_cluster' }}
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: ${{ inputs.ref || github.ref }}
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version-file: 'go.mod'
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd
with:
terraform_version: ${{ inputs.terraform_version }}
terraform_wrapper: false
- name: Acceptance Tests
env:
MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }}
MONGODB_ATLAS_FLEX_PROJECT_ID: ${{ inputs.mongodb_atlas_flex_project_id }}
MONGODB_ATLAS_ENABLE_PREVIEW: "true"
ACCTEST_PACKAGES: ./internal/service/flexcluster
run: make testacc

generic:
needs: [ change-detection, get-provider-version ]
if: ${{ needs.change-detection.outputs.generic == 'true' || inputs.test_group == 'generic' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,4 @@ jobs:
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 }}
mongodb_atlas_flex_project_id: ${{ inputs.atlas_cloud_env == 'qa' && vars.MONGODB_ATLAS_FLEX_PROJECT_ID_QA || vars.MONGODB_ATLAS_FLEX_PROJECT_ID }}
4 changes: 2 additions & 2 deletions .github/workflows/update-tf-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
- name: Update files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make update-tf-version-in-repository
- name: Verify Changed files
uses: tj-actions/verify-changed-files@530d86d0a237225c87beaa000750988f8965ee31
uses: tj-actions/verify-changed-files@54483a2138ca67989bc40785aa22faee8b085894
id: verify-changed-files
- name: Create PR
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
Expand Down
4 changes: 3 additions & 1 deletion docs/data-sources/advanced_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "mongodbatlas_advanced_cluster" "example" {
replication_specs {
region_configs {
electable_specs {
instance_size = "M5"
instance_size = "M0"
}
provider_name = "TENANT"
backing_provider_name = "AWS"
Expand All @@ -35,6 +35,8 @@ data "mongodbatlas_advanced_cluster" "example" {
}
```

**NOTE:** There can only be one M0 cluster per project.

## Example using latest sharding configurations with independent shard scaling in the cluster

```terraform
Expand Down
4 changes: 3 additions & 1 deletion docs/data-sources/advanced_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "mongodbatlas_advanced_cluster" "example" {
replication_specs {
region_configs {
electable_specs {
instance_size = "M5"
instance_size = "M0"
}
provider_name = "TENANT"
backing_provider_name = "AWS"
Expand All @@ -34,6 +34,8 @@ data "mongodbatlas_advanced_clusters" "example" {
}
```

**NOTE:** There can only be one M0 cluster per project.

## Example using latest sharding configurations with independent shard scaling in the cluster

```terraform
Expand Down
84 changes: 84 additions & 0 deletions docs/data-sources/flex_cluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Data Source: mongodbatlas_flex_cluster

`mongodbatlas_flex_cluster` describes a flex cluster.

## Example Usages
```terraform
resource "mongodbatlas_flex_cluster" "example-cluster" {
project_id = var.project_id
name = var.cluster_name
provider_settings = {
backing_provider_name = "AWS"
region_name = "US_EAST_1"
}
termination_protection_enabled = true
}
data "mongodbatlas_flex_cluster" "example-cluster" {
project_id = var.project_id
name = mongodbatlas_flex_cluster.example-cluster.name
}
data "mongodbatlas_flex_clusters" "example-clusters" {
project_id = var.project_id
}
output "mongodbatlas_flex_cluster" {
value = data.mongodbatlas_flex_cluster.example-cluster.name
}
output "mongodbatlas_flex_clusters_names" {
value = [for cluster in data.mongodbatlas_flex_clusters.example-clusters.results : cluster.name]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Human-readable label that identifies the instance.
- `project_id` (String) Unique 24-hexadecimal character string that identifies the project.

### Read-Only

- `backup_settings` (Attributes) Flex backup configuration (see [below for nested schema](#nestedatt--backup_settings))
- `cluster_type` (String) Flex cluster topology.
- `connection_strings` (Attributes) Collection of Uniform Resource Locators that point to the MongoDB database. (see [below for nested schema](#nestedatt--connection_strings))
- `create_date` (String) Date and time when MongoDB Cloud created this instance. This parameter expresses its value in ISO 8601 format in UTC.
- `id` (String) Unique 24-hexadecimal digit string that identifies the instance.
- `mongo_db_version` (String) Version of MongoDB that the instance runs.
- `provider_settings` (Attributes) Group of cloud provider settings that configure the provisioned MongoDB flex cluster. (see [below for nested schema](#nestedatt--provider_settings))
- `state_name` (String) Human-readable label that indicates the current operating condition of this instance.
- `tags` (Map of String) Map that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the instance.
- `termination_protection_enabled` (Boolean) Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster.
- `version_release_system` (String) Method by which the cluster maintains the MongoDB versions.

<a id="nestedatt--backup_settings"></a>
### Nested Schema for `backup_settings`

Read-Only:

- `enabled` (Boolean) Flag that indicates whether backups are performed for this flex cluster. Backup uses [TODO](TODO) for flex clusters.


<a id="nestedatt--connection_strings"></a>
### Nested Schema for `connection_strings`

Read-Only:

- `standard` (String) Public connection string that you can use to connect to this cluster. This connection string uses the mongodb:// protocol.
- `standard_srv` (String) Public connection string that you can use to connect to this flex cluster. This connection string uses the `mongodb+srv://` protocol.


<a id="nestedatt--provider_settings"></a>
### Nested Schema for `provider_settings`

Read-Only:

- `backing_provider_name` (String) Cloud service provider on which MongoDB Cloud provisioned the flex cluster.
- `disk_size_gb` (Number) Storage capacity available to the flex cluster expressed in gigabytes.
- `provider_name` (String) Human-readable label that identifies the cloud service provider.
- `region_name` (String) Human-readable label that identifies the geographic location of your MongoDB flex cluster. The region you choose can affect network latency for clients accessing your databases. For a complete list of region names, see [AWS](https://docs.atlas.mongodb.com/reference/amazon-aws/#std-label-amazon-aws), [GCP](https://docs.atlas.mongodb.com/reference/google-gcp/), and [Azure](https://docs.atlas.mongodb.com/reference/microsoft-azure/).

For more information see: [MongoDB Atlas API - Flex Cluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Flex-Clusters/operation/getFlexCluster) Documentation.
94 changes: 94 additions & 0 deletions docs/data-sources/flex_clusters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Data Source: mongodbatlas_flex_clusters

`mongodbatlas_flex_clusters` returns all flex clusters in a project.

## Example Usages
```terraform
resource "mongodbatlas_flex_cluster" "example-cluster" {
project_id = var.project_id
name = var.cluster_name
provider_settings = {
backing_provider_name = "AWS"
region_name = "US_EAST_1"
}
termination_protection_enabled = true
}
data "mongodbatlas_flex_cluster" "example-cluster" {
project_id = var.project_id
name = mongodbatlas_flex_cluster.example-cluster.name
}
data "mongodbatlas_flex_clusters" "example-clusters" {
project_id = var.project_id
}
output "mongodbatlas_flex_cluster" {
value = data.mongodbatlas_flex_cluster.example-cluster.name
}
output "mongodbatlas_flex_clusters_names" {
value = [for cluster in data.mongodbatlas_flex_clusters.example-clusters.results : cluster.name]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.

**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.

### Read-Only

- `results` (Attributes List) List of returned documents that MongoDB Cloud provides when completing this request. (see [below for nested schema](#nestedatt--results))

<a id="nestedatt--results"></a>
### Nested Schema for `results`

Read-Only:

- `backup_settings` (Attributes) Flex backup configuration (see [below for nested schema](#nestedatt--results--backup_settings))
- `cluster_type` (String) Flex cluster topology.
- `connection_strings` (Attributes) Collection of Uniform Resource Locators that point to the MongoDB database. (see [below for nested schema](#nestedatt--results--connection_strings))
- `create_date` (String) Date and time when MongoDB Cloud created this instance. This parameter expresses its value in ISO 8601 format in UTC.
- `id` (String) Unique 24-hexadecimal digit string that identifies the instance.
- `mongo_db_version` (String) Version of MongoDB that the instance runs.
- `name` (String) Human-readable label that identifies the instance.
- `project_id` (String) Unique 24-hexadecimal character string that identifies the project.
- `provider_settings` (Attributes) Group of cloud provider settings that configure the provisioned MongoDB flex cluster. (see [below for nested schema](#nestedatt--results--provider_settings))
- `state_name` (String) Human-readable label that indicates the current operating condition of this instance.
- `tags` (Map of String) Map that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the instance.
- `termination_protection_enabled` (Boolean) Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster.
- `version_release_system` (String) Method by which the cluster maintains the MongoDB versions.

<a id="nestedatt--results--backup_settings"></a>
### Nested Schema for `results.backup_settings`

Read-Only:

- `enabled` (Boolean) Flag that indicates whether backups are performed for this flex cluster. Backup uses [TODO](TODO) for flex clusters.


<a id="nestedatt--results--connection_strings"></a>
### Nested Schema for `results.connection_strings`

Read-Only:

- `standard` (String) Public connection string that you can use to connect to this cluster. This connection string uses the mongodb:// protocol.
- `standard_srv` (String) Public connection string that you can use to connect to this flex cluster. This connection string uses the `mongodb+srv://` protocol.


<a id="nestedatt--results--provider_settings"></a>
### Nested Schema for `results.provider_settings`

Read-Only:

- `backing_provider_name` (String) Cloud service provider on which MongoDB Cloud provisioned the flex cluster.
- `disk_size_gb` (Number) Storage capacity available to the flex cluster expressed in gigabytes.
- `provider_name` (String) Human-readable label that identifies the cloud service provider.
- `region_name` (String) Human-readable label that identifies the geographic location of your MongoDB flex cluster. The region you choose can affect network latency for clients accessing your databases. For a complete list of region names, see [AWS](https://docs.atlas.mongodb.com/reference/amazon-aws/#std-label-amazon-aws), [GCP](https://docs.atlas.mongodb.com/reference/google-gcp/), and [Azure](https://docs.atlas.mongodb.com/reference/microsoft-azure/).

For more information see: [MongoDB Atlas API - Flex Clusters](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/listFlexClusters) Documentation.
6 changes: 6 additions & 0 deletions docs/data-sources/privatelink_endpoint_service_serverless.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
subcategory: "Deprecated"
---

**WARNING:** This data source is deprecated and will be removed in March 2025. For more datails see [Migration Guide: Transition out of Serverless Instances and Shared-tier clusters](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/serverless-shared-migration-guide)

# Data Source: privatelink_endpoint_service_serverless

`privatelink_endpoint_service_serverless` provides a Serverless PrivateLink Endpoint Service resource.
Expand Down
6 changes: 6 additions & 0 deletions docs/data-sources/privatelink_endpoints_service_serverless.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
subcategory: "Deprecated"
---

**WARNING:** This data source is deprecated and will be removed in March 2025. For more datails see [Migration Guide: Transition out of Serverless Instances and Shared-tier clusters](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/serverless-shared-migration-guide)

# Data Source: privatelink_endpoints_service_serverless

`privatelink_endpoints_service_serverless` describes the list of all Serverless PrivateLink Endpoint Service resource.
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/serverless_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ Follow this example to [setup private connection to a serverless instance using
* `provider_settings_provider_name` - Cloud service provider that applies to the provisioned the serverless instance.
* `provider_settings_region_name` - Human-readable label that identifies the physical location of your MongoDB serverless instance. The region you choose can affect network latency for clients accessing your databases.
* `state_name` - Stage of deployment of this serverless instance when the resource made its request.
* `continuous_backup_enabled` - Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
* `continuous_backup_enabled` - (Deprecated) Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
* `termination_protection_enabled` - Flag that indicates whether termination protection is enabled on the cluster. If set to true, MongoDB Cloud won't delete the cluster. If set to false, MongoDB Cloud will delete the cluster.
* `auto_indexing` - Flag that indicates whether the serverless instance uses [Serverless Auto Indexing](https://www.mongodb.com/docs/atlas/performance-advisor/auto-index-serverless/).
* `auto_indexing` - (Deprecated) Flag that indicates whether the serverless instance uses [Serverless Auto Indexing](https://www.mongodb.com/docs/atlas/performance-advisor/auto-index-serverless/).
* `tags` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags).

### Tags
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/serverless_instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ data "mongodbatlas_serverless_instances" "data_serverless" {
* `provider_settings_provider_name` - Cloud service provider that applies to the provisioned the serverless instance.
* `provider_settings_region_name` - Human-readable label that identifies the physical location of your MongoDB serverless instance. The region you choose can affect network latency for clients accessing your databases.
* `state_name` - Stage of deployment of this serverless instance when the resource made its request.
* `continuous_backup_enabled` - Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
* `continuous_backup_enabled` - (Deprecated) Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
* `termination_protection_enabled` - Flag that indicates whether termination protection is enabled on the cluster. If set to true, MongoDB Cloud won't delete the cluster. If set to false, MongoDB Cloud will delete the cluster.
* `auto_indexing` - Flag that indicates whether the serverless instance uses [Serverless Auto Indexing](https://www.mongodb.com/docs/atlas/performance-advisor/auto-index-serverless/).
* `auto_indexing` - (Deprecated) Flag that indicates whether the serverless instance uses [Serverless Auto Indexing](https://www.mongodb.com/docs/atlas/performance-advisor/auto-index-serverless/).
* `tags` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags).

### Tags
Expand Down
Loading

0 comments on commit ca002b5

Please sign in to comment.