Terraform

What do you do next after writing the following in main.tf file?

resource "aws_instance" "some-instance" {
  ami           = "ami-201720221991yay"
  instance_type = "t2.micro
}

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

Run terraform init. This will scan the code in the directory to figure out which providers are used (in this case AWS provider) and will download them.