terraform/website/docs/language/settings/backends/local.html.md

45 lines
961 B
Markdown
Raw Normal View History

2017-02-15 19:47:30 +01:00
---
layout: "language"
2017-02-15 21:19:38 +01:00
page_title: "Backend Type: local"
sidebar_current: "docs-backends-types-enhanced-local"
2017-02-15 19:47:30 +01:00
description: |-
2017-02-15 21:19:38 +01:00
Terraform can store the state remotely, making it easier to version and work with in a team.
2017-02-15 19:47:30 +01:00
---
# local
2017-02-15 21:19:38 +01:00
**Kind: Enhanced**
2017-02-15 19:47:30 +01:00
2017-02-15 21:19:38 +01:00
The local backend stores state on the local filesystem, locks that
state using system APIs, and performs operations locally.
## Example Configuration
2017-02-15 19:47:30 +01:00
```hcl
2017-02-15 21:19:38 +01:00
terraform {
backend "local" {
path = "relative/path/to/terraform.tfstate"
}
}
2017-02-15 19:47:30 +01:00
```
## Data Source Configuration
2017-02-15 19:47:30 +01:00
```hcl
2017-02-15 19:47:30 +01:00
data "terraform_remote_state" "foo" {
backend = "local"
2017-02-15 21:19:38 +01:00
config = {
path = "${path.module}/../../terraform.tfstate"
}
2017-02-15 19:47:30 +01:00
}
```
## Configuration variables
The following configuration options are supported:
2017-02-15 21:19:38 +01:00
* `path` - (Optional) The path to the `tfstate` file. This defaults to
"terraform.tfstate" relative to the root module by default.
* `workspace_dir` - (Optional) The path to non-default workspaces.