运行应用时,我在下面的代码中收到超时消息。创建了一个实例,但是remote-exec命令不起作用。 我在Windows 10计算机中运行此程序。 Terraform版本为v0.12.12 provider.aws v2.33.0
resource "aws_instance" "web" {
ami = "ami-54d2a63b"
instance_type = "t2.nano"
key_name = "terra"
tags = {
Name = "HelloWorld"
}
connection {
type = "ssh"
user = "ubuntu"
private_key = "${file("C:/Users/Vinayak/Downloads/terra.pem")}"
host = self.public_ip
}
provisioner "remote-exec" {
inline = [
"echo cat > test.txt"
]
}
}
答案 0 :(得分:1)
请尝试将您的主机行更改为
host = "${self.public_ip}"
让人们知道您收到的实际错误消息也可能有所帮助。 :)