Created
March 26, 2021 15:47
-
-
Save joshmyers/7e96e291a920fac77f9a7314bc3397ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
badgers.json | |
------------ | |
```json | |
[ | |
{ | |
"dev": { | |
"us-east-1": { | |
"profile-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"dev": { | |
"us-west-2": { | |
"profile-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"qa": { | |
"us-east-1": { | |
"profile-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"qa": { | |
"us-west-2": { | |
"profile-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"prod": { | |
"us-east-1": { | |
"profile-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"prod": { | |
"us-west-2": { | |
"profile-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"dev": { | |
"us-east-1": { | |
"account-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"dev": { | |
"us-west-2": { | |
"account-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"qa": { | |
"us-east-1": { | |
"account-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"qa": { | |
"us-west-2": { | |
"account-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"dev": { | |
"us-east-1": { | |
"compliance-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"dev": { | |
"eu-west-1": { | |
"compliance-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"qa": { | |
"us-east-1": { | |
"compliance-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
}, | |
{ | |
"qa": { | |
"eu-west-1": { | |
"compliance-service": { | |
"badgers": "foo" | |
} | |
} | |
} | |
} | |
] | |
``` | |
terraform config | |
---------------- | |
```hcl | |
terraform { | |
required_providers { | |
utils = { | |
source = "cloudposse/utils" | |
} | |
} | |
} | |
locals { | |
json_data_2 = file("${path.module}/badgers.json") | |
} | |
data "utils_deep_merge_json" "example" { | |
input = [ | |
local.json_data_2 | |
] | |
} | |
output "deep_merge_output" { | |
value = jsondecode(data.utils_deep_merge_json.example.output) | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment