From eda35f2c49ec3f8d4a67426c43464d1a06d572b1 Mon Sep 17 00:00:00 2001 From: yessarath <30983230+yessarath@users.noreply.github.com> Date: Tue, 17 Sep 2019 23:49:54 +0530 Subject: [PATCH 1/3] local backend example added Example for local backend added. --- .../terraform/d/remote_state.html.md | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/website/docs/providers/terraform/d/remote_state.html.md b/website/docs/providers/terraform/d/remote_state.html.md index e3e6358c81..8ebc8d2f04 100644 --- a/website/docs/providers/terraform/d/remote_state.html.md +++ b/website/docs/providers/terraform/d/remote_state.html.md @@ -19,7 +19,7 @@ same limitations as the main backend configuration. You can use any number of `remote_state` data sources with differently configured backends, and you can use interpolations when configuring them. -## Example Usage +## Example Usage for remote backend ```hcl data "terraform_remote_state" "vpc" { @@ -46,6 +46,30 @@ resource "aws_instance" "foo" { } ``` +## Example Usage for local backend + +```hcl +data "terraform_remote_state" "vpc" { + backend = "local" + + config = { + path = "..." + } +} + +# Terraform >= 0.12 +resource "aws_instance" "foo" { + # ... + subnet_id = data.terraform_remote_state.vpc.outputs.subnet_id +} + +# Terraform <= 0.11 +resource "aws_instance" "foo" { + # ... + subnet_id = "${data.terraform_remote_state.vpc.subnet_id}" +} +``` + ## Argument Reference The following arguments are supported: From d006b85c261acb3f9fcc4ba3d48780347dd3c8cf Mon Sep 17 00:00:00 2001 From: Daniel Dreier Date: Thu, 21 May 2020 14:54:30 -0700 Subject: [PATCH 2/3] Update website/docs/providers/terraform/d/remote_state.html.md Co-authored-by: Nick Fagerlund --- website/docs/providers/terraform/d/remote_state.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/providers/terraform/d/remote_state.html.md b/website/docs/providers/terraform/d/remote_state.html.md index 8ebc8d2f04..cf0079d1b1 100644 --- a/website/docs/providers/terraform/d/remote_state.html.md +++ b/website/docs/providers/terraform/d/remote_state.html.md @@ -19,7 +19,7 @@ same limitations as the main backend configuration. You can use any number of `remote_state` data sources with differently configured backends, and you can use interpolations when configuring them. -## Example Usage for remote backend +## Example Usage (`remote` Backend) ```hcl data "terraform_remote_state" "vpc" { From f737d684e5070d118c07ac8f3c3aa5c0d2743c6e Mon Sep 17 00:00:00 2001 From: Daniel Dreier Date: Thu, 21 May 2020 14:54:40 -0700 Subject: [PATCH 3/3] Update website/docs/providers/terraform/d/remote_state.html.md Co-authored-by: Nick Fagerlund --- website/docs/providers/terraform/d/remote_state.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/providers/terraform/d/remote_state.html.md b/website/docs/providers/terraform/d/remote_state.html.md index cf0079d1b1..96cfdc4f6e 100644 --- a/website/docs/providers/terraform/d/remote_state.html.md +++ b/website/docs/providers/terraform/d/remote_state.html.md @@ -46,7 +46,7 @@ resource "aws_instance" "foo" { } ``` -## Example Usage for local backend +## Example Usage (`local` Backend) ```hcl data "terraform_remote_state" "vpc" {