Skip to content

Conversation

@maastha
Copy link
Collaborator

@maastha maastha commented Feb 13, 2025

Description

Please include a summary of the fix/feature/change, including any relevant motivation and context.

Link to any related issue(s):

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

lantoli and others added 23 commits February 5, 2025 18:47
…gration guide (#3029)

* output doc

* generic user folder

* and

* remove emails

* add snapshot_backup_policy

* apply feedback

* change email
…ter` tpf (#3002)

* feat: Implement ModifyPlan method to handle unknown fields in advanced_cluster tpf

* feat: Enhance ModifyPlan to handle unknown fields and improve replication specs processing

* refactor: Move out plan_modifer internal functions

* refactor: Simplify ModifyPlan by removing unused variables and logging

* fix: region and root disk size missmatch

* chore: minor fixes for the plan modifier

* fix typo

* refactor: Extract findClusterDiff logic to simplify update logic and allow usage from ModifyPlan

* refactor: Enhance CopyUnknowns and useRemoteForUnknown to support keeping specific unknown fields

* test: Regenerate the mock files to includ `id` in PATCH similar to SDKv2 implementation

* populateIDValuesUsingNewAPI is no longer used

* refactor: Update patch options to ignore 'id' when latest schema is used

* refactor: Add MongoDBVersion to keepUnknown when updating MongoDBMajorVersion

* refactor: Move MongoDBVersion check inside the update condition for safer handling during MongoDBMajorVersion updates

* test: Update mock files to reflect no `id` in PATCH

* refactor: Rename functions and parameters from explode --> expand [ci skip]

* refactor: remove unnecessary remote read in PlanModifier

* doc: Adds docstrings to answer PR comments

* refactor: Simplify IsUnknown function by using panic and update name of remote-->state

* refactor: planModifier re-use 1

* refactor: planModifier re-use 2

* remove unnecessary comment

* refactor: move general methods to common/schemafunc

* feat: enhance CopyUnknowns to support nested structures

* feat: add validation for keepUnknown names and use tflog in KeepUnknown

* refactor: simplify CopyUnknowns function by removing nestedStructMapping parameter and updating related logic

* refactor: use the new UseStateForUnknown function

* fix lint errors

* fix: accidental update to config package

* fieldalignment [ci skip]

* fix: accidental address of pointer

* fix: correct typo in backup_enabled field

* address PR comments [ci skip]

* address PR comments

---------

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>
* simple changes

* chore: Updates tests to use ProjectIDExecutionWithCluster where not plural data source is used
* chore: Removes todo section

* deleting old readmes as suggested
… data sources and flex (#3031)

* refactor: initial work to use consistent useReplicationSpecPerShard

* refactor: simplify getBasicClusterModel to avoid passing *TFModel (doesn't make sense in data sources and flex)

* doc: Add comments

* refactor: rename to ues usinggNewShardingConfig

* refactor: rename variables for clarity in findClusterDiff function

* refactor: correct variable name for clarity in CreateCluster function
…atlas_advanced_cluster` and `mongodbatlas_cluster` resource (#3034)
…3017)

* doc: Updates Cedar action names and namespaces for Public Preview.

* Revises per tech review.

* Revises per tech review.

* Updates Private to Public.
* chore: removed unused ctx

* test: Add import checks to all test cases

* ignore replication_specs in import verification

* test: Add mongo_db_major_version to ignored fields in TestStepImportCluster

* chore: Updates mock files to include import step

* test: Add state_name to ignored fields in TestStepImportCluster to prevent flaky tests

* test: Add id to ignored fields in TestStepImportCluster to prevent flaky tests
Co-authored-by: wtrocki <981838+wtrocki@users.noreply.github.com>
…3051)

* fix interval_min plan modifier

* changelog

* Update internal/service/alertconfiguration/resource_alert_configuration_test.go

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>

---------

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>
* disk size always 5 for shared

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

* fixes for sdk upgrade

* test: Relax assertion for TestApiPathsParsing to expect 5 or more methods (`X-GEN-IPA-EXCEPTION` has been added)

* refactor: Simplify ReadIsSlowMsThresholdingEnabled as SDK is now returning a bool

* test: Remove redundant test case for GetManagedSlowMs response decoding

---------

