Files
opentf/website/source/docs/providers/terraform/d/remote_state.html.md
2016-08-19 00:50:43 +01:00

1.1 KiB

layout, page_title, sidebar_current, description
layout page_title sidebar_current description
terraform Terraform: terraform_remote_state docs-terraform-datasource-remote-state Accesses state meta data from a remote backend.

remote_state

Retrieves state meta data from a remote backend

Example Usage

data "terraform_remote_state" "vpc" {
    backend = "atlas"
    config {
        name = "hashicorp/vpc-prod"
    }
}

resource "aws_instance" "foo" {
    # ...
    subnet_id = "${data.terraform_remote_state.vpc.subnet_id}"
}

Argument Reference

The following arguments are supported:

  • backend - (Required) The remote backend to use.
  • config - (Optional) The configuration of the remote backend.
  • Remote state config docs can be found here

Attributes Reference

The following attributes are exported:

  • backend - See Argument Reference above.
  • config - See Argument Reference above.

In addition, each output in the remote state appears as a top level attribute on the terraform_remote_state resource.