The article contains exaples of terraform config files.
Configure AWS provider, create instance and assign elastic IP:
provider "aws" {
access_key = "<KEY>"
secret_key = "<SECRET_KEY>"
region = "us-east-1"
}
resource "aws_instance" "base" {
ami = "ami-0be2609ba883822ec"
instance_type = "t2.micro"
}
resource "aws_eip" "base" {
instance = aws_instance.base.id
}
Validate, plan and apply:
terraform validate
terraform plan
terraform apply