Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Officially support "local" remote state #6213

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion builtin/providers/terraform/resource_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func testAccCheckStateValue(id, name, value string) resource.TestCheckFunc {

const testAccState_basic = `
resource "terraform_remote_state" "foo" {
backend = "_local"
backend = "local"

config {
path = "./test-fixtures/basic.tfstate"
Expand Down
6 changes: 2 additions & 4 deletions state/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Payload struct {
Data []byte
}

// Factory is the factory function to create a remote client.
// factory is the factory function to create a remote client.
type Factory func(map[string]string) (Client, error)

// NewClient returns a new Client with the given type and configuration.
Expand All @@ -43,7 +43,5 @@ var BuiltinClients = map[string]Factory{
"s3": s3Factory,
"swift": swiftFactory,
"artifactory": artifactoryFactory,

// This is used for development purposes only.
"_local": fileFactory,
"local": fileFactory,
}
36 changes: 36 additions & 0 deletions website/source/docs/state/remote/local.html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
layout: "remotestate"
page_title: "Remote State Backend: local"
sidebar_current: "docs-state-remote-local"
description: |-
Terraform can store the state locally.
---

# local

This is just a placeholder

## Example Usage

```
terraform remote config \
-backend=local \
-backend-config="path=/path/to/terraform.tfstate"
```

## Example Referencing

```
resource "terraform_remote_state" "foo" {
backend = "local"
config {
path = "${path.module}/../../terraform.tfstate"
}
}
```

## Configuration variables

The following configuration options are supported:

* `path` - (Required) The path to the `terraform.tfstate` file.