Skip to content

Instantly share code, notes, and snippets.

@podhmo
Created Jul 11, 2021
Embed
What would you like to do?
data "terraform_remote_state" "root" {
backend = "local"
config = {
path = "../terraform.tfstate"
}
}
output "message" {
value = "hello ${data.terraform_remote_state.root.outputs.config.person.name}!!"
}
{
"version": 4,
"terraform_version": "1.0.2",
"serial": 2,
"lineage": "79b020dd-1206-1cf8-3423-607b18805204",
"outputs": {
"message": {
"value": "hello foo!!",
"type": "string"
}
},
"resources": [
{
"mode": "data",
"type": "terraform_remote_state",
"name": "root",
"provider": "provider[\"terraform.io/builtin/terraform\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"backend": "local",
"config": {
"value": {
"path": "../terraform.tfstate"
},
"type": [
"object",
{
"path": "string"
}
]
},
"defaults": null,
"outputs": {
"value": {
"config": {
"person": {
"age": 20,
"name": "foo"
}
}
},
"type": [
"object",
{
"config": [
"object",
{
"person": [
"object",
{
"age": "number",
"name": "string"
}
]
}
]
}
]
},
"workspace": null
},
"sensitive_attributes": []
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment