1
每當我添加key_name
我的亞馬遜資源,我從來沒有真正連接到生成的實例:密鑰文件中Terraform
provider "aws" {
"region" = "us-east-1"
"access_key" = "**"
"secret_key" = "****"
}
resource "aws_instance" "api_server" {
ami = "ami-013f1e6b"
instance_type = "t2.micro"
"key_name" = "po"
tags {
Name = "API_Server"
}
}
output "API IP" {
value = "${aws_instance.api_server.public_ip}"
}
當我做
ssh -i ~/Downloads/po.pem [email protected]
我只是一個空白行在我的終端中,好像我輸入了一個錯誤的IP。但是,檢查亞馬遜控制檯,我可以看到該實例正在運行。我在Terraform上也沒有收到任何錯誤。