terraform: update comment

This commit is contained in:
Mitchell Hashimoto 2014-12-16 08:24:21 -08:00
parent e5f07567c6
commit ef60ac5b8c
4 changed files with 24 additions and 0 deletions

View File

@ -1623,6 +1623,12 @@ func (c *walkContext) computeModuleVariable(
// Get that module from our state // Get that module from our state
mod := c.Context.state.ModuleByPath(path) mod := c.Context.state.ModuleByPath(path)
if mod == nil { if mod == nil {
// If the module doesn't exist, then we can return an empty string.
// This happens usually only in Refresh() when we haven't populated
// a state. During validation, we semantically verify that all
// modules reference other modules, and graph ordering should
// ensure that the module is in the state, so if we reach this
// point otherwise it really is a panic.
return "", nil return "", nil
} }

View File

@ -0,0 +1,3 @@
variable "value" {}
resource "aws_instance" "bar" {}

View File

@ -0,0 +1,7 @@
output "output" {
value = "${aws_instance.foo.foo}"
}
resource "aws_instance" "foo" {
compute = "foo"
}

View File

@ -0,0 +1,8 @@
module "foo" {
source = "./foo"
}
module "bar" {
source = "./bar"
value = "${module.foo.output}"
}