mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
terraform: Testing passthrough of ConnInfo
This commit is contained in:
parent
2f2f5890f4
commit
eaf2c46dc5
@ -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) {
|
||||
|
@ -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}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user