terraform module_error ai_generated true

Error: Module not installed

ID: terraform/module-not-installed

Also available as: JSON · Markdown
95%Fix Rate
95%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1 active

Root Cause

Module source not downloaded. Need terraform init to download modules.

generic

Workarounds

  1. 98% success Run terraform init to download modules
    Run terraform init to download modules

    Sources: https://developer.hashicorp.com/terraform/cli/commands/init

  2. 92% success If module source changed, run terraform init -upgrade to fetch new version
    If module source changed, run terraform init -upgrade to fetch new version

    Sources: https://developer.hashicorp.com/terraform/cli/commands/init

  3. 90% success For CI/CD, ensure terraform init runs before plan/apply
    # In CI/CD pipeline (e.g., GitHub Actions):
    steps:
      - run: terraform init
      - run: terraform plan -out=tfplan
      - run: terraform apply tfplan
    
    # Always run 'init' before 'plan' or 'apply'
    # Cache .terraform directory for faster CI runs

    Sources: https://developer.hashicorp.com/terraform/cli/commands/init

Dead Ends

Common approaches that don't work:

  1. Copy module source manually into .terraform/ 85% fail

    Terraform manages .terraform/ — manual changes will be overwritten

  2. Change module source to a local path 65% fail

    Defeats the purpose of using versioned modules

Error Chain

Frequently confused with: