config: test we can ref splat of other resources

This commit is contained in:
Mitchell Hashimoto 2015-02-20 09:19:13 -08:00
parent 90a6a627ed
commit f156d0d1bd
2 changed files with 16 additions and 0 deletions

View File

@ -179,6 +179,13 @@ func TestConfigValidate_pathVarInvalid(t *testing.T) {
}
}
func TestConfigValidate_provConnSplatOther(t *testing.T) {
c := testConfig(t, "validate-prov-conn-splat-other")
if err := c.Validate(); err != nil {
t.Fatalf("should be valid: %s", err)
}
}
func TestConfigValidate_provConnSplatSelf(t *testing.T) {
c := testConfig(t, "validate-prov-conn-splat-self")
if err := c.Validate(); err == nil {

View File

@ -0,0 +1,9 @@
resource "aws_instance" "foo" {}
resource "aws_instance" "bar" {
connection {
host = "${element(aws_instance.foo.*.private_ip, 0)}"
}
provisioner "local-exec" {}
}