Skip to content

Commit 3b542ee

Browse files
authored
doc: Adds warning about using output variables and moved together (#3153)
* doc: Add warning about using output variables and moved together * apply suggestions
1 parent 66f924a commit 3b542ee

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

docs/guides/cluster-to-advanced-cluster-migration-guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ The basic experience when using the `moved` block is as follows:
5656
3. Comment out or delete the `mongodbatlas_cluster` resource definition.
5757
4. Update the references from your previous cluster resource: `mongodbatlas_cluster.this.XXXX` to the new `mongodbatlas_advanced_cluster.this.XXX`.
5858
- Double check [output-changes](#output-changes) to ensure the underlying configuration stays unchanged.
59+
- If you are using output variables that use the new resource `mongodbatlas_advanced_cluster.this`, the plan output can be more verbose than expected (extra `Note: Objects have changed outside of Terraform` section). Consider adding/updating output variables only **after** performing the move (see more in the [Github Issue](https://github.com/hashicorp/terraform-plugin-framework/issues/1109)).
5960
5. Add the `moved` block to your configuration file, e.g.:
6061
```terraform
6162
moved {

examples/migrate_cluster_to_advanced_cluster/basic/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The [CLI Plugin](https://github.com/mongodb-labs/atlas-cli-plugin-terraform) hel
4949
## Manual updates to the Terraform configuration
5050

5151
1. Ensure all references are updated (see example of updates in [outputs.tf](outputs.tf))
52-
1. TODO: Add warning about output references based on findings in [output investigation](https://jira.mongodb.org/browse/CLOUDP-303685)
52+
1. Ensure you are not adding any output variables that use the new `mongodbatlas_advanced_cluster` resource. Referencing the new resource before moving can lead to a more verbose plan output (extra `Note: Objects have changed outside of Terraform` section) when performing the move (see more in the [Github Issue](https://github.com/hashicorp/terraform-plugin-framework/issues/1109)).
5353
2. Comment out the `mongodbatlas_cluster` in `{CLUSTER_IN}.tf`
5454
3. Add the moved block for each resource migrated in `{CLUSTER_OUT}.tf`
5555
```terraform

examples/migrate_cluster_to_advanced_cluster/module_maintainer/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ moved {
8383
- Adds `data "mongodbatlas_cluster" "this"` to avoid breaking changes in `outputs.tf` (see below).
8484

8585
### [`outputs.tf`](v2/outputs.tf)
86-
- All outputs can use `mongodbatlas_advanced_cluster` except for:
87-
- [TODO: Update with findings](https://jira.mongodb.org/browse/CLOUDP-303685)
88-
- `replication_specs`, which uses `data.mongodbatlas_cluster.this.replication_specs` to keep the same format.
89-
- `mongodbatlas_cluster`, which uses the `data.mongodbatlas_cluster.this` to keep the same format.
86+
- Ensure you are not adding any output variables that use the new `mongodbatlas_advanced_cluster` resource. Referencing the new resource before moving can lead to a more verbose plan output (extra `Note: Objects have changed outside of Terraform` section) when performing the move (see more in the [Github Issue](https://github.com/hashicorp/terraform-plugin-framework/issues/1109)).
87+
- Ensure compatibility with `v1` outputs by modifying:
88+
- `replication_specs`, uses `data.mongodbatlas_cluster.this.replication_specs` to keep the same format.
89+
- `mongodbatlas_cluster`, uses the `data.mongodbatlas_cluster.this` to keep the same format.
9090

9191

9292
## Step 3: Module `v3` Implementation Changes and Highlights
9393
This module adds variables to support the latest `mongodbatlas_advanced_cluster` features while staying compatible with the old input variables.
94-
The module supports standalone usage when there is no existing `mongodbatlas_cluster` and also upgrading from `v1` using a `moved` block.
94+
The module supports standalone usage when there is no existing `mongodbatlas_cluster` and also upgrading from `v1` using a `moved` block. However, upgrading directly from `v1` can lead to a more verbose plan output (extra `Note: Objects have changed outside of Terraform` section) when performing the move (see more in the [Github Issue](https://github.com/hashicorp/terraform-plugin-framework/issues/1109)).
9595
The module also supports changing an existing `mongodbatlas_advanced_cluster` created in `v2`.
9696

9797
### [`variables.tf`](v3/variables.tf)

0 commit comments

Comments
 (0)