<!-- llms-explorer concept facts · https://llms-explorer.com/tree/atlas-cli-terraform-plugin/ · pack 2026-10-23 · ~1717 tokens -->

# Atlas CLI Terraform Plugin

> Source-anchored research for Atlas CLI Terraform Plugin. Run status: COMPLETED.

Parent: [MongoDB Atlas Infrastructure as Code](https://llms-explorer.com/tree/mongodb-atlas-infrastructure-as-code/) · 4 facets · 16 facts · page: https://llms-explorer.com/tree/atlas-cli-terraform-plugin/

## How it works

- The contributor guide warns that an installed plugin plus a local development copy can cause 'multiple plugins' errors. It directs developers to uninstall the installed copy before using make local and ATLAS_CLI_EXTRA_PLUGIN_DIRECTORY. (low confidence) — [source](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/blob/main/CONTRIBUTING.md)
- The provider guide recommends generating configuration with the plugin because it retains original Terraform expressions. Generation alone does not complete migration: back up state, update references, add the moved block, inspect terraform plan for 0 additions, 0 changes and 0 destructions, then apply. Terraform moved blocks update the resource address without destroying the object. (high confidence) (verified as of 2026-10-23) — [source](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/docs/guides/cluster-to-advanced-cluster-migration-guide.md)
- Keep historical moved blocks in shared modules so consumers can upgrade from older resource addresses. Removing them before every consumer has applied the migration can cause a destroy-and-create plan. For direct users with several workspaces or state files, apply the move to all states before considering removal. (high confidence) (verified as of 2026-10-23) — [source](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/docs/guides/cluster-to-advanced-cluster-migration-guide.md)

## How-to and procedures

- Install with atlas plugin install github.com/mongodb-labs/atlas-cli-plugin-terraform. The documented update command is atlas plugin update mongodb-labs/atlas-cli-plugin-terraform, and atlas plugin list shows installed plugins. (low confidence) (verified as of 2026-10-23) — [source](https://github.com/mongodb-labs/atlas-cli-plugin-terraform)

## Comparisons and alternatives

- The Atlas CLI Terraform plugin rewrites MongoDB Atlas Terraform configurations. clusterToAdvancedCluster (clu2adv) converts mongodbatlas_cluster to the provider 2.0.0 mongodbatlas_advanced_cluster schema; advancedClusterToV2 (adv2v2) converts the older advanced-cluster schema to that schema. These documented commands concern Atlas configurations rather than Ops Manager or Cloud Manager administration. (high confidence) (verified as of 2026-10-23) — [source](https://github.com/mongodb-labs/atlas-cli-plugin-terraform)

## Facts and statements

- The plugin installs with `atlas plugin install github.com/mongodb-labs/atlas-cli-plugin-terraform` and adds Terraform-related commands to the Atlas CLI. (low confidence) — [source](https://github.com/mongodb-labs/atlas-cli-plugin-terraform)
- `atlas terraform clusterToAdvancedCluster --file in.tf --output out.tf` (alias `atlas tf clu2adv`) converts mongodbatlas_cluster configurations to the mongodbatlas_advanced_cluster Provider 2.0.0 schema. (high confidence) — [source](https://github.com/mongodb-labs/atlas-cli-plugin-terraform)
- `atlas terraform advancedClusterToV2 --file in.tf --output out.tf` (alias `atlas tf adv2v2`) converts older mongodbatlas_advanced_cluster configurations to the Provider 2.0.0 schema, which replaces nested blocks with nested attributes. (high confidence) — [source](https://github.com/mongodb-labs/atlas-cli-plugin-terraform)
- The evidenced command scope is Atlas provider configuration migration. Applying these findings to Ops Manager or Cloud Manager automation would be an unsupported extrapolation. (medium confidence) — [source](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/blob/main/docs/command_clu2adv.md)
- For cluster-to-advanced-cluster migration, the provider guide requires a state backup, recommends a moved block, and calls for a plan with no infrastructure changes before applying. HashiCorp explains that moves across resource types require provider support; converting HCL alone does not establish a safe state migration. (high confidence) — [source](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/docs/guides/cluster-to-advanced-cluster-migration-guide.md)
- Both converters document constrained dynamic-block handling: tags and labels assume a map of strings; region configuration and replication_specs dynamic blocks assume lists of objects, with maps and sets unsupported for those structures. Mixed dynamic and individual region or replication blocks are unsupported; the documented workaround combines entries in a local list using concat. (high confidence) (verified as of 2026-10-23) — [source](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/blob/main/docs/command_clu2adv.md)
- Both command guides warn that conversion may lose some comments and alter spacing and blank lines. Review generated configuration and restore important documentation before applying the migration. (high confidence) (verified as of 2026-10-23) — [source](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/blob/main/docs/command_clu2adv.md)
- The Go package index records module version v1.2.0 as published September 15, 2025. That historical record does not establish the latest plugin release or provider compatibility. (low confidence) — [source](https://pkg.go.dev/github.com/mongodb-labs/atlas-cli-plugin-terraform)
- Convert a file with atlas tf clu2adv -f in.tf -o out.tf or atlas tf adv2v2 -f in.tf -o out.tf. Both commands document --watch and --replaceOutput; the latter permits overwriting an existing output or editing the input in place. clu2adv additionally documents --includeMoved to emit moved blocks. (high confidence) (verified as of 2026-10-23) — [source](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/blob/main/docs/command_clu2adv.md)
- The current MongoDB cluster-to-advanced-cluster guide requires Terraform 1.8 or later and MongoDB Atlas Provider 2.0 or later for its recommended cross-type moved-block workflow. HashiCorp warns that cross-type moves depend on provider support; the general availability of moved blocks does not establish that a particular resource-type conversion works. (medium confidence) (verified as of 2026-10-23) — [source](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/docs/guides/cluster-to-advanced-cluster-migration-guide.md)
- OpenTofu 1.10 introduced moved-block support between different resource types. This is language-engine context for evaluating a similar migration, not evidence that this MongoDB plugin or the provider migration has been tested with OpenTofu. (low confidence) — [source](https://opentofu.org/docs/v1.10/intro/whats-new/)
