The backend Block in Configuration

Learn about the configuration of the Terraform backend block.

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 configuration block using Azure Storage might look like this:

Get hands-on with 1400+ tech skills courses.