|
|
|
|
@ -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 (`remote` Backend)
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
data "terraform_remote_state" "vpc" {
|
|
|
|
|
@ -46,6 +46,30 @@ resource "aws_instance" "foo" {
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Example Usage (`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:
|
|
|
|
|
|