2019-02-22 20:23:42 +01:00
|
|
|
variable "login_username" {
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_instance" "foo" {
|
2019-02-22 03:10:31 +01:00
|
|
|
connection {
|
2019-02-22 20:23:42 +01:00
|
|
|
host = coalesce(self.public_ip, self.private_ip)
|
2019-02-22 03:10:31 +01:00
|
|
|
type = "ssh"
|
2019-02-22 20:23:42 +01:00
|
|
|
user = var.login_username
|
2019-02-22 03:10:31 +01:00
|
|
|
}
|
|
|
|
|
2019-02-22 02:51:37 +01:00
|
|
|
provisioner "test" {
|
|
|
|
commands = ["a", "b", "c"]
|
|
|
|
|
|
|
|
when = create
|
|
|
|
on_failure = fail
|
2019-02-22 03:10:31 +01:00
|
|
|
|
|
|
|
connection {
|
2019-02-22 20:23:42 +01:00
|
|
|
host = coalesce(self.public_ip, self.private_ip)
|
2019-02-22 03:10:31 +01:00
|
|
|
type = "winrm"
|
2019-02-22 20:23:42 +01:00
|
|
|
user = var.login_username
|
2019-02-22 03:10:31 +01:00
|
|
|
}
|
2019-02-22 02:51:37 +01:00
|
|
|
}
|
|
|
|
}
|