Skip to main content

Using the Cloud Backend with OpenTofu CLI

The OpenTofu CLI lets you use cloud backends on the command line.

When you use the cloud backend CLI workflow, operations like tofu plan or tofu apply are remotely executed in the cloud backend's run environment by default, with log output streaming to the local terminal. This lets you use cloud backend's features within the familiar OpenTofu CLI workflow. Cloud backend services may choose to implement only a subset of the available features.

Workspaces can also be configured for local execution, in which case the cloud backend only stores state. In this mode, the cloud backend behaves just like a standard state backend.

Documentation Summary

  • Cloud Backend Settings documents the cloud block that you must add to your configuration to enable cloud backend support.
  • Initializing and Migrating describes how to start using the cloud backend with a working directory that already has state data.
  • Command Line Arguments lists the OpenTofu command flags that are specific to using OpenTofu with the cloud backend.