Terraform: 0.12-alpha2: crash when referencing an undeclared module call

Created on 27 Nov 2018  ยท  2Comments  ยท  Source: hashicorp/terraform

Terraform Version

Terraform v0.12.0-alpha2
+ provider.aws v1.40.0-6-gb23683732
+ provider.random v2.0.0-5-g612dff2

Terraform Configuration Files

provider random {}

variable length {
  type = number
  default = 10
}

variable prefix {
  type = string
  default = ""
}

resource random_pet new_pet {
  prefix = var.prefix
  length = var.length
}

output pet {
  value = module.new_pet
}

Debug Output

Crash Output


https://gist.github.com/shikloshi/1735d67ae2e9e67f9a04c99ed6401745

Expected Behavior


Terraform should be able to apply or return a syntax error if such had happened.

Actual Behavior


Terraform crashed.

Steps to Reproduce

  • terraform init
  • terraform apply
  • Additional Context

    Configuration provided is the only file exists

    This started happening when I added the output clause.

    References

    bug config crash

    Most helpful comment

    Hi @shikloshi! Thanks for reporting this issue.

    Indeed it looks like we're missing some validation to ensure that module "new_pet" is declared before resolving it. We'll make sure this is fixed before final release.

    All 2 comments

    Hi @shikloshi! Thanks for reporting this issue.

    Indeed it looks like we're missing some validation to ensure that module "new_pet" is declared before resolving it. We'll make sure this is fixed before final release.

    I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

    If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

    Was this page helpful?
    0 / 5 - 0 ratings

    Related issues

    shanmugakarna picture shanmugakarna  ยท  3Comments

    franklinwise picture franklinwise  ยท  3Comments

    rjinski picture rjinski  ยท  3Comments

    rjinski picture rjinski  ยท  3Comments

    rkulagowski picture rkulagowski  ยท  3Comments