config: test we can ref splat of other resources
This commit is contained in:
parent
90a6a627ed
commit
f156d0d1bd
|
@ -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) {
|
func TestConfigValidate_provConnSplatSelf(t *testing.T) {
|
||||||
c := testConfig(t, "validate-prov-conn-splat-self")
|
c := testConfig(t, "validate-prov-conn-splat-self")
|
||||||
if err := c.Validate(); err == nil {
|
if err := c.Validate(); err == nil {
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
resource "aws_instance" "foo" {}
|
||||||
|
|
||||||
|
resource "aws_instance" "bar" {
|
||||||
|
connection {
|
||||||
|
host = "${element(aws_instance.foo.*.private_ip, 0)}"
|
||||||
|
}
|
||||||
|
|
||||||
|
provisioner "local-exec" {}
|
||||||
|
}
|
Loading…
Reference in New Issue