Co-authored-by: oarbusi <55513886+oarbusi@users.noreply.github.com>
Co-authored-by: Oriol Arbusi <oriol.abadal@mongodb.com>
Co-authored-by: Espen Albert <espen.albert@mongodb.com>
…LUSTER` (#3062)

* rename var

* rename schema v2 names

* fix make goal

* rename to MONGODB_ATLAS_PREVIEW_PROVIDER_V2_ADVANCED_CLUSTER
@maastha maastha changed the title chore: Merge flex ga master chore: Merge branch 'master' into merge-flex-ga-master Feb 13, 2025
@maastha maastha changed the title chore: Merge branch 'master' into merge-flex-ga-master chore: Merge branch 'master' into CLOUDP-282554-flex-ga Feb 13, 2025
@maastha maastha marked this pull request as ready for review February 13, 2025 18:30
@maastha maastha requested review from a team as code owners February 13, 2025 18:30
@github-actions
Copy link
Contributor

APIx bot: a message has been sent to Docs Slack channel

@maastha maastha merged commit 6a35525 into CLOUDP-282554-flex-ga Feb 13, 2025
65 of 67 checks passed
@maastha maastha deleted the merge-flex-ga-master branch February 13, 2025 22:22
@marcosuma
Copy link
Collaborator

@maastha might want to flag the docs team no need to review this one

oarbusi added a commit that referenced this pull request Feb 20, 2025
…ongodbatlas_advanced_cluster` (#3092)

* feat: Updates GA status for `mongodbatlas_flex_cluster` resource and data sources (#3003)

* remove preview

* changelog

* remove env var for preview

* chore: Adds cipher config & default_max_time_ms to advanced_cluster_tpf (#2972)

* chore: Implements `tags` and `labels` as MapAttribute in `advanced_cluster` schema v2 (#2996)

* schema change

* model change

* create TF models

* create Admin models

* labels & tags conversion

* TEMPORARY skip mocked tests

* handle null vs []

* Revert "TEMPORARY skip mocked tests"

This reverts commit 3653edc.

* temporary don't test check label and tags

* improve update and override

* fix plan changes in state upgrade

* test checks for labels and tags

* apply feedback

* feat: Supports Flex Clusters in `mongodbatlas_advanced_cluster` resource and data sources (SDKv2) (#3001)

* implement create flex cluster in advanced_cluster

* implement read flex cluster in advanced_cluster

* effective_cluster_type and logic for update

* wip upgrade M0 to Flex  to avoid warnings

* implement delete of flex cluster in advanced_cluster and minor refacor of flex

* data sources and tests

* final fixes

* changelog

* dont' do 2 API calls when deleting

* clean up

* clarify update logic

* pr comments refactors

* refactor isFlex

* move method into advancedcluster package from flex

* set priority to 7 to avoid changes when/id flex changes to dedicated

* separate better concerns when creating update or upgrade object

* fix typos

* test ConvertAdvancedClusterToSchemaV2

* non parallel test to avoid issues with plural data sources checks

* refactor flex read in data source and resource

* clean up

* diags

* use diags instead of return err

* final

* refactor the tpf_adapter to handle diags conversion and call advancedclustertpf package

* docs review

* changelog

* use constants for errors

* keep const and convert to var in check method

* move IsFlex to advancedclustertpf

* refactor import to reuse GetClusterDetails

---------

Co-authored-by: Espen Albert <espen.albert@mongodb.com>

* deprecate: Deprecates Serverless and Shared-tier functionality (#3012)

* deprecate shared and serverless resource and data sources

* deprecation warning when using shared tier in cluster resource + small fix on var name

* deprecation warning when using shared tier in advanced_cluster resource

* changelog

* Update docs/resources/serverless_instance.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/serverless_instances.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/serverless_instance.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/cloud_provider_shared_tier_snapshots.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/cloud_provider_shared_tier_restore_job.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/cloud_provider_shared_tier_snapshot.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/cloud_provider_shared_tier_restore_jobs.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* use constant for January 2026 and fix typo

---------

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* feat: Supports Flex Clusters in `mongodbatlas_advanced_cluster` resource (TPF) (#3020)

* wip

* wip: resource implemented

* temp: remove data sources in flex test

* minor fixes

* override tags and labels

* minor refactors

* move to model_flex

* avoid detected value change for new state in advanced_configuration

* wip: final fixes

* tags check in tests

* update fix

* remove import step in test

* minor improvements

* diags and refactors

* pr comments

* fix data source config for SDKv2 tests

* pr comments

* feat: Supports Flex Clusters in `mongodbatlas_advanced_cluster` data sources (TPF) (#3028)

* singular data source

* plural data source

* add data sources in tests for tpf

* mocked acceptance test changes

* re capture

* revert changes and skip mock tests

* json whitespace

* feat: Supports retrieval of Flex clusters snapshots using `mongodbatlas_flex_snapshot` data sources (#3036)

* wip

* model and plural data source

* add data sources to provider

* revert makefile commit

* fixes

* make

* changelog

* fix name of field

* docs

* docs fix

* pr comments

* pr comments

* chore: Merges latest TPF changes and simplifies flex data sources (#3038)

* doc: Adds outputs documentation to the cluster to advanced_cluster migration guide (#3029)

* output doc

* generic user folder

* and

* remove emails

* add snapshot_backup_policy

* apply feedback

* change email

* chore: Adds plan modifier to reduce plan verbosity for `advanced_cluster` tpf (#3002)

* feat: Implement ModifyPlan method to handle unknown fields in advanced_cluster tpf

* feat: Enhance ModifyPlan to handle unknown fields and improve replication specs processing

* refactor: Move out plan_modifer internal functions

* refactor: Simplify ModifyPlan by removing unused variables and logging

* fix: region and root disk size missmatch

* chore: minor fixes for the plan modifier

* fix typo

* refactor: Extract findClusterDiff logic to simplify update logic and allow usage from ModifyPlan

* refactor: Enhance CopyUnknowns and useRemoteForUnknown to support keeping specific unknown fields

* test: Regenerate the mock files to includ `id` in PATCH similar to SDKv2 implementation

* populateIDValuesUsingNewAPI is no longer used

* refactor: Update patch options to ignore 'id' when latest schema is used

* refactor: Add MongoDBVersion to keepUnknown when updating MongoDBMajorVersion

* refactor: Move MongoDBVersion check inside the update condition for safer handling during MongoDBMajorVersion updates

* test: Update mock files to reflect no `id` in PATCH

* refactor: Rename functions and parameters from explode --> expand [ci skip]

* refactor: remove unnecessary remote read in PlanModifier

* doc: Adds docstrings to answer PR comments

* refactor: Simplify IsUnknown function by using panic and update name of remote-->state

* refactor: planModifier re-use 1

* refactor: planModifier re-use 2

* remove unnecessary comment

* refactor: move general methods to common/schemafunc

* feat: enhance CopyUnknowns to support nested structures

* feat: add validation for keepUnknown names and use tflog in KeepUnknown

* refactor: simplify CopyUnknowns function by removing nestedStructMapping parameter and updating related logic

* refactor: use the new UseStateForUnknown function

* fix lint errors

* fix: accidental update to config package

* fieldalignment [ci skip]

* fix: accidental address of pointer

* fix: correct typo in backup_enabled field

* address PR comments [ci skip]

* address PR comments

---------

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>

* chore: Uses `ProjectIDExecutionWithCluster` in `cluster` tests (#3030)

* simple changes

* chore: Updates tests to use ProjectIDExecutionWithCluster where not plural data source is used

* chore: Removes todo section from readme in tpf package (#3033)

* chore: Removes todo section

* deleting old readmes as suggested

* clarify doc (#3032)

* chore: Simplifies getBasicClusterModel to make it easier to call from data sources and flex (#3031)

* refactor: initial work to use consistent useReplicationSpecPerShard

* refactor: simplify getBasicClusterModel to avoid passing *TFModel (doesn't make sense in data sources and flex)

* doc: Add comments

* refactor: rename to ues usinggNewShardingConfig

* refactor: rename variables for clarity in findClusterDiff function

* refactor: correct variable name for clarity in CreateCluster function

* fix build errors

* refactor: Adds NewTFModelFlexResource to avoid passing TFModel in data sources

* refactor: Remove unused parameter from getFlexClustersModels function

* chore: enable test again and regenerate mock file

---------

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>

* feat: Supports retrieval of Flex clusters restore jobs using `mongodbatlas_flex_restore_job` data sources (#3041)

* restore job data sources

* add data source to provider

* computed

* changelog

* docs

* plural fix

* fix example

* consistent ProjectID

* snapshotId to snapshotID

* RestoreJobId to RestoreJobID

* chore: Set default priority (7) for imported flex clusters in mongodbatlas_advanced_cluster (#3044)

* chore: Merge branch 'master' into  CLOUDP-282554-flex-ga (#3066)

* doc: Document Flex cluster support in `mongodbatlas_advanced_cluster` resource and data sources (#3070)

* docs changes for flex support

* recommendation for flex

* fix data sources docs

* fix data sources pl

* fix missing s

* Update docs/resources/advanced_cluster.md

Co-authored-by: Marco Suma <marco.suma@mongodb.com>

* Update docs/resources/advanced_cluster.md

* Update docs/data-sources/advanced_cluster.md

Co-authored-by: Agustin Bettati <bettatiagustin@gmail.com>

* Update docs/resources/advanced_cluster.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/flex_cluster.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/flex_clusters.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/resources/advanced_cluster.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/resources/advanced_cluster.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/resources/flex_cluster.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update templates/data-sources/flex_cluster.md.tmpl

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update templates/data-sources/flex_clusters.md.tmpl

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update templates/resources/flex_cluster.md.tmpl

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* pr suggestion

* align template

---------

Co-authored-by: Marco Suma <marco.suma@mongodb.com>
Co-authored-by: Agustin Bettati <bettatiagustin@gmail.com>
Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* chore: Implements upgrade from M0 to Flex in `mongodbatlas_advanced_cluster` (#3061)

* init

* handle temp error during upgrade

* tests

* lint

* tpf

* lint

* min

* min

* timeout

* handle zonename

* nit

* minor

* nit

* address PR comments

* Update internal/service/advancedclustertpf/model_flex.go

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>

* address PR comments

* tmp

* Revert "tmp"

This reverts commit ccda546.

* Revert "address PR comments"

This reverts commit 9914e0a.

* ut

* Revert "ut"

This reverts commit 7fb5628.

* minor

* mockable test

* mocked test capture and clean up basicTenant

* remove 3rd step

* api req

* mocked test fix

* mocked test fix

* nil check

---------

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>
Co-authored-by: Oriol Arbusi <oriol.abadal@mongodb.com>

* chore: Fixes inconsistent result errors (#3089)

* refactor: Refactor out flex upgrade/update logic

* chore: initial imlementation of flexUpgrade plan modifier

* chore: Update ZoneName in NewReplicationSpecsFromFlexDescription to "Zone 1"

* chore: Enhance unknown tenant upgrade handling in plan modifier for flex cluster

* chore: Add comment to clarify handling of Unknown fields in flex cluster upgrade

* chore: Rename flexChanges function to flexUpgradedUpdated for clarity

* doc: Adds examples for flex clusters in `mongodbatlas_advanced_cluster` (#3088)

* upgrade flex example

* readme formatting

* Update examples/mongodbatlas_advanced_cluster/flex-upgrade/README.md

Co-authored-by: Marco Suma <marco.suma@mongodb.com>

* org

* clarify readme of example

* add node_count as var

---------

Co-authored-by: Marco Suma <marco.suma@mongodb.com>

* chore: Implements upgrade from Flex to Dedicated in `mongodbatlas_advanced_cluster` (#3091)

* sdkv2 flex upgrade to dedicated

* refactor: Refactor out flex upgrade/update logic

* chore: initial imlementation of flexUpgrade plan modifier

* chore: Update ZoneName in NewReplicationSpecsFromFlexDescription to "Zone 1"

* chore: Enhance unknown tenant upgrade handling in plan modifier for flex cluster

* upgrade from flex to dedicated in SDKv2

* clean up duplicated code

* tpf implementation

* plan modifier and clean up

* tenant fix

* revert defaultPriority export

* restore commnent

* mocked test

* rename config

* rename test

* pr comments

---------

Co-authored-by: Espen Albert <espen.albert@mongodb.com>

* m2 m5 mentions removed

* run M0 test non paralelly

* doc: Recommends `mongodbatlas_advanced_cluster` in the migration guides and mention data sources for shared-tier migration (#3093)

* recommend adv_cluster and mention data sources for shared tier

* simplify shared to flex

* fix

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

Co-authored-by: Jeff Vincent <153767405+jvincent-mongodb@users.noreply.github.com>

* pr comments

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

Co-authored-by: Jeff Vincent <153767405+jvincent-mongodb@users.noreply.github.com>

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

Co-authored-by: Jeff Vincent <153767405+jvincent-mongodb@users.noreply.github.com>

---------

Co-authored-by: Jeff Vincent <153767405+jvincent-mongodb@users.noreply.github.com>

---------

Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>
Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>
Co-authored-by: Espen Albert <espen.albert@mongodb.com>
Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>
Co-authored-by: Espen Albert <EspenAlbert@users.noreply.github.com>
Co-authored-by: Marco Suma <marco.suma@mongodb.com>
Co-authored-by: Agustin Bettati <bettatiagustin@gmail.com>
Co-authored-by: Jeff Vincent <153767405+jvincent-mongodb@users.noreply.github.com>
maastha added a commit that referenced this pull request Feb 25, 2025
…ongodbatlas_advanced_cluster` (#3092)

* feat: Updates GA status for `mongodbatlas_flex_cluster` resource and data sources (#3003)

* remove preview

* changelog

* remove env var for preview

* chore: Adds cipher config & default_max_time_ms to advanced_cluster_tpf (#2972)

* chore: Implements `tags` and `labels` as MapAttribute in `advanced_cluster` schema v2 (#2996)

* schema change

* model change

* create TF models

* create Admin models

* labels & tags conversion

* TEMPORARY skip mocked tests

* handle null vs []

* Revert "TEMPORARY skip mocked tests"

This reverts commit 3653edc.

* temporary don't test check label and tags

* improve update and override

* fix plan changes in state upgrade

* test checks for labels and tags

* apply feedback

* feat: Supports Flex Clusters in `mongodbatlas_advanced_cluster` resource and data sources (SDKv2) (#3001)

* implement create flex cluster in advanced_cluster

* implement read flex cluster in advanced_cluster

* effective_cluster_type and logic for update

* wip upgrade M0 to Flex  to avoid warnings

* implement delete of flex cluster in advanced_cluster and minor refacor of flex

* data sources and tests

* final fixes

* changelog

* dont' do 2 API calls when deleting

* clean up

* clarify update logic

* pr comments refactors

* refactor isFlex

* move method into advancedcluster package from flex

* set priority to 7 to avoid changes when/id flex changes to dedicated

* separate better concerns when creating update or upgrade object

* fix typos

* test ConvertAdvancedClusterToSchemaV2

* non parallel test to avoid issues with plural data sources checks

* refactor flex read in data source and resource

* clean up

* diags

* use diags instead of return err

* final

* refactor the tpf_adapter to handle diags conversion and call advancedclustertpf package

* docs review

* changelog

* use constants for errors

* keep const and convert to var in check method

* move IsFlex to advancedclustertpf

* refactor import to reuse GetClusterDetails

---------

Co-authored-by: Espen Albert <espen.albert@mongodb.com>

* deprecate: Deprecates Serverless and Shared-tier functionality (#3012)

* deprecate shared and serverless resource and data sources

* deprecation warning when using shared tier in cluster resource + small fix on var name

* deprecation warning when using shared tier in advanced_cluster resource

* changelog

* Update docs/resources/serverless_instance.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/serverless_instances.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/serverless_instance.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/cloud_provider_shared_tier_snapshots.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/cloud_provider_shared_tier_restore_job.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/cloud_provider_shared_tier_snapshot.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/cloud_provider_shared_tier_restore_jobs.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* use constant for January 2026 and fix typo

---------

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* feat: Supports Flex Clusters in `mongodbatlas_advanced_cluster` resource (TPF) (#3020)

* wip

* wip: resource implemented

* temp: remove data sources in flex test

* minor fixes

* override tags and labels

* minor refactors

* move to model_flex

* avoid detected value change for new state in advanced_configuration

* wip: final fixes

* tags check in tests

* update fix

* remove import step in test

* minor improvements

* diags and refactors

* pr comments

* fix data source config for SDKv2 tests

* pr comments

* feat: Supports Flex Clusters in `mongodbatlas_advanced_cluster` data sources (TPF) (#3028)

* singular data source

* plural data source

* add data sources in tests for tpf

* mocked acceptance test changes

* re capture

* revert changes and skip mock tests

* json whitespace

* feat: Supports retrieval of Flex clusters snapshots using `mongodbatlas_flex_snapshot` data sources (#3036)

* wip

* model and plural data source

* add data sources to provider

* revert makefile commit

* fixes

* make

* changelog

* fix name of field

* docs

* docs fix

* pr comments

* pr comments

* chore: Merges latest TPF changes and simplifies flex data sources (#3038)

* doc: Adds outputs documentation to the cluster to advanced_cluster migration guide (#3029)

* output doc

* generic user folder

* and

* remove emails

* add snapshot_backup_policy

* apply feedback

* change email

* chore: Adds plan modifier to reduce plan verbosity for `advanced_cluster` tpf (#3002)

* feat: Implement ModifyPlan method to handle unknown fields in advanced_cluster tpf

* feat: Enhance ModifyPlan to handle unknown fields and improve replication specs processing

* refactor: Move out plan_modifer internal functions

* refactor: Simplify ModifyPlan by removing unused variables and logging

* fix: region and root disk size missmatch

* chore: minor fixes for the plan modifier

* fix typo

* refactor: Extract findClusterDiff logic to simplify update logic and allow usage from ModifyPlan

* refactor: Enhance CopyUnknowns and useRemoteForUnknown to support keeping specific unknown fields

* test: Regenerate the mock files to includ `id` in PATCH similar to SDKv2 implementation

* populateIDValuesUsingNewAPI is no longer used

* refactor: Update patch options to ignore 'id' when latest schema is used

* refactor: Add MongoDBVersion to keepUnknown when updating MongoDBMajorVersion

* refactor: Move MongoDBVersion check inside the update condition for safer handling during MongoDBMajorVersion updates

* test: Update mock files to reflect no `id` in PATCH

* refactor: Rename functions and parameters from explode --> expand [ci skip]

* refactor: remove unnecessary remote read in PlanModifier

* doc: Adds docstrings to answer PR comments

* refactor: Simplify IsUnknown function by using panic and update name of remote-->state

* refactor: planModifier re-use 1

* refactor: planModifier re-use 2

* remove unnecessary comment

* refactor: move general methods to common/schemafunc

* feat: enhance CopyUnknowns to support nested structures

* feat: add validation for keepUnknown names and use tflog in KeepUnknown

* refactor: simplify CopyUnknowns function by removing nestedStructMapping parameter and updating related logic

* refactor: use the new UseStateForUnknown function

* fix lint errors

* fix: accidental update to config package

* fieldalignment [ci skip]

* fix: accidental address of pointer

* fix: correct typo in backup_enabled field

* address PR comments [ci skip]

* address PR comments

---------

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>

* chore: Uses `ProjectIDExecutionWithCluster` in `cluster` tests (#3030)

* simple changes

* chore: Updates tests to use ProjectIDExecutionWithCluster where not plural data source is used

* chore: Removes todo section from readme in tpf package (#3033)

* chore: Removes todo section

* deleting old readmes as suggested

* clarify doc (#3032)

* chore: Simplifies getBasicClusterModel to make it easier to call from data sources and flex (#3031)

* refactor: initial work to use consistent useReplicationSpecPerShard

* refactor: simplify getBasicClusterModel to avoid passing *TFModel (doesn't make sense in data sources and flex)

* doc: Add comments

* refactor: rename to ues usinggNewShardingConfig

* refactor: rename variables for clarity in findClusterDiff function

* refactor: correct variable name for clarity in CreateCluster function

* fix build errors

* refactor: Adds NewTFModelFlexResource to avoid passing TFModel in data sources

* refactor: Remove unused parameter from getFlexClustersModels function

* chore: enable test again and regenerate mock file

---------

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>

* feat: Supports retrieval of Flex clusters restore jobs using `mongodbatlas_flex_restore_job` data sources (#3041)

* restore job data sources

* add data source to provider

* computed

* changelog

* docs

* plural fix

* fix example

* consistent ProjectID

* snapshotId to snapshotID

* RestoreJobId to RestoreJobID

* chore: Set default priority (7) for imported flex clusters in mongodbatlas_advanced_cluster (#3044)

* chore: Merge branch 'master' into  CLOUDP-282554-flex-ga (#3066)

* doc: Document Flex cluster support in `mongodbatlas_advanced_cluster` resource and data sources (#3070)

* docs changes for flex support

* recommendation for flex

* fix data sources docs

* fix data sources pl

* fix missing s

* Update docs/resources/advanced_cluster.md

Co-authored-by: Marco Suma <marco.suma@mongodb.com>

* Update docs/resources/advanced_cluster.md

* Update docs/data-sources/advanced_cluster.md

Co-authored-by: Agustin Bettati <bettatiagustin@gmail.com>

* Update docs/resources/advanced_cluster.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/flex_cluster.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/data-sources/flex_clusters.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/resources/advanced_cluster.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/resources/advanced_cluster.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update docs/resources/flex_cluster.md

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update templates/data-sources/flex_cluster.md.tmpl

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update templates/data-sources/flex_clusters.md.tmpl

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* Update templates/resources/flex_cluster.md.tmpl

Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* pr suggestion

* align template

---------

Co-authored-by: Marco Suma <marco.suma@mongodb.com>
Co-authored-by: Agustin Bettati <bettatiagustin@gmail.com>
Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>

* chore: Implements upgrade from M0 to Flex in `mongodbatlas_advanced_cluster` (#3061)

* init

* handle temp error during upgrade

* tests

* lint

* tpf

* lint

* min

* min

* timeout

* handle zonename

* nit

* minor

* nit

* address PR comments

* Update internal/service/advancedclustertpf/model_flex.go

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>

* address PR comments

* tmp

* Revert "tmp"

This reverts commit ccda546.

* Revert "address PR comments"

This reverts commit 9914e0a.

* ut

* Revert "ut"

This reverts commit 7fb5628.

* minor

* mockable test

* mocked test capture and clean up basicTenant

* remove 3rd step

* api req

* mocked test fix

* mocked test fix

* nil check

---------

Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>
Co-authored-by: Oriol Arbusi <oriol.abadal@mongodb.com>

* chore: Fixes inconsistent result errors (#3089)

* refactor: Refactor out flex upgrade/update logic

* chore: initial imlementation of flexUpgrade plan modifier

* chore: Update ZoneName in NewReplicationSpecsFromFlexDescription to "Zone 1"

* chore: Enhance unknown tenant upgrade handling in plan modifier for flex cluster

* chore: Add comment to clarify handling of Unknown fields in flex cluster upgrade

* chore: Rename flexChanges function to flexUpgradedUpdated for clarity

* doc: Adds examples for flex clusters in `mongodbatlas_advanced_cluster` (#3088)

* upgrade flex example

* readme formatting

* Update examples/mongodbatlas_advanced_cluster/flex-upgrade/README.md

Co-authored-by: Marco Suma <marco.suma@mongodb.com>

* org

* clarify readme of example

* add node_count as var

---------

Co-authored-by: Marco Suma <marco.suma@mongodb.com>

* chore: Implements upgrade from Flex to Dedicated in `mongodbatlas_advanced_cluster` (#3091)

* sdkv2 flex upgrade to dedicated

* refactor: Refactor out flex upgrade/update logic

* chore: initial imlementation of flexUpgrade plan modifier

* chore: Update ZoneName in NewReplicationSpecsFromFlexDescription to "Zone 1"

* chore: Enhance unknown tenant upgrade handling in plan modifier for flex cluster

* upgrade from flex to dedicated in SDKv2

* clean up duplicated code

* tpf implementation

* plan modifier and clean up

* tenant fix

* revert defaultPriority export

* restore commnent

* mocked test

* rename config

* rename test

* pr comments

---------

Co-authored-by: Espen Albert <espen.albert@mongodb.com>

* m2 m5 mentions removed

* run M0 test non paralelly

* doc: Recommends `mongodbatlas_advanced_cluster` in the migration guides and mention data sources for shared-tier migration (#3093)

* recommend adv_cluster and mention data sources for shared tier

* simplify shared to flex

* fix

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

Co-authored-by: Jeff Vincent <153767405+jvincent-mongodb@users.noreply.github.com>

* pr comments

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

Co-authored-by: Jeff Vincent <153767405+jvincent-mongodb@users.noreply.github.com>

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

Co-authored-by: Jeff Vincent <153767405+jvincent-mongodb@users.noreply.github.com>

---------

Co-authored-by: Jeff Vincent <153767405+jvincent-mongodb@users.noreply.github.com>

---------

Co-authored-by: maastha <122359335+maastha@users.noreply.github.com>
Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com>
Co-authored-by: Espen Albert <espen.albert@mongodb.com>
Co-authored-by: John Williams <55147273+jwilliams-mongo@users.noreply.github.com>
Co-authored-by: Espen Albert <EspenAlbert@users.noreply.github.com>
Co-authored-by: Marco Suma <marco.suma@mongodb.com>
Co-authored-by: Agustin Bettati <bettatiagustin@gmail.com>
Co-authored-by: Jeff Vincent <153767405+jvincent-mongodb@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants