terraform: Testing passthrough of ConnInfo

This commit is contained in:
Armon Dadgar 2014-07-11 11:49:22 -07:00
parent 2f2f5890f4
commit eaf2c46dc5
2 changed files with 12 additions and 0 deletions

View File

@ -195,11 +195,19 @@ func TestGraphProvisioners(t *testing.T) {
if prov.RawConfig.Config()["cmd"] != "add ${aws_instance.web.id}" {
t.Fatalf("bad: %#v", prov)
}
if prov.ConnInfo == nil || len(prov.ConnInfo.Raw) != 2 {
t.Fatalf("bad: %#v", prov)
}
// Check that the variable dependency is handled
if !depends("aws_load_balancer.weblb", "aws_instance.web") {
t.Fatalf("missing dependency from provisioner variable")
}
// Check that the connection variable dependency is handled
if !depends("aws_load_balancer.weblb", "aws_security_group.firewall") {
t.Fatalf("missing dependency from provisioner connection")
}
}
func TestGraphAddDiff(t *testing.T) {

View File

@ -24,5 +24,9 @@ resource "aws_instance" "web" {
resource "aws_load_balancer" "weblb" {
provisioner "shell" {
cmd = "add ${aws_instance.web.id}"
connection {
type = "magic"
user = "${aws_security_group.firewall.id}"
}
}
}