config: fix error message in validation

This commit is contained in:
Mitchell Hashimoto 2014-07-22 08:47:10 -07:00
parent f9e6754763
commit b10b678326
2 changed files with 9 additions and 3 deletions

View File

@ -213,8 +213,8 @@ func (c *Config) Validate() error {
// are valid in the Validate step.
func (c *Config) allVariables() map[string][]InterpolatedVariable {
result := make(map[string][]InterpolatedVariable)
for n, pc := range c.ProviderConfigs {
source := fmt.Sprintf("provider config '%s'", n)
for _, pc := range c.ProviderConfigs {
source := fmt.Sprintf("provider config '%s'", pc.Name)
for _, v := range pc.RawConfig.Variables {
result[source] = append(result[source], v)
}

View File

@ -3,6 +3,12 @@ variable "foo" {
description = "bar";
}
variable "amis" {
default = {
"east": "foo",
}
}
provider "aws" {
access_key = "foo";
secret_key = "bar";
@ -16,7 +22,7 @@ resource "aws_security_group" "firewall" {
}
resource aws_instance "web" {
ami = "${var.foo}"
ami = "${var.amis.east}"
security_groups = [
"foo",
"${aws_security_group.firewall.foo}"