# Error: Conflicting provider version constraints: multiple modules require different versions of provider X

- **ID:** `terraform/conflicting-provider-version-constraints`
- **Domain:** terraform
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

Two or more modules in the configuration specify incompatible version constraints for the same provider, causing Terraform to fail dependency resolution.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Terraform >=1.3 | active | — | — |
| AzureRM Provider 3.x | active | — | — |
| AWS Provider 5.x | active | — | — |

## Workarounds

1. **Align version constraints across all modules. For example, in root module set `required_providers { aws = "~> 5.0" }` and ensure all child modules use `aws = ">= 5.0, < 6.0"`.** (90% success)
   ```
   Align version constraints across all modules. For example, in root module set `required_providers { aws = "~> 5.0" }` and ensure all child modules use `aws = ">= 5.0, < 6.0"`.
   ```
2. **Use `terraform providers` to inspect version requirements, then update constraints to a common range, e.g., `version = "~> 5.0"` in all modules.** (85% success)
   ```
   Use `terraform providers` to inspect version requirements, then update constraints to a common range, e.g., `version = "~> 5.0"` in all modules.
   ```

## Dead Ends

- **** — Terraform may default to the latest provider version, which could be incompatible with existing state or resources. (55% fail)
- **** — The lock file is managed by Terraform and manual edits are not preserved; also risks provider corruption. (75% fail)
