Terraform

 

Terraform Configuration
Languge
  • HashiCorp Configuration Language(HCL)
  • Specialized language for HashiCorp tools
  • JSON compatible
  • Human Readable
  • Files have .tf extension
Terraform Configuration
Languge
# A single line comment

/* A multi
   line comment. */

resource "aws_instance" "web" {
  ami               = "ami-ef140f90"
  count             = 2
  source_dest_check = false
  connection {
    user = "root"
  }
}
Comments
Code

compute.tf

Providers

Responsible for creating resources on

 

​IaaS

PaaS

SaaS

Providers

provider.tf

provider "aws" {
  access_key = "ABZ5I2BTW4FKHCWG34N"
  secret_key = "GiK+cFOUrhZmTDr3kSA"
  region     = "us-east-1"
}
  • IaaS definition
  • access credentials
  • region to create resources

Example:

Variables

Text

Made with Slides.com