Skip to content

Instantly share code, notes, and snippets.

@podhmo
Created July 11, 2021 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save podhmo/b4b4d5fcb2cca00eb43f81e6be4a8cf2 to your computer and use it in GitHub Desktop.
Save podhmo/b4b4d5fcb2cca00eb43f81e6be4a8cf2 to your computer and use it in GitHub Desktop.
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