Terraform Backends

Terraform Backends

Terraform Backends

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have discussed terraform workspaces.

https://cloudaffaire.com/terraform-workspace/

In this blog post, we will discuss terraform backends.

What is terraform backends?

A backend in Terraform determines how state is loaded and how an operation such as apply is executed. This abstraction enables non-local file state storage, remote execution, etc. By default, Terraform uses the local backend, but you can configure and use remote backends.

Benefits of backends:

  • Working in a team: Backends can store their state remotely and protect that state with locks to prevent corruption.
  • Keeping sensitive information off disk: State is retrieved from backends on demand and only stored in memory. If you’re using a backend such as Amazon S3, the only location the state ever is persisted is in S3.
  • Remote operations: For larger infrastructures or certain changes, terraform apply can take a long, long time. Some backends support remote operations which enable the operation to execute remotely. You can then turn off your computer and your operation will still complete. Paired with remote state storage and locking above, this also helps in team environments.

Next, we are going to create and configure terraform remote backend using AWS S3 for state storage and DynamoDB table for locking.

Terraform Backends:

Hope you have enjoyed this article. In the next blog post, we will discuss terraform locals.

To get more details on terraform, please refer below terraform documentation.

https://www.terraform.io/docs/index.html

 

Leave a Reply

Close Menu