我的 .tf file 中有 resource "aws_instance" "webserver"
,其中包含 provisioner "install-apache"
:
provider "aws" {
access_key = "ACCESS_KEY"
secret_key = "SECRET-KEY"
region = "us-east-1"
}
resource "aws_instance" "webserver" {
ami = "ami-b374d5a5"
instance_type = "t2.micro"
provisioner "install-apache" {
command = "apt-get install nginx"
}
}
运行 terraform plan
后我遇到了错误:
* aws_instance.webserver: provisioner install-apache couldn't be found
根据terraform documentation一切看起来都很好 .
1 回答
provisioner值必须是以下值之一:
厨师
文件
local-exec
remote-exec
我相信你的情况,你想要remote-exec值