在terraform中,有一个在aws中创建EC2机器的例子。
# Create a new instance of the latest Ubuntu 20.04 on an
# t3.micro node with an AWS Tag naming it "HelloWorld"
provider "aws" {
region = "us-west-2"
}
data "aws_ami" "ubuntu" {
most_recent = true
filter {
name = &
我正在使用Terraform来启动我的云环境。
看起来,即使是微小的配置更改也会影响到幕后的许多资源。
例如,在我创建AWS实例的情况下,一个小的更改将导致所有实例的自动生成:
-/+ aws_instance.DC (new resource required)
id: "i-075deb0aaa57c2d" => <computed> (forces new resource) <----- How can we avoid that?
ami: "ami-01e306baaaa0a6f65" =>