Terraform introduction

Table of Contents

slides 1
slides 2

home

1. What’s Terraform?

Terraform is an infrastructure provisioning tool created by Hashicorp. It allows you to describe your infrastructure as code, creates “executions plans” that outline exactly what will happen when you run your code, builds a graph of your resources, and automates changes with minimal human interaction. Terraform uses it own domain-specific language (DSL) called Hashicorp Configuration Language (HCL). HCL is JSON-compatible and is used to create these configuration files that describe the infrastructure resources to be deployed. Terraform is cloud-agnostic aand allows you to automate infrastructure stacks from multiple cloud service providers simultaneously and integrate other third-party services. You even can write Terraform plugins to add new advanced functionality to the platform.

2. Remote state and backends

look for this topic …

3. Implicit and explicit dependencies

Most of the time Terraform infers dependencies between resources based on the configuration given, so that resources are created and destroyed in the correct order. However, Terraform can not infer dependencies between different parts of your infrastructure, and you will need to create an explicit dependency with the depends on argument.

When we do not use depends on argument Terraform will use implicit dependency, so it will create the infrastructure in the correct order, For example first creates the EC2 and after the EIP. But if our app needs an S3 Bucket we are going to use depends on, it is an explicit dependency, so it will wait for the creation of the S3 Bucket and after creates the EC2.

Author: Andres Amezquita

Created: 2023-05-06 sáb 22:56