You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you find any issues or have any suggestions, please open an [issue](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/issues) in this repository.
@@ -92,4 +61,4 @@ See our [CONTRIBUTING.md](CONTRIBUTING.md) guide.
92
61
93
62
## License
94
63
95
-
MongoDB Atlas CLI is released under the Apache 2.0 license. See [LICENSE.md](LICENSE.md)
64
+
MongoDB Atlas CLI is released under the Apache 2.0 license. See [LICENSE.md](LICENSE.md)
-`--file` or `-f`: Input file path containing the legacy `mongodbatlas_advanced_cluster` configuration
28
+
-`--file` or `-f`: Input file path containing the `mongodbatlas_advanced_cluster` configuration
29
29
-`--output` or `-o`: Output file path for the converted Provider 2.0.0 configuration
30
-
-`--replaceOutput` or `-r`: Overwrite the output file if it exists
30
+
-`--replaceOutput` or `-r`: Overwrite the output file if it exists, or even use the same output file as the input file
31
31
-`--watch` or `-w`: Keep the plugin running and watching for changes in the input file
32
32
33
33
## Examples
@@ -454,7 +454,7 @@ replication_specs = concat(
454
454
455
455
3.**Variable references transformation**: The converter updates variable references (e.g., `replication_specs.value` to `spec`), but complex nested references should be reviewed.
456
456
457
-
4.**Block ordering**: The Provider 2.0.0 format may handle block ordering differently. Ensure any dependencies on block order are maintained.
457
+
4.**Block ordering**: The Provider 2.0.0 schema may handle block ordering differently. Ensure any dependencies on block order are maintained.
458
458
459
459
### General Limitations
460
460
@@ -476,4 +476,4 @@ If you encounter use cases not yet supported, please send us [feedback](https://
476
476
You can find more examples of dynamic block conversions in the [test data directory](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/tree/main/internal/convert/testdata/adv2v2), particularly:
Copy file name to clipboardExpand all lines: docs/command_clu2adv.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,11 @@
1
1
# Convert mongodbatlas_cluster to mongodbatlas_advanced_cluster
2
2
3
-
This command helps you migrate from `mongodbatlas_cluster` to `mongodbatlas_advanced_cluster`(preview provider 2.0.0).
3
+
clusterToAdvancedCluster (clu2adv) command helps you migrate from `mongodbatlas_cluster` to `mongodbatlas_advanced_cluster`Provider 2.0.0 schema.
4
4
5
5
## Usage
6
6
7
7
You can find more information in the [Migration Guide: Cluster to Advanced Cluster](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/cluster-to-advanced-cluster-migration-guide).
8
8
9
-
**Note**: In order to use the **Preview for MongoDB Atlas Provider 2.0.0** of `mongodbatlas_advanced_cluster`, you need to set the environment variable `MONGODB_ATLAS_PREVIEW_PROVIDER_V2_ADVANCED_CLUSTER` to `true`.
10
-
11
9
If you want to convert a Terraform configuration from `mongodbatlas_cluster` to `mongodbatlas_advanced_cluster`, use the following command:
-`--file` or `-f`: Input file path containing the `mongodbatlas_cluster` configuration
24
22
-`--output` or `-o`: Output file path for the converted `mongodbatlas_advanced_cluster` configuration
25
-
-`--includeMoved` or `-m`: Include the `moved blocks` in the output file
26
23
-`--replaceOutput` or `-r`: Overwrite the output file if it exists, or even use the same output file as the input file
27
24
-`--watch` or `-w`: Keep the plugin running and watching for changes in the input file
25
+
-`--includeMoved` or `-m`: Include the `moved blocks` in the output file
28
26
29
27
## Examples
30
28
@@ -55,7 +53,8 @@ dynamic "tags" {
55
53
56
54
### Dynamic blocks in regions_config
57
55
58
-
You can use `dynamic` blocks for `regions_config`. The plugin assumes that `for_each` has an expression which is evaluated to a `list` or `set` of objects. See the [dynamic blocks guide](./guide_clu2adv_dynamic_block.md) to learn more about some limitations.
56
+
You can use `dynamic` blocks for `regions_config`. The plugin assumes that `for_each` has an expression which is evaluated to a `list` of objects.
57
+
59
58
This is an example of how to use dynamic blocks in `regions_config`:
60
59
```hcl
61
60
replication_specs {
@@ -75,7 +74,8 @@ replication_specs {
75
74
76
75
### Dynamic blocks in replication_specs
77
76
78
-
You can use `dynamic` blocks for `replication_specs`. The plugin assumes that `for_each` has an expression which is evaluated to a `list` of objects. See the [dynamic blocks guide](./guide_clu2adv_dynamic_block.md) to learn more about some limitations.
77
+
You can use `dynamic` blocks for `replication_specs`. The plugin assumes that `for_each` has an expression which is evaluated to a `list` of objects.
78
+
79
79
This is an example of how to use dynamic blocks in `replication_specs`:
80
80
```hcl
81
81
dynamic "replication_specs" {
@@ -102,9 +102,9 @@ If you need to use the plugin for `dynamic` block use cases not yet supported, p
102
102
103
103
#### Dynamic block and individual blocks in the same resource
104
104
105
-
Dynamic block and individual blocks for `regions_config` or `replication_specs` are not supported at the same time. The recommended way to handle this is to remove the individual `regions_config` or `replication_specs` blocks and use a local variable to add the individual block information to the variable you're using in the `for_each` expression, using [concat](https://developer.hashicorp.com/terraform/language/functions/concat) if you're using a list or [setunion](https://developer.hashicorp.com/terraform/language/functions/setunion) for sets.
105
+
Dynamic block and individual blocks for `regions_config` or `replication_specs` are not supported at the same time. The recommended way to handle this is to remove the individual `regions_config` or `replication_specs` blocks and use a local `list`variable to add the individual block information to the variable you're using in the `for_each` expression, using [concat](https://developer.hashicorp.com/terraform/language/functions/concat).
106
106
107
-
Let's see an example with `regions_config`, it is the same for `replication_specs`. In the original configuration file, the `mongodb_cluster` resource is used inside a module that receives the `regions_config` elements in a `list` variable and we want to add an additional `region_config` with a read-only node.
107
+
Let's see an example with `regions_config`, it is the same idea for `replication_specs`. In the original configuration file, the `mongodb_cluster` resource is used inside a module that receives the `regions_config` elements in a `list` variable and we want to add an additional `regions_config` with a read-only node.
0 commit comments