Add Terraform/Remote State documentation to provider/resource section.
Issue #2074
This commit is contained in:
commit
678feaaed7
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
layout: "terraform"
|
||||
page_title: "Provider: Terraform"
|
||||
sidebar_current: "docs-terraform-index"
|
||||
description: |-
|
||||
The Terraform provider is used to access meta data from shared infrastructure.
|
||||
---
|
||||
|
||||
# Terraform Provider
|
||||
|
||||
The terraform provider exposes resources to access state meta data
|
||||
for Terraform outputs from shared infrastructure.
|
||||
|
||||
The terraform provider is what we call a _logical provider_. This has no
|
||||
impact on how it behaves, but conceptually it is important to understand.
|
||||
The terraform provider doesn't manage any _physical_ resources; it isn't
|
||||
creating servers, writing files, etc. It is used to access the outputs
|
||||
of other Terraform states to be used as inputs for resources.
|
||||
Examples will explain this best.
|
||||
|
||||
Use the navigation to the left to read about the available resources.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
# Shared infrastructure state stored in Atlas
|
||||
resource "terraform_remote_state" "vpc" {
|
||||
backend = "atlas"
|
||||
config {
|
||||
path = "hashicorp/vpc-prod"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_instance" "foo" {
|
||||
# ...
|
||||
subnet_id = "${terraform_remote_state.vpc.output.subnet_id}"
|
||||
}
|
||||
```
|
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
layout: "terraform"
|
||||
page_title: "Terraform: terraform_remote_state"
|
||||
sidebar_current: "docs-terraform-resource-remote-state"
|
||||
description: |-
|
||||
Accesses state meta data from a remote backend.
|
||||
---
|
||||
|
||||
# remote\_state
|
||||
|
||||
Retrieves state meta data from a remote backend
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
resource "terraform_remote_state" "vpc" {
|
||||
backend = "atlas"
|
||||
config {
|
||||
path = "hashicorp/vpc-prod"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_instance" "foo" {
|
||||
# ...
|
||||
subnet_id = "${terraform_remote_state.vpc.output.subnet_id}"
|
||||
}
|
||||
```
|
||||
|
||||
## Argument Reference
|
||||
|
||||
The following arguments are supported:
|
||||
|
||||
* `backend` - (Required) The remote backend to use.
|
||||
* `config` - (Optional) The configuration of the remote backend.
|
||||
|
||||
## Attributes Reference
|
||||
|
||||
The following attributes are exported:
|
||||
|
||||
* `backend` - See Argument Reference above.
|
||||
* `config` - See Argument Reference above.
|
||||
* `output` - The values of the configured `outputs` for the root module referenced by the remote state.
|
Loading…
Reference in New Issue