-
Notifications
You must be signed in to change notification settings - Fork 210
chore: Adds cipher config & default_max_time_ms to advanced_cluster_tpf #2972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| advConfig *admin.ClusterDescriptionProcessArgs20240805 | ||
| legacyAdvConfig *admin20240530.ClusterDescriptionProcessArgs | ||
| ) | ||
| patchReqProcessArgs := update.PatchPayloadTpf(ctx, diags, &state.AdvancedConfiguration, &plan.AdvancedConfiguration, NewAtlasReqAdvancedConfiguration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swapped the order in which calls are made to the old/new processArgs API. This is currently a workaround to ensure the new API call is made later. This is because there is a bug where defaultMaxTimeMS (in the new API version) is reset to null if the PATCH call to any of the API versions doesn't contain a value for defaultMaxTimeMS.
This bug is being addressed in https://jira.mongodb.org/browse/CLOUDP-295775 and should be merged this week (slack thread in the ticket https://jira.mongodb.org/browse/CLOUDP-291164).
After the bug is addressed this swap is no longer required but I think keeping it as is isn't a problem and should not be a blocker for this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we leave this comment in the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're planning to address the ticket today itself, I'll add a comment if by the time this is ready to merge the fix is still not in. Otherwise shouldn't be required as no behavior change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bug has been addressed by upstream, so I've reverted call swap change.
| } | ||
| processArgsUpdatedCipherConfig = &admin.ClusterDescriptionProcessArgs20240805{ | ||
| DefaultMaxTimeMS: conversion.IntPtr(65), | ||
| DefaultMaxTimeMS: conversion.IntPtr(67), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why we're changing this value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted this change. I had to add it for the test because in case DefaultMaxTimeMS didn't change value it wouldn't be included in the PATCH request which caused issues as mentioned in my comment above. Now that has been addressed by upstream in https://jira.mongodb.org/browse/CLOUDP-295775 so we don't need this change.
internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go
Outdated
Show resolved
Hide resolved
internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go
Show resolved
Hide resolved
| } | ||
|
|
||
| func customOpensslCipherConfigTLS12(ctx context.Context, processArgs *admin.ClusterDescriptionProcessArgs20240805, diags *diag.Diagnostics) types.Set { | ||
| if processArgs != nil && len(*processArgs.CustomOpensslCipherConfigTls12) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if processArgs != nil && len(*processArgs.CustomOpensslCipherConfigTls12) == 0 { | |
| if processArgs == nil || len(*processArgs.CustomOpensslCipherConfigTls12) == 0 { |
I think we want this condition here, or not sure what we want to do when processArgs is/is not nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right, updated the condition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have a test that passes now, but wouldn't have passed before this change? to make sure the implementation logic is correct now, and we don't change it later by mistake while doing some code changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reg tests: in general I went to check and it looks like we only added one test check in this PR, do we need more tests or are we actually leveraging the already existing ones you created before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lantoli Due to this above condition you provided I was able to refactor the original logic a bit. Previously I had to add an additional else block such as here. Now due to the updated condition we don't need that anymore. If the condition is changed for some reason the move block tests will fail so we should have that covered.
@marcosuma As for tests in general, I think the current tests TestAccClusterAdvancedCluster_advancedConfig_oldMongoDBVersion, TestAccClusterAdvancedCluster_advancedConfig and TestAccClusterAdvancedCluster_defaultWrite provide quite decent coverage for the attributes added in this PR already for null, default or setting/updating values. Please let me know if there's any additional test case I can handle to improve.
23abda9 to
be8c876
Compare
| ErrorAdvancedClusterListStatus = "error awaiting MongoDB ClusterAdvanced List IDLE: %s" | ||
| ErrorOperationNotPermitted = "error operation not permitted" | ||
| ErrorDefaultMaxTimeMinVersion = "default_max_time_ms can not be set for mongo_db_major_version lower than 8.0" | ||
| ErrorDefaultMaxTimeMinVersion = "`advanced_configuration.default_max_time_ms` can only be configured if the mongo_db_major_version is 8.0 or higher" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ensuring the error messaging is same in both implementations. Required for common tests.
EspenAlbert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! [nit] Remove WIP from title. And address Leo's comment
| } | ||
|
|
||
| func customOpensslCipherConfigTLS12(ctx context.Context, diags *diag.Diagnostics, processArgs *admin.ClusterDescriptionProcessArgs20240805) types.Set { | ||
| if processArgs == nil || len(*processArgs.CustomOpensslCipherConfigTls12) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this might fail with inconsistent error if the user has specified custom_openssl_cipher_config_tls12 = [] but might never be an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, I don't think that's a valid case
|
Unrelated TestAccClusterAdvancedClusterConfig_replicationSpecsAutoScaling test is failing. Merging this PR. |
|
@maastha as in yesterday's meeting, I recommend to do a manual migration from sdkv2 to tpf to check that attributes in this feature are migrated correctly, also speciale cases for arrays and objects for nil, {}, [] |
* master: chore: Adds cipher config & default_max_time_ms to advanced_cluster_tpf (#2972)
…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>
…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>
Description
Add cipher config & default_max_time_ms to advanced_cluster_tpf
Link to any related issue(s):
CLOUDP-291163
CLOUDP-291164
Type of change:
Required Checklist:
Further comments