Skip to content

Instantly share code, notes, and snippets.

@joshmyers
Created March 26, 2021 15:47
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 joshmyers/7e96e291a920fac77f9a7314bc3397ba to your computer and use it in GitHub Desktop.
Save joshmyers/7e96e291a920fac77f9a7314bc3397ba to your computer and use it in GitHub Desktop.
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