Terraform Resource: Connection Error while executing apply?
问题 I am trying to login to ec2 instance that terraform will create with the following code: resource "aws_instance" "sess1" { ami = "ami-c58c1dd3" instance_type = "t2.micro" key_name = "logon" connection { host= self.public_ip user = "ec2-user" private_key = file("/logon.pem") } provisioner "remote-exec" { inline = [ "sudo yum install nginx -y", "sudo service nginx start" ] } } But this gives me an error: PS C:\Users\Amritvir Singh\Documents\GitHub\AWS-Scribble\Terraform> terraform apply