- Terraform
Introduction to TerraformGetting Started- Terraform Components
- Terraform Execution Steps
- Terraform (advanced)
- Terraform Components
- Terraform Executable
- Terraform Files
Configuration FilesTerraform File StructureVariablesProvidersOutputResources
Terraform SyntaxBlocks
- Terraform Plugins
- Providers
- Terraform State
- Update Configuration
- Terraform File Structure
- File Hierarchy and Structure
- Terraform
- Introduction
- What is Terraform?
- Quick: How Terraform Works (https://marcelzehner.ch/2018/05/14/terraform-a-first-introduction/)
- Getting Started
- Sample (Hello World)
- Introduction
- Terraform – HashiCorp Configuration Language
- Resources and Modules (https://www.terraform.io/docs/configuration/index.html)
- Arguments and Blocks (https://www.terraform.io/docs/configuration/syntax.html)
- Blocks https://www.terraform.io/docs/configuration/resources.html
- Variables
- Providers
- Output
- Resources
- “Usage Guidelines and Best Practices”
Introduction to Terraform
Terraform is a tool from HashiCorp to manage infrastructure as code.
It supports the concept of providers to integrate with different platforms like Azure, AWS, GCP, Kubernetes and more. Supporting different providers make Terraform very popular and powerful.
Getting Started
Automating infrastructure deployment.
Key Concepts:
- Provisioning Resources
- Planning Updates
- Using Source Control
- Reusing Templates
Terraform rule: Make all changes in Terraform.
Hello World
The following sample is a very simple configuration to showcase the deployment of …
variable "subscription_id" {}
variable "tenant_id" {}
variable "location" {
default = "west"
}
## sample ...
Structure of a Terraform file
- Variables
- Providers
- Resources
- Outputs
Terraform Components
Terraform consists of the following components:
- Terraform executable is a single executable written in Go (no installation or dependencies needed), available on multiple operating systems
- Terraform files contains the configuration and the file have a .tf extension. If a directory contains multiple Terraform files, they will be sticked together.
- Terraform plugins like providers for AWS, Azure, etc.
- Terraform state, is a file with the current state
Terraform Execution Steps
Cycle and steps in a Terraform deployment
terraform init
will initialize by looking at the configuration files, encounters the providers and downloads the plugins like Azure provider.terraform plan
will look at the configuration files in the current working directory and loads the variables in this directory. It will look at the existing environment and compares it with the desired configuration and then figures out what to do.terraform apply
will deploy the environment using the plan and then store the state in the terraform state file.terraform destroy
will delete all resources which are in the configuration.
Resume / recap
So Terraform can …