Search⌘ K
AI Features

The backend Block in Configuration

Explore how to define and configure the Terraform backend block to manage your infrastructure state securely. Learn to use partial configurations to protect sensitive data by supplying key values at runtime, and understand best practices for state storage and initialization.

How is the Terraform backend block defined?

The configuration of Terraform back-ends is defined inside the terraform block of a root module. The nested backend block defines the type of back-end being used and the required and optional properties of that back-end. Only one back-end can be specified per configuration. We can’t simultaneously store our state in two different back-ends or split our state across two different back-ends. That situation can be solved by splitting the configuration itself into two interdependent configurations.

As we saw earlier, a basic backend ...