
However, in normal use, we do not recommend including access credentials as part of the backend configuration. Some backends allow providing access credentials directly as part of the configuration for use in unusual situations, for pragmatic reasons. The arguments used in the block's body are specific to the chosen backend type they configure where and how the backend will store the configuration's state, and in some cases configure other behavior.

Terraform has a built-in selection of backends, and the configured backend must be available in the version of Terraform you are using. The block label of the backend block ( "remote", in the example above) indicates which backend type to use. Use environment variables to pass credentials when you need to use different values between the plan and apply steps. If that configuration contains time-limited credentials, they may expire before you finish applying the plan. When applying a plan that you previously saved to a file, Terraform uses the backend configuration stored in that file instead of the current backend settings. This helps ensure Terraform is applying the plan to correct set of infrastructure. terraform/terraform.tfstate at the time the plan was created. All plan files capture the information in.

terraform/terraform.tfstate file contains the backend configuration for the current working directory. Terraform writes the backend configuration in plain text in two separate files.

terraform subdirectory and in plan files. If you use -backend-config or hardcode these values directly in your configuration, Terraform will include these values in both the. Warning: We recommend using environment variables to supply credentials and other sensitive data.
