├── .github └── workflows │ └── CICD.yml ├── .gitignore ├── LICENSE ├── README.md ├── depth.tf ├── depth.tmpl ├── examples └── example-1 │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── main.tf ├── outputs.tf ├── tests.tftest.hcl ├── variables.tf └── versions.tf /.github/workflows/CICD.yml: -------------------------------------------------------------------------------- 1 | name: "Build" 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | Matrix: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - name: Generate Matrix 11 | id: matrix 12 | uses: Invicton-Labs/terraform-module-testing/matrix@v0.4.0 13 | with: 14 | minimum_tf_version: '1.10.3' 15 | additional_runners: 'macos-13, windows-2019' 16 | 17 | - name: Output Matrix 18 | run: | 19 | echo "Strategy: ${{ steps.matrix.outputs.strategy }}" 20 | 21 | outputs: 22 | strategy: ${{ steps.matrix.outputs.strategy }} 23 | 24 | Test: 25 | needs: [Matrix] 26 | strategy: ${{ fromJSON(needs.Matrix.outputs.strategy)}} 27 | runs-on: ${{ matrix.runs-on }} 28 | container: ${{ matrix.container }} 29 | steps: 30 | - name: Initialize 31 | id: init 32 | uses: Invicton-Labs/terraform-module-testing/initialize@v0.4.0 33 | with: 34 | tf_path: . 35 | - name: Test 36 | id: test 37 | run: terraform test 38 | 39 | # This job just waits for all other jobs to pass. We have it here 40 | # so our branch protection rule can reference a single job, instead 41 | # of needing to list every matrix value of every job above. 42 | Passed: 43 | runs-on: ubuntu-latest 44 | needs: [Test] 45 | steps: 46 | - name: Mark tests as passed 47 | run: echo "🎉" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Local .terraform directories 2 | **/.terraform/* 3 | 4 | # .tfstate files 5 | *.tfstate 6 | *.tfstate.* 7 | 8 | # Crash log files 9 | crash.log 10 | 11 | # Ignore any .tfvars files that are generated automatically for each Terraform run. Most 12 | # .tfvars files are managed as part of configuration and so should be included in 13 | # version control. 14 | # 15 | # example.tfvars 16 | 17 | # Ignore override files as they are usually used to override resources locally and so 18 | # are not checked in 19 | override.tf 20 | override.tf.json 21 | *_override.tf 22 | *_override.tf.json 23 | 24 | # Include override files you do wish to add to version control using negated pattern 25 | # 26 | # !example_override.tf 27 | 28 | # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan 29 | # example: *tfplan* 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021-2025 Invicton Labs (https://invictonlabs.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Deepmerge 2 | 3 | This module performs a deep map merge of standard Terraform maps/objects. It is functionally similar to the built-in `merge` function, except that it will merge maps at the same depth instead of overwriting them. It can handle maps with a depth up to 100 (see commented-out code at the bottom of `main.tf` if you want to modify it to handle deeper maps). 4 | 5 | It functions by "flattening" each input map into a map of depth 1 where each key is the full path to the value in question. It then uses the standard merge function on these flat maps, and finally it re-builds the map structure in reverse order. 6 | 7 | **Note:** Lists will be overwritten. Only maps are merged. 8 | 9 | ## Usage 10 | ``` 11 | locals { 12 | map1 = { 13 | key1-1 = { 14 | key1-1-1 = "value1-1-1" 15 | key1-1-2 = "value1-1-2" 16 | key1-1-3 = { 17 | key1-1-3-1 = "value1-1-3-1" 18 | key1-1-3-2 = "value1-1-3-2" 19 | } 20 | } 21 | key1-2 = "value1-2" 22 | key1-3 = { 23 | key1-3-1 = "value1-3-1" 24 | key1-3-2 = "value1-3-2" 25 | } 26 | } 27 | 28 | map2 = { 29 | key1-1 = { 30 | key1-1-1 = "value1-1-1(overwrite)" 31 | key1-1-3 = { 32 | key1-1-3-2 = "value1-1-3-2(overwrite)" 33 | key1-1-3-3 = { 34 | key1-1-3-3-1 = "value1-1-3-3-1" 35 | } 36 | } 37 | key1-1-4 = "value1-1-4" 38 | } 39 | key1-2 = { 40 | key1-2-1 = "value1-2-1" 41 | key1-2-2 = "value1-2-2" 42 | key1-2-3 = { 43 | key1-2-3-1 = "value1-2-3-1" 44 | } 45 | } 46 | key1-3 = "value1-3(overwrite)" 47 | } 48 | 49 | map3 = { 50 | key1-3 = "value1-3(double-overwrite)" 51 | key1-2 = { 52 | key1-2-3 = { 53 | key1-2-3-2 = "value1-2-3-2" 54 | } 55 | } 56 | } 57 | } 58 | 59 | module "deepmerge" { 60 | source = "Invicton-Labs/deepmerge/null" 61 | maps = [ 62 | local.map1, 63 | local.map2, 64 | local.map3 65 | ] 66 | } 67 | 68 | output "merged" { 69 | description = "The merged map." 70 | value = module.deepmerge.merged 71 | } 72 | 73 | ``` 74 | 75 | Output: 76 | ``` 77 | merged = { 78 | "key1-1" = { 79 | "key1-1-1" = "value1-1-1(overwrite)" 80 | "key1-1-2" = "value1-1-2" 81 | "key1-1-3" = { 82 | "key1-1-3-1" = "value1-1-3-1" 83 | "key1-1-3-2" = "value1-1-3-2(overwrite)" 84 | "key1-1-3-3" = { 85 | "key1-1-3-3-1" = "value1-1-3-3-1" 86 | } 87 | } 88 | "key1-1-4" = "value1-1-4" 89 | } 90 | "key1-2" = { 91 | "key1-2-1" = "value1-2-1" 92 | "key1-2-2" = "value1-2-2" 93 | "key1-2-3" = { 94 | "key1-2-3-1" = "value1-2-3-1" 95 | "key1-2-3-2" = "value1-2-3-2" 96 | } 97 | } 98 | "key1-3" = "value1-3(double-overwrite)" 99 | } 100 | ``` -------------------------------------------------------------------------------- /depth.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | mod0toparse = [ 3 | for map_idx in range(0, length(local.input_maps)): 4 | [{ 5 | path = [], 6 | value = local.input_maps[map_idx] 7 | }] 8 | ] 9 | mod0 = [ 10 | for map_idx in range(0, length(local.input_maps)): 11 | { 12 | fields = concat([], [ 13 | for item in local.mod0toparse[map_idx]: 14 | [ 15 | for key in keys(item["value"]): 16 | { 17 | key = jsonencode(concat(item["path"], [key])), 18 | path = concat(item["path"], [key]), 19 | value = item["value"][key], 20 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 21 | } 22 | ] 23 | ]...) 24 | remaining = concat([], [ 25 | for item in local.mod0toparse[map_idx]: 26 | [ 27 | for key in keys(item["value"]): 28 | { 29 | path = concat(item["path"], [key]), 30 | value = item["value"][key] 31 | } 32 | if item["value"][key] != null && can(keys(item["value"][key])) 33 | ] 34 | ]...) 35 | } 36 | ] 37 | mod1 = [ 38 | for map_idx in range(0, length(local.input_maps)): 39 | { 40 | fields = concat([], [ 41 | for item in local.mod0[map_idx].remaining: 42 | [ 43 | for key in keys(item["value"]): 44 | { 45 | key = jsonencode(concat(item["path"], [key])), 46 | path = concat(item["path"], [key]), 47 | value = item["value"][key], 48 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 49 | } 50 | ] 51 | ]...) 52 | remaining = concat([], [ 53 | for item in local.mod0[map_idx].remaining: 54 | [ 55 | for key in keys(item["value"]): 56 | { 57 | path = concat(item["path"], [key]), 58 | value = item["value"][key] 59 | } 60 | if item["value"][key] != null && can(keys(item["value"][key])) 61 | ] 62 | ]...) 63 | } 64 | ] 65 | mod2 = [ 66 | for map_idx in range(0, length(local.input_maps)): 67 | { 68 | fields = concat([], [ 69 | for item in local.mod1[map_idx].remaining: 70 | [ 71 | for key in keys(item["value"]): 72 | { 73 | key = jsonencode(concat(item["path"], [key])), 74 | path = concat(item["path"], [key]), 75 | value = item["value"][key], 76 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 77 | } 78 | ] 79 | ]...) 80 | remaining = concat([], [ 81 | for item in local.mod1[map_idx].remaining: 82 | [ 83 | for key in keys(item["value"]): 84 | { 85 | path = concat(item["path"], [key]), 86 | value = item["value"][key] 87 | } 88 | if item["value"][key] != null && can(keys(item["value"][key])) 89 | ] 90 | ]...) 91 | } 92 | ] 93 | mod3 = [ 94 | for map_idx in range(0, length(local.input_maps)): 95 | { 96 | fields = concat([], [ 97 | for item in local.mod2[map_idx].remaining: 98 | [ 99 | for key in keys(item["value"]): 100 | { 101 | key = jsonencode(concat(item["path"], [key])), 102 | path = concat(item["path"], [key]), 103 | value = item["value"][key], 104 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 105 | } 106 | ] 107 | ]...) 108 | remaining = concat([], [ 109 | for item in local.mod2[map_idx].remaining: 110 | [ 111 | for key in keys(item["value"]): 112 | { 113 | path = concat(item["path"], [key]), 114 | value = item["value"][key] 115 | } 116 | if item["value"][key] != null && can(keys(item["value"][key])) 117 | ] 118 | ]...) 119 | } 120 | ] 121 | mod4 = [ 122 | for map_idx in range(0, length(local.input_maps)): 123 | { 124 | fields = concat([], [ 125 | for item in local.mod3[map_idx].remaining: 126 | [ 127 | for key in keys(item["value"]): 128 | { 129 | key = jsonencode(concat(item["path"], [key])), 130 | path = concat(item["path"], [key]), 131 | value = item["value"][key], 132 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 133 | } 134 | ] 135 | ]...) 136 | remaining = concat([], [ 137 | for item in local.mod3[map_idx].remaining: 138 | [ 139 | for key in keys(item["value"]): 140 | { 141 | path = concat(item["path"], [key]), 142 | value = item["value"][key] 143 | } 144 | if item["value"][key] != null && can(keys(item["value"][key])) 145 | ] 146 | ]...) 147 | } 148 | ] 149 | mod5 = [ 150 | for map_idx in range(0, length(local.input_maps)): 151 | { 152 | fields = concat([], [ 153 | for item in local.mod4[map_idx].remaining: 154 | [ 155 | for key in keys(item["value"]): 156 | { 157 | key = jsonencode(concat(item["path"], [key])), 158 | path = concat(item["path"], [key]), 159 | value = item["value"][key], 160 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 161 | } 162 | ] 163 | ]...) 164 | remaining = concat([], [ 165 | for item in local.mod4[map_idx].remaining: 166 | [ 167 | for key in keys(item["value"]): 168 | { 169 | path = concat(item["path"], [key]), 170 | value = item["value"][key] 171 | } 172 | if item["value"][key] != null && can(keys(item["value"][key])) 173 | ] 174 | ]...) 175 | } 176 | ] 177 | mod6 = [ 178 | for map_idx in range(0, length(local.input_maps)): 179 | { 180 | fields = concat([], [ 181 | for item in local.mod5[map_idx].remaining: 182 | [ 183 | for key in keys(item["value"]): 184 | { 185 | key = jsonencode(concat(item["path"], [key])), 186 | path = concat(item["path"], [key]), 187 | value = item["value"][key], 188 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 189 | } 190 | ] 191 | ]...) 192 | remaining = concat([], [ 193 | for item in local.mod5[map_idx].remaining: 194 | [ 195 | for key in keys(item["value"]): 196 | { 197 | path = concat(item["path"], [key]), 198 | value = item["value"][key] 199 | } 200 | if item["value"][key] != null && can(keys(item["value"][key])) 201 | ] 202 | ]...) 203 | } 204 | ] 205 | mod7 = [ 206 | for map_idx in range(0, length(local.input_maps)): 207 | { 208 | fields = concat([], [ 209 | for item in local.mod6[map_idx].remaining: 210 | [ 211 | for key in keys(item["value"]): 212 | { 213 | key = jsonencode(concat(item["path"], [key])), 214 | path = concat(item["path"], [key]), 215 | value = item["value"][key], 216 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 217 | } 218 | ] 219 | ]...) 220 | remaining = concat([], [ 221 | for item in local.mod6[map_idx].remaining: 222 | [ 223 | for key in keys(item["value"]): 224 | { 225 | path = concat(item["path"], [key]), 226 | value = item["value"][key] 227 | } 228 | if item["value"][key] != null && can(keys(item["value"][key])) 229 | ] 230 | ]...) 231 | } 232 | ] 233 | mod8 = [ 234 | for map_idx in range(0, length(local.input_maps)): 235 | { 236 | fields = concat([], [ 237 | for item in local.mod7[map_idx].remaining: 238 | [ 239 | for key in keys(item["value"]): 240 | { 241 | key = jsonencode(concat(item["path"], [key])), 242 | path = concat(item["path"], [key]), 243 | value = item["value"][key], 244 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 245 | } 246 | ] 247 | ]...) 248 | remaining = concat([], [ 249 | for item in local.mod7[map_idx].remaining: 250 | [ 251 | for key in keys(item["value"]): 252 | { 253 | path = concat(item["path"], [key]), 254 | value = item["value"][key] 255 | } 256 | if item["value"][key] != null && can(keys(item["value"][key])) 257 | ] 258 | ]...) 259 | } 260 | ] 261 | mod9 = [ 262 | for map_idx in range(0, length(local.input_maps)): 263 | { 264 | fields = concat([], [ 265 | for item in local.mod8[map_idx].remaining: 266 | [ 267 | for key in keys(item["value"]): 268 | { 269 | key = jsonencode(concat(item["path"], [key])), 270 | path = concat(item["path"], [key]), 271 | value = item["value"][key], 272 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 273 | } 274 | ] 275 | ]...) 276 | remaining = concat([], [ 277 | for item in local.mod8[map_idx].remaining: 278 | [ 279 | for key in keys(item["value"]): 280 | { 281 | path = concat(item["path"], [key]), 282 | value = item["value"][key] 283 | } 284 | if item["value"][key] != null && can(keys(item["value"][key])) 285 | ] 286 | ]...) 287 | } 288 | ] 289 | mod10 = [ 290 | for map_idx in range(0, length(local.input_maps)): 291 | { 292 | fields = concat([], [ 293 | for item in local.mod9[map_idx].remaining: 294 | [ 295 | for key in keys(item["value"]): 296 | { 297 | key = jsonencode(concat(item["path"], [key])), 298 | path = concat(item["path"], [key]), 299 | value = item["value"][key], 300 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 301 | } 302 | ] 303 | ]...) 304 | remaining = concat([], [ 305 | for item in local.mod9[map_idx].remaining: 306 | [ 307 | for key in keys(item["value"]): 308 | { 309 | path = concat(item["path"], [key]), 310 | value = item["value"][key] 311 | } 312 | if item["value"][key] != null && can(keys(item["value"][key])) 313 | ] 314 | ]...) 315 | } 316 | ] 317 | mod11 = [ 318 | for map_idx in range(0, length(local.input_maps)): 319 | { 320 | fields = concat([], [ 321 | for item in local.mod10[map_idx].remaining: 322 | [ 323 | for key in keys(item["value"]): 324 | { 325 | key = jsonencode(concat(item["path"], [key])), 326 | path = concat(item["path"], [key]), 327 | value = item["value"][key], 328 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 329 | } 330 | ] 331 | ]...) 332 | remaining = concat([], [ 333 | for item in local.mod10[map_idx].remaining: 334 | [ 335 | for key in keys(item["value"]): 336 | { 337 | path = concat(item["path"], [key]), 338 | value = item["value"][key] 339 | } 340 | if item["value"][key] != null && can(keys(item["value"][key])) 341 | ] 342 | ]...) 343 | } 344 | ] 345 | mod12 = [ 346 | for map_idx in range(0, length(local.input_maps)): 347 | { 348 | fields = concat([], [ 349 | for item in local.mod11[map_idx].remaining: 350 | [ 351 | for key in keys(item["value"]): 352 | { 353 | key = jsonencode(concat(item["path"], [key])), 354 | path = concat(item["path"], [key]), 355 | value = item["value"][key], 356 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 357 | } 358 | ] 359 | ]...) 360 | remaining = concat([], [ 361 | for item in local.mod11[map_idx].remaining: 362 | [ 363 | for key in keys(item["value"]): 364 | { 365 | path = concat(item["path"], [key]), 366 | value = item["value"][key] 367 | } 368 | if item["value"][key] != null && can(keys(item["value"][key])) 369 | ] 370 | ]...) 371 | } 372 | ] 373 | mod13 = [ 374 | for map_idx in range(0, length(local.input_maps)): 375 | { 376 | fields = concat([], [ 377 | for item in local.mod12[map_idx].remaining: 378 | [ 379 | for key in keys(item["value"]): 380 | { 381 | key = jsonencode(concat(item["path"], [key])), 382 | path = concat(item["path"], [key]), 383 | value = item["value"][key], 384 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 385 | } 386 | ] 387 | ]...) 388 | remaining = concat([], [ 389 | for item in local.mod12[map_idx].remaining: 390 | [ 391 | for key in keys(item["value"]): 392 | { 393 | path = concat(item["path"], [key]), 394 | value = item["value"][key] 395 | } 396 | if item["value"][key] != null && can(keys(item["value"][key])) 397 | ] 398 | ]...) 399 | } 400 | ] 401 | mod14 = [ 402 | for map_idx in range(0, length(local.input_maps)): 403 | { 404 | fields = concat([], [ 405 | for item in local.mod13[map_idx].remaining: 406 | [ 407 | for key in keys(item["value"]): 408 | { 409 | key = jsonencode(concat(item["path"], [key])), 410 | path = concat(item["path"], [key]), 411 | value = item["value"][key], 412 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 413 | } 414 | ] 415 | ]...) 416 | remaining = concat([], [ 417 | for item in local.mod13[map_idx].remaining: 418 | [ 419 | for key in keys(item["value"]): 420 | { 421 | path = concat(item["path"], [key]), 422 | value = item["value"][key] 423 | } 424 | if item["value"][key] != null && can(keys(item["value"][key])) 425 | ] 426 | ]...) 427 | } 428 | ] 429 | mod15 = [ 430 | for map_idx in range(0, length(local.input_maps)): 431 | { 432 | fields = concat([], [ 433 | for item in local.mod14[map_idx].remaining: 434 | [ 435 | for key in keys(item["value"]): 436 | { 437 | key = jsonencode(concat(item["path"], [key])), 438 | path = concat(item["path"], [key]), 439 | value = item["value"][key], 440 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 441 | } 442 | ] 443 | ]...) 444 | remaining = concat([], [ 445 | for item in local.mod14[map_idx].remaining: 446 | [ 447 | for key in keys(item["value"]): 448 | { 449 | path = concat(item["path"], [key]), 450 | value = item["value"][key] 451 | } 452 | if item["value"][key] != null && can(keys(item["value"][key])) 453 | ] 454 | ]...) 455 | } 456 | ] 457 | mod16 = [ 458 | for map_idx in range(0, length(local.input_maps)): 459 | { 460 | fields = concat([], [ 461 | for item in local.mod15[map_idx].remaining: 462 | [ 463 | for key in keys(item["value"]): 464 | { 465 | key = jsonencode(concat(item["path"], [key])), 466 | path = concat(item["path"], [key]), 467 | value = item["value"][key], 468 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 469 | } 470 | ] 471 | ]...) 472 | remaining = concat([], [ 473 | for item in local.mod15[map_idx].remaining: 474 | [ 475 | for key in keys(item["value"]): 476 | { 477 | path = concat(item["path"], [key]), 478 | value = item["value"][key] 479 | } 480 | if item["value"][key] != null && can(keys(item["value"][key])) 481 | ] 482 | ]...) 483 | } 484 | ] 485 | mod17 = [ 486 | for map_idx in range(0, length(local.input_maps)): 487 | { 488 | fields = concat([], [ 489 | for item in local.mod16[map_idx].remaining: 490 | [ 491 | for key in keys(item["value"]): 492 | { 493 | key = jsonencode(concat(item["path"], [key])), 494 | path = concat(item["path"], [key]), 495 | value = item["value"][key], 496 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 497 | } 498 | ] 499 | ]...) 500 | remaining = concat([], [ 501 | for item in local.mod16[map_idx].remaining: 502 | [ 503 | for key in keys(item["value"]): 504 | { 505 | path = concat(item["path"], [key]), 506 | value = item["value"][key] 507 | } 508 | if item["value"][key] != null && can(keys(item["value"][key])) 509 | ] 510 | ]...) 511 | } 512 | ] 513 | mod18 = [ 514 | for map_idx in range(0, length(local.input_maps)): 515 | { 516 | fields = concat([], [ 517 | for item in local.mod17[map_idx].remaining: 518 | [ 519 | for key in keys(item["value"]): 520 | { 521 | key = jsonencode(concat(item["path"], [key])), 522 | path = concat(item["path"], [key]), 523 | value = item["value"][key], 524 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 525 | } 526 | ] 527 | ]...) 528 | remaining = concat([], [ 529 | for item in local.mod17[map_idx].remaining: 530 | [ 531 | for key in keys(item["value"]): 532 | { 533 | path = concat(item["path"], [key]), 534 | value = item["value"][key] 535 | } 536 | if item["value"][key] != null && can(keys(item["value"][key])) 537 | ] 538 | ]...) 539 | } 540 | ] 541 | mod19 = [ 542 | for map_idx in range(0, length(local.input_maps)): 543 | { 544 | fields = concat([], [ 545 | for item in local.mod18[map_idx].remaining: 546 | [ 547 | for key in keys(item["value"]): 548 | { 549 | key = jsonencode(concat(item["path"], [key])), 550 | path = concat(item["path"], [key]), 551 | value = item["value"][key], 552 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 553 | } 554 | ] 555 | ]...) 556 | remaining = concat([], [ 557 | for item in local.mod18[map_idx].remaining: 558 | [ 559 | for key in keys(item["value"]): 560 | { 561 | path = concat(item["path"], [key]), 562 | value = item["value"][key] 563 | } 564 | if item["value"][key] != null && can(keys(item["value"][key])) 565 | ] 566 | ]...) 567 | } 568 | ] 569 | mod20 = [ 570 | for map_idx in range(0, length(local.input_maps)): 571 | { 572 | fields = concat([], [ 573 | for item in local.mod19[map_idx].remaining: 574 | [ 575 | for key in keys(item["value"]): 576 | { 577 | key = jsonencode(concat(item["path"], [key])), 578 | path = concat(item["path"], [key]), 579 | value = item["value"][key], 580 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 581 | } 582 | ] 583 | ]...) 584 | remaining = concat([], [ 585 | for item in local.mod19[map_idx].remaining: 586 | [ 587 | for key in keys(item["value"]): 588 | { 589 | path = concat(item["path"], [key]), 590 | value = item["value"][key] 591 | } 592 | if item["value"][key] != null && can(keys(item["value"][key])) 593 | ] 594 | ]...) 595 | } 596 | ] 597 | mod21 = [ 598 | for map_idx in range(0, length(local.input_maps)): 599 | { 600 | fields = concat([], [ 601 | for item in local.mod20[map_idx].remaining: 602 | [ 603 | for key in keys(item["value"]): 604 | { 605 | key = jsonencode(concat(item["path"], [key])), 606 | path = concat(item["path"], [key]), 607 | value = item["value"][key], 608 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 609 | } 610 | ] 611 | ]...) 612 | remaining = concat([], [ 613 | for item in local.mod20[map_idx].remaining: 614 | [ 615 | for key in keys(item["value"]): 616 | { 617 | path = concat(item["path"], [key]), 618 | value = item["value"][key] 619 | } 620 | if item["value"][key] != null && can(keys(item["value"][key])) 621 | ] 622 | ]...) 623 | } 624 | ] 625 | mod22 = [ 626 | for map_idx in range(0, length(local.input_maps)): 627 | { 628 | fields = concat([], [ 629 | for item in local.mod21[map_idx].remaining: 630 | [ 631 | for key in keys(item["value"]): 632 | { 633 | key = jsonencode(concat(item["path"], [key])), 634 | path = concat(item["path"], [key]), 635 | value = item["value"][key], 636 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 637 | } 638 | ] 639 | ]...) 640 | remaining = concat([], [ 641 | for item in local.mod21[map_idx].remaining: 642 | [ 643 | for key in keys(item["value"]): 644 | { 645 | path = concat(item["path"], [key]), 646 | value = item["value"][key] 647 | } 648 | if item["value"][key] != null && can(keys(item["value"][key])) 649 | ] 650 | ]...) 651 | } 652 | ] 653 | mod23 = [ 654 | for map_idx in range(0, length(local.input_maps)): 655 | { 656 | fields = concat([], [ 657 | for item in local.mod22[map_idx].remaining: 658 | [ 659 | for key in keys(item["value"]): 660 | { 661 | key = jsonencode(concat(item["path"], [key])), 662 | path = concat(item["path"], [key]), 663 | value = item["value"][key], 664 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 665 | } 666 | ] 667 | ]...) 668 | remaining = concat([], [ 669 | for item in local.mod22[map_idx].remaining: 670 | [ 671 | for key in keys(item["value"]): 672 | { 673 | path = concat(item["path"], [key]), 674 | value = item["value"][key] 675 | } 676 | if item["value"][key] != null && can(keys(item["value"][key])) 677 | ] 678 | ]...) 679 | } 680 | ] 681 | mod24 = [ 682 | for map_idx in range(0, length(local.input_maps)): 683 | { 684 | fields = concat([], [ 685 | for item in local.mod23[map_idx].remaining: 686 | [ 687 | for key in keys(item["value"]): 688 | { 689 | key = jsonencode(concat(item["path"], [key])), 690 | path = concat(item["path"], [key]), 691 | value = item["value"][key], 692 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 693 | } 694 | ] 695 | ]...) 696 | remaining = concat([], [ 697 | for item in local.mod23[map_idx].remaining: 698 | [ 699 | for key in keys(item["value"]): 700 | { 701 | path = concat(item["path"], [key]), 702 | value = item["value"][key] 703 | } 704 | if item["value"][key] != null && can(keys(item["value"][key])) 705 | ] 706 | ]...) 707 | } 708 | ] 709 | mod25 = [ 710 | for map_idx in range(0, length(local.input_maps)): 711 | { 712 | fields = concat([], [ 713 | for item in local.mod24[map_idx].remaining: 714 | [ 715 | for key in keys(item["value"]): 716 | { 717 | key = jsonencode(concat(item["path"], [key])), 718 | path = concat(item["path"], [key]), 719 | value = item["value"][key], 720 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 721 | } 722 | ] 723 | ]...) 724 | remaining = concat([], [ 725 | for item in local.mod24[map_idx].remaining: 726 | [ 727 | for key in keys(item["value"]): 728 | { 729 | path = concat(item["path"], [key]), 730 | value = item["value"][key] 731 | } 732 | if item["value"][key] != null && can(keys(item["value"][key])) 733 | ] 734 | ]...) 735 | } 736 | ] 737 | mod26 = [ 738 | for map_idx in range(0, length(local.input_maps)): 739 | { 740 | fields = concat([], [ 741 | for item in local.mod25[map_idx].remaining: 742 | [ 743 | for key in keys(item["value"]): 744 | { 745 | key = jsonencode(concat(item["path"], [key])), 746 | path = concat(item["path"], [key]), 747 | value = item["value"][key], 748 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 749 | } 750 | ] 751 | ]...) 752 | remaining = concat([], [ 753 | for item in local.mod25[map_idx].remaining: 754 | [ 755 | for key in keys(item["value"]): 756 | { 757 | path = concat(item["path"], [key]), 758 | value = item["value"][key] 759 | } 760 | if item["value"][key] != null && can(keys(item["value"][key])) 761 | ] 762 | ]...) 763 | } 764 | ] 765 | mod27 = [ 766 | for map_idx in range(0, length(local.input_maps)): 767 | { 768 | fields = concat([], [ 769 | for item in local.mod26[map_idx].remaining: 770 | [ 771 | for key in keys(item["value"]): 772 | { 773 | key = jsonencode(concat(item["path"], [key])), 774 | path = concat(item["path"], [key]), 775 | value = item["value"][key], 776 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 777 | } 778 | ] 779 | ]...) 780 | remaining = concat([], [ 781 | for item in local.mod26[map_idx].remaining: 782 | [ 783 | for key in keys(item["value"]): 784 | { 785 | path = concat(item["path"], [key]), 786 | value = item["value"][key] 787 | } 788 | if item["value"][key] != null && can(keys(item["value"][key])) 789 | ] 790 | ]...) 791 | } 792 | ] 793 | mod28 = [ 794 | for map_idx in range(0, length(local.input_maps)): 795 | { 796 | fields = concat([], [ 797 | for item in local.mod27[map_idx].remaining: 798 | [ 799 | for key in keys(item["value"]): 800 | { 801 | key = jsonencode(concat(item["path"], [key])), 802 | path = concat(item["path"], [key]), 803 | value = item["value"][key], 804 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 805 | } 806 | ] 807 | ]...) 808 | remaining = concat([], [ 809 | for item in local.mod27[map_idx].remaining: 810 | [ 811 | for key in keys(item["value"]): 812 | { 813 | path = concat(item["path"], [key]), 814 | value = item["value"][key] 815 | } 816 | if item["value"][key] != null && can(keys(item["value"][key])) 817 | ] 818 | ]...) 819 | } 820 | ] 821 | mod29 = [ 822 | for map_idx in range(0, length(local.input_maps)): 823 | { 824 | fields = concat([], [ 825 | for item in local.mod28[map_idx].remaining: 826 | [ 827 | for key in keys(item["value"]): 828 | { 829 | key = jsonencode(concat(item["path"], [key])), 830 | path = concat(item["path"], [key]), 831 | value = item["value"][key], 832 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 833 | } 834 | ] 835 | ]...) 836 | remaining = concat([], [ 837 | for item in local.mod28[map_idx].remaining: 838 | [ 839 | for key in keys(item["value"]): 840 | { 841 | path = concat(item["path"], [key]), 842 | value = item["value"][key] 843 | } 844 | if item["value"][key] != null && can(keys(item["value"][key])) 845 | ] 846 | ]...) 847 | } 848 | ] 849 | mod30 = [ 850 | for map_idx in range(0, length(local.input_maps)): 851 | { 852 | fields = concat([], [ 853 | for item in local.mod29[map_idx].remaining: 854 | [ 855 | for key in keys(item["value"]): 856 | { 857 | key = jsonencode(concat(item["path"], [key])), 858 | path = concat(item["path"], [key]), 859 | value = item["value"][key], 860 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 861 | } 862 | ] 863 | ]...) 864 | remaining = concat([], [ 865 | for item in local.mod29[map_idx].remaining: 866 | [ 867 | for key in keys(item["value"]): 868 | { 869 | path = concat(item["path"], [key]), 870 | value = item["value"][key] 871 | } 872 | if item["value"][key] != null && can(keys(item["value"][key])) 873 | ] 874 | ]...) 875 | } 876 | ] 877 | mod31 = [ 878 | for map_idx in range(0, length(local.input_maps)): 879 | { 880 | fields = concat([], [ 881 | for item in local.mod30[map_idx].remaining: 882 | [ 883 | for key in keys(item["value"]): 884 | { 885 | key = jsonencode(concat(item["path"], [key])), 886 | path = concat(item["path"], [key]), 887 | value = item["value"][key], 888 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 889 | } 890 | ] 891 | ]...) 892 | remaining = concat([], [ 893 | for item in local.mod30[map_idx].remaining: 894 | [ 895 | for key in keys(item["value"]): 896 | { 897 | path = concat(item["path"], [key]), 898 | value = item["value"][key] 899 | } 900 | if item["value"][key] != null && can(keys(item["value"][key])) 901 | ] 902 | ]...) 903 | } 904 | ] 905 | mod32 = [ 906 | for map_idx in range(0, length(local.input_maps)): 907 | { 908 | fields = concat([], [ 909 | for item in local.mod31[map_idx].remaining: 910 | [ 911 | for key in keys(item["value"]): 912 | { 913 | key = jsonencode(concat(item["path"], [key])), 914 | path = concat(item["path"], [key]), 915 | value = item["value"][key], 916 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 917 | } 918 | ] 919 | ]...) 920 | remaining = concat([], [ 921 | for item in local.mod31[map_idx].remaining: 922 | [ 923 | for key in keys(item["value"]): 924 | { 925 | path = concat(item["path"], [key]), 926 | value = item["value"][key] 927 | } 928 | if item["value"][key] != null && can(keys(item["value"][key])) 929 | ] 930 | ]...) 931 | } 932 | ] 933 | mod33 = [ 934 | for map_idx in range(0, length(local.input_maps)): 935 | { 936 | fields = concat([], [ 937 | for item in local.mod32[map_idx].remaining: 938 | [ 939 | for key in keys(item["value"]): 940 | { 941 | key = jsonencode(concat(item["path"], [key])), 942 | path = concat(item["path"], [key]), 943 | value = item["value"][key], 944 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 945 | } 946 | ] 947 | ]...) 948 | remaining = concat([], [ 949 | for item in local.mod32[map_idx].remaining: 950 | [ 951 | for key in keys(item["value"]): 952 | { 953 | path = concat(item["path"], [key]), 954 | value = item["value"][key] 955 | } 956 | if item["value"][key] != null && can(keys(item["value"][key])) 957 | ] 958 | ]...) 959 | } 960 | ] 961 | mod34 = [ 962 | for map_idx in range(0, length(local.input_maps)): 963 | { 964 | fields = concat([], [ 965 | for item in local.mod33[map_idx].remaining: 966 | [ 967 | for key in keys(item["value"]): 968 | { 969 | key = jsonencode(concat(item["path"], [key])), 970 | path = concat(item["path"], [key]), 971 | value = item["value"][key], 972 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 973 | } 974 | ] 975 | ]...) 976 | remaining = concat([], [ 977 | for item in local.mod33[map_idx].remaining: 978 | [ 979 | for key in keys(item["value"]): 980 | { 981 | path = concat(item["path"], [key]), 982 | value = item["value"][key] 983 | } 984 | if item["value"][key] != null && can(keys(item["value"][key])) 985 | ] 986 | ]...) 987 | } 988 | ] 989 | mod35 = [ 990 | for map_idx in range(0, length(local.input_maps)): 991 | { 992 | fields = concat([], [ 993 | for item in local.mod34[map_idx].remaining: 994 | [ 995 | for key in keys(item["value"]): 996 | { 997 | key = jsonencode(concat(item["path"], [key])), 998 | path = concat(item["path"], [key]), 999 | value = item["value"][key], 1000 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1001 | } 1002 | ] 1003 | ]...) 1004 | remaining = concat([], [ 1005 | for item in local.mod34[map_idx].remaining: 1006 | [ 1007 | for key in keys(item["value"]): 1008 | { 1009 | path = concat(item["path"], [key]), 1010 | value = item["value"][key] 1011 | } 1012 | if item["value"][key] != null && can(keys(item["value"][key])) 1013 | ] 1014 | ]...) 1015 | } 1016 | ] 1017 | mod36 = [ 1018 | for map_idx in range(0, length(local.input_maps)): 1019 | { 1020 | fields = concat([], [ 1021 | for item in local.mod35[map_idx].remaining: 1022 | [ 1023 | for key in keys(item["value"]): 1024 | { 1025 | key = jsonencode(concat(item["path"], [key])), 1026 | path = concat(item["path"], [key]), 1027 | value = item["value"][key], 1028 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1029 | } 1030 | ] 1031 | ]...) 1032 | remaining = concat([], [ 1033 | for item in local.mod35[map_idx].remaining: 1034 | [ 1035 | for key in keys(item["value"]): 1036 | { 1037 | path = concat(item["path"], [key]), 1038 | value = item["value"][key] 1039 | } 1040 | if item["value"][key] != null && can(keys(item["value"][key])) 1041 | ] 1042 | ]...) 1043 | } 1044 | ] 1045 | mod37 = [ 1046 | for map_idx in range(0, length(local.input_maps)): 1047 | { 1048 | fields = concat([], [ 1049 | for item in local.mod36[map_idx].remaining: 1050 | [ 1051 | for key in keys(item["value"]): 1052 | { 1053 | key = jsonencode(concat(item["path"], [key])), 1054 | path = concat(item["path"], [key]), 1055 | value = item["value"][key], 1056 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1057 | } 1058 | ] 1059 | ]...) 1060 | remaining = concat([], [ 1061 | for item in local.mod36[map_idx].remaining: 1062 | [ 1063 | for key in keys(item["value"]): 1064 | { 1065 | path = concat(item["path"], [key]), 1066 | value = item["value"][key] 1067 | } 1068 | if item["value"][key] != null && can(keys(item["value"][key])) 1069 | ] 1070 | ]...) 1071 | } 1072 | ] 1073 | mod38 = [ 1074 | for map_idx in range(0, length(local.input_maps)): 1075 | { 1076 | fields = concat([], [ 1077 | for item in local.mod37[map_idx].remaining: 1078 | [ 1079 | for key in keys(item["value"]): 1080 | { 1081 | key = jsonencode(concat(item["path"], [key])), 1082 | path = concat(item["path"], [key]), 1083 | value = item["value"][key], 1084 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1085 | } 1086 | ] 1087 | ]...) 1088 | remaining = concat([], [ 1089 | for item in local.mod37[map_idx].remaining: 1090 | [ 1091 | for key in keys(item["value"]): 1092 | { 1093 | path = concat(item["path"], [key]), 1094 | value = item["value"][key] 1095 | } 1096 | if item["value"][key] != null && can(keys(item["value"][key])) 1097 | ] 1098 | ]...) 1099 | } 1100 | ] 1101 | mod39 = [ 1102 | for map_idx in range(0, length(local.input_maps)): 1103 | { 1104 | fields = concat([], [ 1105 | for item in local.mod38[map_idx].remaining: 1106 | [ 1107 | for key in keys(item["value"]): 1108 | { 1109 | key = jsonencode(concat(item["path"], [key])), 1110 | path = concat(item["path"], [key]), 1111 | value = item["value"][key], 1112 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1113 | } 1114 | ] 1115 | ]...) 1116 | remaining = concat([], [ 1117 | for item in local.mod38[map_idx].remaining: 1118 | [ 1119 | for key in keys(item["value"]): 1120 | { 1121 | path = concat(item["path"], [key]), 1122 | value = item["value"][key] 1123 | } 1124 | if item["value"][key] != null && can(keys(item["value"][key])) 1125 | ] 1126 | ]...) 1127 | } 1128 | ] 1129 | mod40 = [ 1130 | for map_idx in range(0, length(local.input_maps)): 1131 | { 1132 | fields = concat([], [ 1133 | for item in local.mod39[map_idx].remaining: 1134 | [ 1135 | for key in keys(item["value"]): 1136 | { 1137 | key = jsonencode(concat(item["path"], [key])), 1138 | path = concat(item["path"], [key]), 1139 | value = item["value"][key], 1140 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1141 | } 1142 | ] 1143 | ]...) 1144 | remaining = concat([], [ 1145 | for item in local.mod39[map_idx].remaining: 1146 | [ 1147 | for key in keys(item["value"]): 1148 | { 1149 | path = concat(item["path"], [key]), 1150 | value = item["value"][key] 1151 | } 1152 | if item["value"][key] != null && can(keys(item["value"][key])) 1153 | ] 1154 | ]...) 1155 | } 1156 | ] 1157 | mod41 = [ 1158 | for map_idx in range(0, length(local.input_maps)): 1159 | { 1160 | fields = concat([], [ 1161 | for item in local.mod40[map_idx].remaining: 1162 | [ 1163 | for key in keys(item["value"]): 1164 | { 1165 | key = jsonencode(concat(item["path"], [key])), 1166 | path = concat(item["path"], [key]), 1167 | value = item["value"][key], 1168 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1169 | } 1170 | ] 1171 | ]...) 1172 | remaining = concat([], [ 1173 | for item in local.mod40[map_idx].remaining: 1174 | [ 1175 | for key in keys(item["value"]): 1176 | { 1177 | path = concat(item["path"], [key]), 1178 | value = item["value"][key] 1179 | } 1180 | if item["value"][key] != null && can(keys(item["value"][key])) 1181 | ] 1182 | ]...) 1183 | } 1184 | ] 1185 | mod42 = [ 1186 | for map_idx in range(0, length(local.input_maps)): 1187 | { 1188 | fields = concat([], [ 1189 | for item in local.mod41[map_idx].remaining: 1190 | [ 1191 | for key in keys(item["value"]): 1192 | { 1193 | key = jsonencode(concat(item["path"], [key])), 1194 | path = concat(item["path"], [key]), 1195 | value = item["value"][key], 1196 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1197 | } 1198 | ] 1199 | ]...) 1200 | remaining = concat([], [ 1201 | for item in local.mod41[map_idx].remaining: 1202 | [ 1203 | for key in keys(item["value"]): 1204 | { 1205 | path = concat(item["path"], [key]), 1206 | value = item["value"][key] 1207 | } 1208 | if item["value"][key] != null && can(keys(item["value"][key])) 1209 | ] 1210 | ]...) 1211 | } 1212 | ] 1213 | mod43 = [ 1214 | for map_idx in range(0, length(local.input_maps)): 1215 | { 1216 | fields = concat([], [ 1217 | for item in local.mod42[map_idx].remaining: 1218 | [ 1219 | for key in keys(item["value"]): 1220 | { 1221 | key = jsonencode(concat(item["path"], [key])), 1222 | path = concat(item["path"], [key]), 1223 | value = item["value"][key], 1224 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1225 | } 1226 | ] 1227 | ]...) 1228 | remaining = concat([], [ 1229 | for item in local.mod42[map_idx].remaining: 1230 | [ 1231 | for key in keys(item["value"]): 1232 | { 1233 | path = concat(item["path"], [key]), 1234 | value = item["value"][key] 1235 | } 1236 | if item["value"][key] != null && can(keys(item["value"][key])) 1237 | ] 1238 | ]...) 1239 | } 1240 | ] 1241 | mod44 = [ 1242 | for map_idx in range(0, length(local.input_maps)): 1243 | { 1244 | fields = concat([], [ 1245 | for item in local.mod43[map_idx].remaining: 1246 | [ 1247 | for key in keys(item["value"]): 1248 | { 1249 | key = jsonencode(concat(item["path"], [key])), 1250 | path = concat(item["path"], [key]), 1251 | value = item["value"][key], 1252 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1253 | } 1254 | ] 1255 | ]...) 1256 | remaining = concat([], [ 1257 | for item in local.mod43[map_idx].remaining: 1258 | [ 1259 | for key in keys(item["value"]): 1260 | { 1261 | path = concat(item["path"], [key]), 1262 | value = item["value"][key] 1263 | } 1264 | if item["value"][key] != null && can(keys(item["value"][key])) 1265 | ] 1266 | ]...) 1267 | } 1268 | ] 1269 | mod45 = [ 1270 | for map_idx in range(0, length(local.input_maps)): 1271 | { 1272 | fields = concat([], [ 1273 | for item in local.mod44[map_idx].remaining: 1274 | [ 1275 | for key in keys(item["value"]): 1276 | { 1277 | key = jsonencode(concat(item["path"], [key])), 1278 | path = concat(item["path"], [key]), 1279 | value = item["value"][key], 1280 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1281 | } 1282 | ] 1283 | ]...) 1284 | remaining = concat([], [ 1285 | for item in local.mod44[map_idx].remaining: 1286 | [ 1287 | for key in keys(item["value"]): 1288 | { 1289 | path = concat(item["path"], [key]), 1290 | value = item["value"][key] 1291 | } 1292 | if item["value"][key] != null && can(keys(item["value"][key])) 1293 | ] 1294 | ]...) 1295 | } 1296 | ] 1297 | mod46 = [ 1298 | for map_idx in range(0, length(local.input_maps)): 1299 | { 1300 | fields = concat([], [ 1301 | for item in local.mod45[map_idx].remaining: 1302 | [ 1303 | for key in keys(item["value"]): 1304 | { 1305 | key = jsonencode(concat(item["path"], [key])), 1306 | path = concat(item["path"], [key]), 1307 | value = item["value"][key], 1308 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1309 | } 1310 | ] 1311 | ]...) 1312 | remaining = concat([], [ 1313 | for item in local.mod45[map_idx].remaining: 1314 | [ 1315 | for key in keys(item["value"]): 1316 | { 1317 | path = concat(item["path"], [key]), 1318 | value = item["value"][key] 1319 | } 1320 | if item["value"][key] != null && can(keys(item["value"][key])) 1321 | ] 1322 | ]...) 1323 | } 1324 | ] 1325 | mod47 = [ 1326 | for map_idx in range(0, length(local.input_maps)): 1327 | { 1328 | fields = concat([], [ 1329 | for item in local.mod46[map_idx].remaining: 1330 | [ 1331 | for key in keys(item["value"]): 1332 | { 1333 | key = jsonencode(concat(item["path"], [key])), 1334 | path = concat(item["path"], [key]), 1335 | value = item["value"][key], 1336 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1337 | } 1338 | ] 1339 | ]...) 1340 | remaining = concat([], [ 1341 | for item in local.mod46[map_idx].remaining: 1342 | [ 1343 | for key in keys(item["value"]): 1344 | { 1345 | path = concat(item["path"], [key]), 1346 | value = item["value"][key] 1347 | } 1348 | if item["value"][key] != null && can(keys(item["value"][key])) 1349 | ] 1350 | ]...) 1351 | } 1352 | ] 1353 | mod48 = [ 1354 | for map_idx in range(0, length(local.input_maps)): 1355 | { 1356 | fields = concat([], [ 1357 | for item in local.mod47[map_idx].remaining: 1358 | [ 1359 | for key in keys(item["value"]): 1360 | { 1361 | key = jsonencode(concat(item["path"], [key])), 1362 | path = concat(item["path"], [key]), 1363 | value = item["value"][key], 1364 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1365 | } 1366 | ] 1367 | ]...) 1368 | remaining = concat([], [ 1369 | for item in local.mod47[map_idx].remaining: 1370 | [ 1371 | for key in keys(item["value"]): 1372 | { 1373 | path = concat(item["path"], [key]), 1374 | value = item["value"][key] 1375 | } 1376 | if item["value"][key] != null && can(keys(item["value"][key])) 1377 | ] 1378 | ]...) 1379 | } 1380 | ] 1381 | mod49 = [ 1382 | for map_idx in range(0, length(local.input_maps)): 1383 | { 1384 | fields = concat([], [ 1385 | for item in local.mod48[map_idx].remaining: 1386 | [ 1387 | for key in keys(item["value"]): 1388 | { 1389 | key = jsonencode(concat(item["path"], [key])), 1390 | path = concat(item["path"], [key]), 1391 | value = item["value"][key], 1392 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1393 | } 1394 | ] 1395 | ]...) 1396 | remaining = concat([], [ 1397 | for item in local.mod48[map_idx].remaining: 1398 | [ 1399 | for key in keys(item["value"]): 1400 | { 1401 | path = concat(item["path"], [key]), 1402 | value = item["value"][key] 1403 | } 1404 | if item["value"][key] != null && can(keys(item["value"][key])) 1405 | ] 1406 | ]...) 1407 | } 1408 | ] 1409 | mod50 = [ 1410 | for map_idx in range(0, length(local.input_maps)): 1411 | { 1412 | fields = concat([], [ 1413 | for item in local.mod49[map_idx].remaining: 1414 | [ 1415 | for key in keys(item["value"]): 1416 | { 1417 | key = jsonencode(concat(item["path"], [key])), 1418 | path = concat(item["path"], [key]), 1419 | value = item["value"][key], 1420 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1421 | } 1422 | ] 1423 | ]...) 1424 | remaining = concat([], [ 1425 | for item in local.mod49[map_idx].remaining: 1426 | [ 1427 | for key in keys(item["value"]): 1428 | { 1429 | path = concat(item["path"], [key]), 1430 | value = item["value"][key] 1431 | } 1432 | if item["value"][key] != null && can(keys(item["value"][key])) 1433 | ] 1434 | ]...) 1435 | } 1436 | ] 1437 | mod51 = [ 1438 | for map_idx in range(0, length(local.input_maps)): 1439 | { 1440 | fields = concat([], [ 1441 | for item in local.mod50[map_idx].remaining: 1442 | [ 1443 | for key in keys(item["value"]): 1444 | { 1445 | key = jsonencode(concat(item["path"], [key])), 1446 | path = concat(item["path"], [key]), 1447 | value = item["value"][key], 1448 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1449 | } 1450 | ] 1451 | ]...) 1452 | remaining = concat([], [ 1453 | for item in local.mod50[map_idx].remaining: 1454 | [ 1455 | for key in keys(item["value"]): 1456 | { 1457 | path = concat(item["path"], [key]), 1458 | value = item["value"][key] 1459 | } 1460 | if item["value"][key] != null && can(keys(item["value"][key])) 1461 | ] 1462 | ]...) 1463 | } 1464 | ] 1465 | mod52 = [ 1466 | for map_idx in range(0, length(local.input_maps)): 1467 | { 1468 | fields = concat([], [ 1469 | for item in local.mod51[map_idx].remaining: 1470 | [ 1471 | for key in keys(item["value"]): 1472 | { 1473 | key = jsonencode(concat(item["path"], [key])), 1474 | path = concat(item["path"], [key]), 1475 | value = item["value"][key], 1476 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1477 | } 1478 | ] 1479 | ]...) 1480 | remaining = concat([], [ 1481 | for item in local.mod51[map_idx].remaining: 1482 | [ 1483 | for key in keys(item["value"]): 1484 | { 1485 | path = concat(item["path"], [key]), 1486 | value = item["value"][key] 1487 | } 1488 | if item["value"][key] != null && can(keys(item["value"][key])) 1489 | ] 1490 | ]...) 1491 | } 1492 | ] 1493 | mod53 = [ 1494 | for map_idx in range(0, length(local.input_maps)): 1495 | { 1496 | fields = concat([], [ 1497 | for item in local.mod52[map_idx].remaining: 1498 | [ 1499 | for key in keys(item["value"]): 1500 | { 1501 | key = jsonencode(concat(item["path"], [key])), 1502 | path = concat(item["path"], [key]), 1503 | value = item["value"][key], 1504 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1505 | } 1506 | ] 1507 | ]...) 1508 | remaining = concat([], [ 1509 | for item in local.mod52[map_idx].remaining: 1510 | [ 1511 | for key in keys(item["value"]): 1512 | { 1513 | path = concat(item["path"], [key]), 1514 | value = item["value"][key] 1515 | } 1516 | if item["value"][key] != null && can(keys(item["value"][key])) 1517 | ] 1518 | ]...) 1519 | } 1520 | ] 1521 | mod54 = [ 1522 | for map_idx in range(0, length(local.input_maps)): 1523 | { 1524 | fields = concat([], [ 1525 | for item in local.mod53[map_idx].remaining: 1526 | [ 1527 | for key in keys(item["value"]): 1528 | { 1529 | key = jsonencode(concat(item["path"], [key])), 1530 | path = concat(item["path"], [key]), 1531 | value = item["value"][key], 1532 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1533 | } 1534 | ] 1535 | ]...) 1536 | remaining = concat([], [ 1537 | for item in local.mod53[map_idx].remaining: 1538 | [ 1539 | for key in keys(item["value"]): 1540 | { 1541 | path = concat(item["path"], [key]), 1542 | value = item["value"][key] 1543 | } 1544 | if item["value"][key] != null && can(keys(item["value"][key])) 1545 | ] 1546 | ]...) 1547 | } 1548 | ] 1549 | mod55 = [ 1550 | for map_idx in range(0, length(local.input_maps)): 1551 | { 1552 | fields = concat([], [ 1553 | for item in local.mod54[map_idx].remaining: 1554 | [ 1555 | for key in keys(item["value"]): 1556 | { 1557 | key = jsonencode(concat(item["path"], [key])), 1558 | path = concat(item["path"], [key]), 1559 | value = item["value"][key], 1560 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1561 | } 1562 | ] 1563 | ]...) 1564 | remaining = concat([], [ 1565 | for item in local.mod54[map_idx].remaining: 1566 | [ 1567 | for key in keys(item["value"]): 1568 | { 1569 | path = concat(item["path"], [key]), 1570 | value = item["value"][key] 1571 | } 1572 | if item["value"][key] != null && can(keys(item["value"][key])) 1573 | ] 1574 | ]...) 1575 | } 1576 | ] 1577 | mod56 = [ 1578 | for map_idx in range(0, length(local.input_maps)): 1579 | { 1580 | fields = concat([], [ 1581 | for item in local.mod55[map_idx].remaining: 1582 | [ 1583 | for key in keys(item["value"]): 1584 | { 1585 | key = jsonencode(concat(item["path"], [key])), 1586 | path = concat(item["path"], [key]), 1587 | value = item["value"][key], 1588 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1589 | } 1590 | ] 1591 | ]...) 1592 | remaining = concat([], [ 1593 | for item in local.mod55[map_idx].remaining: 1594 | [ 1595 | for key in keys(item["value"]): 1596 | { 1597 | path = concat(item["path"], [key]), 1598 | value = item["value"][key] 1599 | } 1600 | if item["value"][key] != null && can(keys(item["value"][key])) 1601 | ] 1602 | ]...) 1603 | } 1604 | ] 1605 | mod57 = [ 1606 | for map_idx in range(0, length(local.input_maps)): 1607 | { 1608 | fields = concat([], [ 1609 | for item in local.mod56[map_idx].remaining: 1610 | [ 1611 | for key in keys(item["value"]): 1612 | { 1613 | key = jsonencode(concat(item["path"], [key])), 1614 | path = concat(item["path"], [key]), 1615 | value = item["value"][key], 1616 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1617 | } 1618 | ] 1619 | ]...) 1620 | remaining = concat([], [ 1621 | for item in local.mod56[map_idx].remaining: 1622 | [ 1623 | for key in keys(item["value"]): 1624 | { 1625 | path = concat(item["path"], [key]), 1626 | value = item["value"][key] 1627 | } 1628 | if item["value"][key] != null && can(keys(item["value"][key])) 1629 | ] 1630 | ]...) 1631 | } 1632 | ] 1633 | mod58 = [ 1634 | for map_idx in range(0, length(local.input_maps)): 1635 | { 1636 | fields = concat([], [ 1637 | for item in local.mod57[map_idx].remaining: 1638 | [ 1639 | for key in keys(item["value"]): 1640 | { 1641 | key = jsonencode(concat(item["path"], [key])), 1642 | path = concat(item["path"], [key]), 1643 | value = item["value"][key], 1644 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1645 | } 1646 | ] 1647 | ]...) 1648 | remaining = concat([], [ 1649 | for item in local.mod57[map_idx].remaining: 1650 | [ 1651 | for key in keys(item["value"]): 1652 | { 1653 | path = concat(item["path"], [key]), 1654 | value = item["value"][key] 1655 | } 1656 | if item["value"][key] != null && can(keys(item["value"][key])) 1657 | ] 1658 | ]...) 1659 | } 1660 | ] 1661 | mod59 = [ 1662 | for map_idx in range(0, length(local.input_maps)): 1663 | { 1664 | fields = concat([], [ 1665 | for item in local.mod58[map_idx].remaining: 1666 | [ 1667 | for key in keys(item["value"]): 1668 | { 1669 | key = jsonencode(concat(item["path"], [key])), 1670 | path = concat(item["path"], [key]), 1671 | value = item["value"][key], 1672 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1673 | } 1674 | ] 1675 | ]...) 1676 | remaining = concat([], [ 1677 | for item in local.mod58[map_idx].remaining: 1678 | [ 1679 | for key in keys(item["value"]): 1680 | { 1681 | path = concat(item["path"], [key]), 1682 | value = item["value"][key] 1683 | } 1684 | if item["value"][key] != null && can(keys(item["value"][key])) 1685 | ] 1686 | ]...) 1687 | } 1688 | ] 1689 | mod60 = [ 1690 | for map_idx in range(0, length(local.input_maps)): 1691 | { 1692 | fields = concat([], [ 1693 | for item in local.mod59[map_idx].remaining: 1694 | [ 1695 | for key in keys(item["value"]): 1696 | { 1697 | key = jsonencode(concat(item["path"], [key])), 1698 | path = concat(item["path"], [key]), 1699 | value = item["value"][key], 1700 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1701 | } 1702 | ] 1703 | ]...) 1704 | remaining = concat([], [ 1705 | for item in local.mod59[map_idx].remaining: 1706 | [ 1707 | for key in keys(item["value"]): 1708 | { 1709 | path = concat(item["path"], [key]), 1710 | value = item["value"][key] 1711 | } 1712 | if item["value"][key] != null && can(keys(item["value"][key])) 1713 | ] 1714 | ]...) 1715 | } 1716 | ] 1717 | mod61 = [ 1718 | for map_idx in range(0, length(local.input_maps)): 1719 | { 1720 | fields = concat([], [ 1721 | for item in local.mod60[map_idx].remaining: 1722 | [ 1723 | for key in keys(item["value"]): 1724 | { 1725 | key = jsonencode(concat(item["path"], [key])), 1726 | path = concat(item["path"], [key]), 1727 | value = item["value"][key], 1728 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1729 | } 1730 | ] 1731 | ]...) 1732 | remaining = concat([], [ 1733 | for item in local.mod60[map_idx].remaining: 1734 | [ 1735 | for key in keys(item["value"]): 1736 | { 1737 | path = concat(item["path"], [key]), 1738 | value = item["value"][key] 1739 | } 1740 | if item["value"][key] != null && can(keys(item["value"][key])) 1741 | ] 1742 | ]...) 1743 | } 1744 | ] 1745 | mod62 = [ 1746 | for map_idx in range(0, length(local.input_maps)): 1747 | { 1748 | fields = concat([], [ 1749 | for item in local.mod61[map_idx].remaining: 1750 | [ 1751 | for key in keys(item["value"]): 1752 | { 1753 | key = jsonencode(concat(item["path"], [key])), 1754 | path = concat(item["path"], [key]), 1755 | value = item["value"][key], 1756 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1757 | } 1758 | ] 1759 | ]...) 1760 | remaining = concat([], [ 1761 | for item in local.mod61[map_idx].remaining: 1762 | [ 1763 | for key in keys(item["value"]): 1764 | { 1765 | path = concat(item["path"], [key]), 1766 | value = item["value"][key] 1767 | } 1768 | if item["value"][key] != null && can(keys(item["value"][key])) 1769 | ] 1770 | ]...) 1771 | } 1772 | ] 1773 | mod63 = [ 1774 | for map_idx in range(0, length(local.input_maps)): 1775 | { 1776 | fields = concat([], [ 1777 | for item in local.mod62[map_idx].remaining: 1778 | [ 1779 | for key in keys(item["value"]): 1780 | { 1781 | key = jsonencode(concat(item["path"], [key])), 1782 | path = concat(item["path"], [key]), 1783 | value = item["value"][key], 1784 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1785 | } 1786 | ] 1787 | ]...) 1788 | remaining = concat([], [ 1789 | for item in local.mod62[map_idx].remaining: 1790 | [ 1791 | for key in keys(item["value"]): 1792 | { 1793 | path = concat(item["path"], [key]), 1794 | value = item["value"][key] 1795 | } 1796 | if item["value"][key] != null && can(keys(item["value"][key])) 1797 | ] 1798 | ]...) 1799 | } 1800 | ] 1801 | mod64 = [ 1802 | for map_idx in range(0, length(local.input_maps)): 1803 | { 1804 | fields = concat([], [ 1805 | for item in local.mod63[map_idx].remaining: 1806 | [ 1807 | for key in keys(item["value"]): 1808 | { 1809 | key = jsonencode(concat(item["path"], [key])), 1810 | path = concat(item["path"], [key]), 1811 | value = item["value"][key], 1812 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1813 | } 1814 | ] 1815 | ]...) 1816 | remaining = concat([], [ 1817 | for item in local.mod63[map_idx].remaining: 1818 | [ 1819 | for key in keys(item["value"]): 1820 | { 1821 | path = concat(item["path"], [key]), 1822 | value = item["value"][key] 1823 | } 1824 | if item["value"][key] != null && can(keys(item["value"][key])) 1825 | ] 1826 | ]...) 1827 | } 1828 | ] 1829 | mod65 = [ 1830 | for map_idx in range(0, length(local.input_maps)): 1831 | { 1832 | fields = concat([], [ 1833 | for item in local.mod64[map_idx].remaining: 1834 | [ 1835 | for key in keys(item["value"]): 1836 | { 1837 | key = jsonencode(concat(item["path"], [key])), 1838 | path = concat(item["path"], [key]), 1839 | value = item["value"][key], 1840 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1841 | } 1842 | ] 1843 | ]...) 1844 | remaining = concat([], [ 1845 | for item in local.mod64[map_idx].remaining: 1846 | [ 1847 | for key in keys(item["value"]): 1848 | { 1849 | path = concat(item["path"], [key]), 1850 | value = item["value"][key] 1851 | } 1852 | if item["value"][key] != null && can(keys(item["value"][key])) 1853 | ] 1854 | ]...) 1855 | } 1856 | ] 1857 | mod66 = [ 1858 | for map_idx in range(0, length(local.input_maps)): 1859 | { 1860 | fields = concat([], [ 1861 | for item in local.mod65[map_idx].remaining: 1862 | [ 1863 | for key in keys(item["value"]): 1864 | { 1865 | key = jsonencode(concat(item["path"], [key])), 1866 | path = concat(item["path"], [key]), 1867 | value = item["value"][key], 1868 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1869 | } 1870 | ] 1871 | ]...) 1872 | remaining = concat([], [ 1873 | for item in local.mod65[map_idx].remaining: 1874 | [ 1875 | for key in keys(item["value"]): 1876 | { 1877 | path = concat(item["path"], [key]), 1878 | value = item["value"][key] 1879 | } 1880 | if item["value"][key] != null && can(keys(item["value"][key])) 1881 | ] 1882 | ]...) 1883 | } 1884 | ] 1885 | mod67 = [ 1886 | for map_idx in range(0, length(local.input_maps)): 1887 | { 1888 | fields = concat([], [ 1889 | for item in local.mod66[map_idx].remaining: 1890 | [ 1891 | for key in keys(item["value"]): 1892 | { 1893 | key = jsonencode(concat(item["path"], [key])), 1894 | path = concat(item["path"], [key]), 1895 | value = item["value"][key], 1896 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1897 | } 1898 | ] 1899 | ]...) 1900 | remaining = concat([], [ 1901 | for item in local.mod66[map_idx].remaining: 1902 | [ 1903 | for key in keys(item["value"]): 1904 | { 1905 | path = concat(item["path"], [key]), 1906 | value = item["value"][key] 1907 | } 1908 | if item["value"][key] != null && can(keys(item["value"][key])) 1909 | ] 1910 | ]...) 1911 | } 1912 | ] 1913 | mod68 = [ 1914 | for map_idx in range(0, length(local.input_maps)): 1915 | { 1916 | fields = concat([], [ 1917 | for item in local.mod67[map_idx].remaining: 1918 | [ 1919 | for key in keys(item["value"]): 1920 | { 1921 | key = jsonencode(concat(item["path"], [key])), 1922 | path = concat(item["path"], [key]), 1923 | value = item["value"][key], 1924 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1925 | } 1926 | ] 1927 | ]...) 1928 | remaining = concat([], [ 1929 | for item in local.mod67[map_idx].remaining: 1930 | [ 1931 | for key in keys(item["value"]): 1932 | { 1933 | path = concat(item["path"], [key]), 1934 | value = item["value"][key] 1935 | } 1936 | if item["value"][key] != null && can(keys(item["value"][key])) 1937 | ] 1938 | ]...) 1939 | } 1940 | ] 1941 | mod69 = [ 1942 | for map_idx in range(0, length(local.input_maps)): 1943 | { 1944 | fields = concat([], [ 1945 | for item in local.mod68[map_idx].remaining: 1946 | [ 1947 | for key in keys(item["value"]): 1948 | { 1949 | key = jsonencode(concat(item["path"], [key])), 1950 | path = concat(item["path"], [key]), 1951 | value = item["value"][key], 1952 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1953 | } 1954 | ] 1955 | ]...) 1956 | remaining = concat([], [ 1957 | for item in local.mod68[map_idx].remaining: 1958 | [ 1959 | for key in keys(item["value"]): 1960 | { 1961 | path = concat(item["path"], [key]), 1962 | value = item["value"][key] 1963 | } 1964 | if item["value"][key] != null && can(keys(item["value"][key])) 1965 | ] 1966 | ]...) 1967 | } 1968 | ] 1969 | mod70 = [ 1970 | for map_idx in range(0, length(local.input_maps)): 1971 | { 1972 | fields = concat([], [ 1973 | for item in local.mod69[map_idx].remaining: 1974 | [ 1975 | for key in keys(item["value"]): 1976 | { 1977 | key = jsonencode(concat(item["path"], [key])), 1978 | path = concat(item["path"], [key]), 1979 | value = item["value"][key], 1980 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 1981 | } 1982 | ] 1983 | ]...) 1984 | remaining = concat([], [ 1985 | for item in local.mod69[map_idx].remaining: 1986 | [ 1987 | for key in keys(item["value"]): 1988 | { 1989 | path = concat(item["path"], [key]), 1990 | value = item["value"][key] 1991 | } 1992 | if item["value"][key] != null && can(keys(item["value"][key])) 1993 | ] 1994 | ]...) 1995 | } 1996 | ] 1997 | mod71 = [ 1998 | for map_idx in range(0, length(local.input_maps)): 1999 | { 2000 | fields = concat([], [ 2001 | for item in local.mod70[map_idx].remaining: 2002 | [ 2003 | for key in keys(item["value"]): 2004 | { 2005 | key = jsonencode(concat(item["path"], [key])), 2006 | path = concat(item["path"], [key]), 2007 | value = item["value"][key], 2008 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2009 | } 2010 | ] 2011 | ]...) 2012 | remaining = concat([], [ 2013 | for item in local.mod70[map_idx].remaining: 2014 | [ 2015 | for key in keys(item["value"]): 2016 | { 2017 | path = concat(item["path"], [key]), 2018 | value = item["value"][key] 2019 | } 2020 | if item["value"][key] != null && can(keys(item["value"][key])) 2021 | ] 2022 | ]...) 2023 | } 2024 | ] 2025 | mod72 = [ 2026 | for map_idx in range(0, length(local.input_maps)): 2027 | { 2028 | fields = concat([], [ 2029 | for item in local.mod71[map_idx].remaining: 2030 | [ 2031 | for key in keys(item["value"]): 2032 | { 2033 | key = jsonencode(concat(item["path"], [key])), 2034 | path = concat(item["path"], [key]), 2035 | value = item["value"][key], 2036 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2037 | } 2038 | ] 2039 | ]...) 2040 | remaining = concat([], [ 2041 | for item in local.mod71[map_idx].remaining: 2042 | [ 2043 | for key in keys(item["value"]): 2044 | { 2045 | path = concat(item["path"], [key]), 2046 | value = item["value"][key] 2047 | } 2048 | if item["value"][key] != null && can(keys(item["value"][key])) 2049 | ] 2050 | ]...) 2051 | } 2052 | ] 2053 | mod73 = [ 2054 | for map_idx in range(0, length(local.input_maps)): 2055 | { 2056 | fields = concat([], [ 2057 | for item in local.mod72[map_idx].remaining: 2058 | [ 2059 | for key in keys(item["value"]): 2060 | { 2061 | key = jsonencode(concat(item["path"], [key])), 2062 | path = concat(item["path"], [key]), 2063 | value = item["value"][key], 2064 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2065 | } 2066 | ] 2067 | ]...) 2068 | remaining = concat([], [ 2069 | for item in local.mod72[map_idx].remaining: 2070 | [ 2071 | for key in keys(item["value"]): 2072 | { 2073 | path = concat(item["path"], [key]), 2074 | value = item["value"][key] 2075 | } 2076 | if item["value"][key] != null && can(keys(item["value"][key])) 2077 | ] 2078 | ]...) 2079 | } 2080 | ] 2081 | mod74 = [ 2082 | for map_idx in range(0, length(local.input_maps)): 2083 | { 2084 | fields = concat([], [ 2085 | for item in local.mod73[map_idx].remaining: 2086 | [ 2087 | for key in keys(item["value"]): 2088 | { 2089 | key = jsonencode(concat(item["path"], [key])), 2090 | path = concat(item["path"], [key]), 2091 | value = item["value"][key], 2092 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2093 | } 2094 | ] 2095 | ]...) 2096 | remaining = concat([], [ 2097 | for item in local.mod73[map_idx].remaining: 2098 | [ 2099 | for key in keys(item["value"]): 2100 | { 2101 | path = concat(item["path"], [key]), 2102 | value = item["value"][key] 2103 | } 2104 | if item["value"][key] != null && can(keys(item["value"][key])) 2105 | ] 2106 | ]...) 2107 | } 2108 | ] 2109 | mod75 = [ 2110 | for map_idx in range(0, length(local.input_maps)): 2111 | { 2112 | fields = concat([], [ 2113 | for item in local.mod74[map_idx].remaining: 2114 | [ 2115 | for key in keys(item["value"]): 2116 | { 2117 | key = jsonencode(concat(item["path"], [key])), 2118 | path = concat(item["path"], [key]), 2119 | value = item["value"][key], 2120 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2121 | } 2122 | ] 2123 | ]...) 2124 | remaining = concat([], [ 2125 | for item in local.mod74[map_idx].remaining: 2126 | [ 2127 | for key in keys(item["value"]): 2128 | { 2129 | path = concat(item["path"], [key]), 2130 | value = item["value"][key] 2131 | } 2132 | if item["value"][key] != null && can(keys(item["value"][key])) 2133 | ] 2134 | ]...) 2135 | } 2136 | ] 2137 | mod76 = [ 2138 | for map_idx in range(0, length(local.input_maps)): 2139 | { 2140 | fields = concat([], [ 2141 | for item in local.mod75[map_idx].remaining: 2142 | [ 2143 | for key in keys(item["value"]): 2144 | { 2145 | key = jsonencode(concat(item["path"], [key])), 2146 | path = concat(item["path"], [key]), 2147 | value = item["value"][key], 2148 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2149 | } 2150 | ] 2151 | ]...) 2152 | remaining = concat([], [ 2153 | for item in local.mod75[map_idx].remaining: 2154 | [ 2155 | for key in keys(item["value"]): 2156 | { 2157 | path = concat(item["path"], [key]), 2158 | value = item["value"][key] 2159 | } 2160 | if item["value"][key] != null && can(keys(item["value"][key])) 2161 | ] 2162 | ]...) 2163 | } 2164 | ] 2165 | mod77 = [ 2166 | for map_idx in range(0, length(local.input_maps)): 2167 | { 2168 | fields = concat([], [ 2169 | for item in local.mod76[map_idx].remaining: 2170 | [ 2171 | for key in keys(item["value"]): 2172 | { 2173 | key = jsonencode(concat(item["path"], [key])), 2174 | path = concat(item["path"], [key]), 2175 | value = item["value"][key], 2176 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2177 | } 2178 | ] 2179 | ]...) 2180 | remaining = concat([], [ 2181 | for item in local.mod76[map_idx].remaining: 2182 | [ 2183 | for key in keys(item["value"]): 2184 | { 2185 | path = concat(item["path"], [key]), 2186 | value = item["value"][key] 2187 | } 2188 | if item["value"][key] != null && can(keys(item["value"][key])) 2189 | ] 2190 | ]...) 2191 | } 2192 | ] 2193 | mod78 = [ 2194 | for map_idx in range(0, length(local.input_maps)): 2195 | { 2196 | fields = concat([], [ 2197 | for item in local.mod77[map_idx].remaining: 2198 | [ 2199 | for key in keys(item["value"]): 2200 | { 2201 | key = jsonencode(concat(item["path"], [key])), 2202 | path = concat(item["path"], [key]), 2203 | value = item["value"][key], 2204 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2205 | } 2206 | ] 2207 | ]...) 2208 | remaining = concat([], [ 2209 | for item in local.mod77[map_idx].remaining: 2210 | [ 2211 | for key in keys(item["value"]): 2212 | { 2213 | path = concat(item["path"], [key]), 2214 | value = item["value"][key] 2215 | } 2216 | if item["value"][key] != null && can(keys(item["value"][key])) 2217 | ] 2218 | ]...) 2219 | } 2220 | ] 2221 | mod79 = [ 2222 | for map_idx in range(0, length(local.input_maps)): 2223 | { 2224 | fields = concat([], [ 2225 | for item in local.mod78[map_idx].remaining: 2226 | [ 2227 | for key in keys(item["value"]): 2228 | { 2229 | key = jsonencode(concat(item["path"], [key])), 2230 | path = concat(item["path"], [key]), 2231 | value = item["value"][key], 2232 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2233 | } 2234 | ] 2235 | ]...) 2236 | remaining = concat([], [ 2237 | for item in local.mod78[map_idx].remaining: 2238 | [ 2239 | for key in keys(item["value"]): 2240 | { 2241 | path = concat(item["path"], [key]), 2242 | value = item["value"][key] 2243 | } 2244 | if item["value"][key] != null && can(keys(item["value"][key])) 2245 | ] 2246 | ]...) 2247 | } 2248 | ] 2249 | mod80 = [ 2250 | for map_idx in range(0, length(local.input_maps)): 2251 | { 2252 | fields = concat([], [ 2253 | for item in local.mod79[map_idx].remaining: 2254 | [ 2255 | for key in keys(item["value"]): 2256 | { 2257 | key = jsonencode(concat(item["path"], [key])), 2258 | path = concat(item["path"], [key]), 2259 | value = item["value"][key], 2260 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2261 | } 2262 | ] 2263 | ]...) 2264 | remaining = concat([], [ 2265 | for item in local.mod79[map_idx].remaining: 2266 | [ 2267 | for key in keys(item["value"]): 2268 | { 2269 | path = concat(item["path"], [key]), 2270 | value = item["value"][key] 2271 | } 2272 | if item["value"][key] != null && can(keys(item["value"][key])) 2273 | ] 2274 | ]...) 2275 | } 2276 | ] 2277 | mod81 = [ 2278 | for map_idx in range(0, length(local.input_maps)): 2279 | { 2280 | fields = concat([], [ 2281 | for item in local.mod80[map_idx].remaining: 2282 | [ 2283 | for key in keys(item["value"]): 2284 | { 2285 | key = jsonencode(concat(item["path"], [key])), 2286 | path = concat(item["path"], [key]), 2287 | value = item["value"][key], 2288 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2289 | } 2290 | ] 2291 | ]...) 2292 | remaining = concat([], [ 2293 | for item in local.mod80[map_idx].remaining: 2294 | [ 2295 | for key in keys(item["value"]): 2296 | { 2297 | path = concat(item["path"], [key]), 2298 | value = item["value"][key] 2299 | } 2300 | if item["value"][key] != null && can(keys(item["value"][key])) 2301 | ] 2302 | ]...) 2303 | } 2304 | ] 2305 | mod82 = [ 2306 | for map_idx in range(0, length(local.input_maps)): 2307 | { 2308 | fields = concat([], [ 2309 | for item in local.mod81[map_idx].remaining: 2310 | [ 2311 | for key in keys(item["value"]): 2312 | { 2313 | key = jsonencode(concat(item["path"], [key])), 2314 | path = concat(item["path"], [key]), 2315 | value = item["value"][key], 2316 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2317 | } 2318 | ] 2319 | ]...) 2320 | remaining = concat([], [ 2321 | for item in local.mod81[map_idx].remaining: 2322 | [ 2323 | for key in keys(item["value"]): 2324 | { 2325 | path = concat(item["path"], [key]), 2326 | value = item["value"][key] 2327 | } 2328 | if item["value"][key] != null && can(keys(item["value"][key])) 2329 | ] 2330 | ]...) 2331 | } 2332 | ] 2333 | mod83 = [ 2334 | for map_idx in range(0, length(local.input_maps)): 2335 | { 2336 | fields = concat([], [ 2337 | for item in local.mod82[map_idx].remaining: 2338 | [ 2339 | for key in keys(item["value"]): 2340 | { 2341 | key = jsonencode(concat(item["path"], [key])), 2342 | path = concat(item["path"], [key]), 2343 | value = item["value"][key], 2344 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2345 | } 2346 | ] 2347 | ]...) 2348 | remaining = concat([], [ 2349 | for item in local.mod82[map_idx].remaining: 2350 | [ 2351 | for key in keys(item["value"]): 2352 | { 2353 | path = concat(item["path"], [key]), 2354 | value = item["value"][key] 2355 | } 2356 | if item["value"][key] != null && can(keys(item["value"][key])) 2357 | ] 2358 | ]...) 2359 | } 2360 | ] 2361 | mod84 = [ 2362 | for map_idx in range(0, length(local.input_maps)): 2363 | { 2364 | fields = concat([], [ 2365 | for item in local.mod83[map_idx].remaining: 2366 | [ 2367 | for key in keys(item["value"]): 2368 | { 2369 | key = jsonencode(concat(item["path"], [key])), 2370 | path = concat(item["path"], [key]), 2371 | value = item["value"][key], 2372 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2373 | } 2374 | ] 2375 | ]...) 2376 | remaining = concat([], [ 2377 | for item in local.mod83[map_idx].remaining: 2378 | [ 2379 | for key in keys(item["value"]): 2380 | { 2381 | path = concat(item["path"], [key]), 2382 | value = item["value"][key] 2383 | } 2384 | if item["value"][key] != null && can(keys(item["value"][key])) 2385 | ] 2386 | ]...) 2387 | } 2388 | ] 2389 | mod85 = [ 2390 | for map_idx in range(0, length(local.input_maps)): 2391 | { 2392 | fields = concat([], [ 2393 | for item in local.mod84[map_idx].remaining: 2394 | [ 2395 | for key in keys(item["value"]): 2396 | { 2397 | key = jsonencode(concat(item["path"], [key])), 2398 | path = concat(item["path"], [key]), 2399 | value = item["value"][key], 2400 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2401 | } 2402 | ] 2403 | ]...) 2404 | remaining = concat([], [ 2405 | for item in local.mod84[map_idx].remaining: 2406 | [ 2407 | for key in keys(item["value"]): 2408 | { 2409 | path = concat(item["path"], [key]), 2410 | value = item["value"][key] 2411 | } 2412 | if item["value"][key] != null && can(keys(item["value"][key])) 2413 | ] 2414 | ]...) 2415 | } 2416 | ] 2417 | mod86 = [ 2418 | for map_idx in range(0, length(local.input_maps)): 2419 | { 2420 | fields = concat([], [ 2421 | for item in local.mod85[map_idx].remaining: 2422 | [ 2423 | for key in keys(item["value"]): 2424 | { 2425 | key = jsonencode(concat(item["path"], [key])), 2426 | path = concat(item["path"], [key]), 2427 | value = item["value"][key], 2428 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2429 | } 2430 | ] 2431 | ]...) 2432 | remaining = concat([], [ 2433 | for item in local.mod85[map_idx].remaining: 2434 | [ 2435 | for key in keys(item["value"]): 2436 | { 2437 | path = concat(item["path"], [key]), 2438 | value = item["value"][key] 2439 | } 2440 | if item["value"][key] != null && can(keys(item["value"][key])) 2441 | ] 2442 | ]...) 2443 | } 2444 | ] 2445 | mod87 = [ 2446 | for map_idx in range(0, length(local.input_maps)): 2447 | { 2448 | fields = concat([], [ 2449 | for item in local.mod86[map_idx].remaining: 2450 | [ 2451 | for key in keys(item["value"]): 2452 | { 2453 | key = jsonencode(concat(item["path"], [key])), 2454 | path = concat(item["path"], [key]), 2455 | value = item["value"][key], 2456 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2457 | } 2458 | ] 2459 | ]...) 2460 | remaining = concat([], [ 2461 | for item in local.mod86[map_idx].remaining: 2462 | [ 2463 | for key in keys(item["value"]): 2464 | { 2465 | path = concat(item["path"], [key]), 2466 | value = item["value"][key] 2467 | } 2468 | if item["value"][key] != null && can(keys(item["value"][key])) 2469 | ] 2470 | ]...) 2471 | } 2472 | ] 2473 | mod88 = [ 2474 | for map_idx in range(0, length(local.input_maps)): 2475 | { 2476 | fields = concat([], [ 2477 | for item in local.mod87[map_idx].remaining: 2478 | [ 2479 | for key in keys(item["value"]): 2480 | { 2481 | key = jsonencode(concat(item["path"], [key])), 2482 | path = concat(item["path"], [key]), 2483 | value = item["value"][key], 2484 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2485 | } 2486 | ] 2487 | ]...) 2488 | remaining = concat([], [ 2489 | for item in local.mod87[map_idx].remaining: 2490 | [ 2491 | for key in keys(item["value"]): 2492 | { 2493 | path = concat(item["path"], [key]), 2494 | value = item["value"][key] 2495 | } 2496 | if item["value"][key] != null && can(keys(item["value"][key])) 2497 | ] 2498 | ]...) 2499 | } 2500 | ] 2501 | mod89 = [ 2502 | for map_idx in range(0, length(local.input_maps)): 2503 | { 2504 | fields = concat([], [ 2505 | for item in local.mod88[map_idx].remaining: 2506 | [ 2507 | for key in keys(item["value"]): 2508 | { 2509 | key = jsonencode(concat(item["path"], [key])), 2510 | path = concat(item["path"], [key]), 2511 | value = item["value"][key], 2512 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2513 | } 2514 | ] 2515 | ]...) 2516 | remaining = concat([], [ 2517 | for item in local.mod88[map_idx].remaining: 2518 | [ 2519 | for key in keys(item["value"]): 2520 | { 2521 | path = concat(item["path"], [key]), 2522 | value = item["value"][key] 2523 | } 2524 | if item["value"][key] != null && can(keys(item["value"][key])) 2525 | ] 2526 | ]...) 2527 | } 2528 | ] 2529 | mod90 = [ 2530 | for map_idx in range(0, length(local.input_maps)): 2531 | { 2532 | fields = concat([], [ 2533 | for item in local.mod89[map_idx].remaining: 2534 | [ 2535 | for key in keys(item["value"]): 2536 | { 2537 | key = jsonencode(concat(item["path"], [key])), 2538 | path = concat(item["path"], [key]), 2539 | value = item["value"][key], 2540 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2541 | } 2542 | ] 2543 | ]...) 2544 | remaining = concat([], [ 2545 | for item in local.mod89[map_idx].remaining: 2546 | [ 2547 | for key in keys(item["value"]): 2548 | { 2549 | path = concat(item["path"], [key]), 2550 | value = item["value"][key] 2551 | } 2552 | if item["value"][key] != null && can(keys(item["value"][key])) 2553 | ] 2554 | ]...) 2555 | } 2556 | ] 2557 | mod91 = [ 2558 | for map_idx in range(0, length(local.input_maps)): 2559 | { 2560 | fields = concat([], [ 2561 | for item in local.mod90[map_idx].remaining: 2562 | [ 2563 | for key in keys(item["value"]): 2564 | { 2565 | key = jsonencode(concat(item["path"], [key])), 2566 | path = concat(item["path"], [key]), 2567 | value = item["value"][key], 2568 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2569 | } 2570 | ] 2571 | ]...) 2572 | remaining = concat([], [ 2573 | for item in local.mod90[map_idx].remaining: 2574 | [ 2575 | for key in keys(item["value"]): 2576 | { 2577 | path = concat(item["path"], [key]), 2578 | value = item["value"][key] 2579 | } 2580 | if item["value"][key] != null && can(keys(item["value"][key])) 2581 | ] 2582 | ]...) 2583 | } 2584 | ] 2585 | mod92 = [ 2586 | for map_idx in range(0, length(local.input_maps)): 2587 | { 2588 | fields = concat([], [ 2589 | for item in local.mod91[map_idx].remaining: 2590 | [ 2591 | for key in keys(item["value"]): 2592 | { 2593 | key = jsonencode(concat(item["path"], [key])), 2594 | path = concat(item["path"], [key]), 2595 | value = item["value"][key], 2596 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2597 | } 2598 | ] 2599 | ]...) 2600 | remaining = concat([], [ 2601 | for item in local.mod91[map_idx].remaining: 2602 | [ 2603 | for key in keys(item["value"]): 2604 | { 2605 | path = concat(item["path"], [key]), 2606 | value = item["value"][key] 2607 | } 2608 | if item["value"][key] != null && can(keys(item["value"][key])) 2609 | ] 2610 | ]...) 2611 | } 2612 | ] 2613 | mod93 = [ 2614 | for map_idx in range(0, length(local.input_maps)): 2615 | { 2616 | fields = concat([], [ 2617 | for item in local.mod92[map_idx].remaining: 2618 | [ 2619 | for key in keys(item["value"]): 2620 | { 2621 | key = jsonencode(concat(item["path"], [key])), 2622 | path = concat(item["path"], [key]), 2623 | value = item["value"][key], 2624 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2625 | } 2626 | ] 2627 | ]...) 2628 | remaining = concat([], [ 2629 | for item in local.mod92[map_idx].remaining: 2630 | [ 2631 | for key in keys(item["value"]): 2632 | { 2633 | path = concat(item["path"], [key]), 2634 | value = item["value"][key] 2635 | } 2636 | if item["value"][key] != null && can(keys(item["value"][key])) 2637 | ] 2638 | ]...) 2639 | } 2640 | ] 2641 | mod94 = [ 2642 | for map_idx in range(0, length(local.input_maps)): 2643 | { 2644 | fields = concat([], [ 2645 | for item in local.mod93[map_idx].remaining: 2646 | [ 2647 | for key in keys(item["value"]): 2648 | { 2649 | key = jsonencode(concat(item["path"], [key])), 2650 | path = concat(item["path"], [key]), 2651 | value = item["value"][key], 2652 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2653 | } 2654 | ] 2655 | ]...) 2656 | remaining = concat([], [ 2657 | for item in local.mod93[map_idx].remaining: 2658 | [ 2659 | for key in keys(item["value"]): 2660 | { 2661 | path = concat(item["path"], [key]), 2662 | value = item["value"][key] 2663 | } 2664 | if item["value"][key] != null && can(keys(item["value"][key])) 2665 | ] 2666 | ]...) 2667 | } 2668 | ] 2669 | mod95 = [ 2670 | for map_idx in range(0, length(local.input_maps)): 2671 | { 2672 | fields = concat([], [ 2673 | for item in local.mod94[map_idx].remaining: 2674 | [ 2675 | for key in keys(item["value"]): 2676 | { 2677 | key = jsonencode(concat(item["path"], [key])), 2678 | path = concat(item["path"], [key]), 2679 | value = item["value"][key], 2680 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2681 | } 2682 | ] 2683 | ]...) 2684 | remaining = concat([], [ 2685 | for item in local.mod94[map_idx].remaining: 2686 | [ 2687 | for key in keys(item["value"]): 2688 | { 2689 | path = concat(item["path"], [key]), 2690 | value = item["value"][key] 2691 | } 2692 | if item["value"][key] != null && can(keys(item["value"][key])) 2693 | ] 2694 | ]...) 2695 | } 2696 | ] 2697 | mod96 = [ 2698 | for map_idx in range(0, length(local.input_maps)): 2699 | { 2700 | fields = concat([], [ 2701 | for item in local.mod95[map_idx].remaining: 2702 | [ 2703 | for key in keys(item["value"]): 2704 | { 2705 | key = jsonencode(concat(item["path"], [key])), 2706 | path = concat(item["path"], [key]), 2707 | value = item["value"][key], 2708 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2709 | } 2710 | ] 2711 | ]...) 2712 | remaining = concat([], [ 2713 | for item in local.mod95[map_idx].remaining: 2714 | [ 2715 | for key in keys(item["value"]): 2716 | { 2717 | path = concat(item["path"], [key]), 2718 | value = item["value"][key] 2719 | } 2720 | if item["value"][key] != null && can(keys(item["value"][key])) 2721 | ] 2722 | ]...) 2723 | } 2724 | ] 2725 | mod97 = [ 2726 | for map_idx in range(0, length(local.input_maps)): 2727 | { 2728 | fields = concat([], [ 2729 | for item in local.mod96[map_idx].remaining: 2730 | [ 2731 | for key in keys(item["value"]): 2732 | { 2733 | key = jsonencode(concat(item["path"], [key])), 2734 | path = concat(item["path"], [key]), 2735 | value = item["value"][key], 2736 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2737 | } 2738 | ] 2739 | ]...) 2740 | remaining = concat([], [ 2741 | for item in local.mod96[map_idx].remaining: 2742 | [ 2743 | for key in keys(item["value"]): 2744 | { 2745 | path = concat(item["path"], [key]), 2746 | value = item["value"][key] 2747 | } 2748 | if item["value"][key] != null && can(keys(item["value"][key])) 2749 | ] 2750 | ]...) 2751 | } 2752 | ] 2753 | mod98 = [ 2754 | for map_idx in range(0, length(local.input_maps)): 2755 | { 2756 | fields = concat([], [ 2757 | for item in local.mod97[map_idx].remaining: 2758 | [ 2759 | for key in keys(item["value"]): 2760 | { 2761 | key = jsonencode(concat(item["path"], [key])), 2762 | path = concat(item["path"], [key]), 2763 | value = item["value"][key], 2764 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2765 | } 2766 | ] 2767 | ]...) 2768 | remaining = concat([], [ 2769 | for item in local.mod97[map_idx].remaining: 2770 | [ 2771 | for key in keys(item["value"]): 2772 | { 2773 | path = concat(item["path"], [key]), 2774 | value = item["value"][key] 2775 | } 2776 | if item["value"][key] != null && can(keys(item["value"][key])) 2777 | ] 2778 | ]...) 2779 | } 2780 | ] 2781 | mod99 = [ 2782 | for map_idx in range(0, length(local.input_maps)): 2783 | { 2784 | fields = concat([], [ 2785 | for item in local.mod98[map_idx].remaining: 2786 | [ 2787 | for key in keys(item["value"]): 2788 | { 2789 | key = jsonencode(concat(item["path"], [key])), 2790 | path = concat(item["path"], [key]), 2791 | value = item["value"][key], 2792 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2793 | } 2794 | ] 2795 | ]...) 2796 | remaining = concat([], [ 2797 | for item in local.mod98[map_idx].remaining: 2798 | [ 2799 | for key in keys(item["value"]): 2800 | { 2801 | path = concat(item["path"], [key]), 2802 | value = item["value"][key] 2803 | } 2804 | if item["value"][key] != null && can(keys(item["value"][key])) 2805 | ] 2806 | ]...) 2807 | } 2808 | ] 2809 | mod100 = [ 2810 | for map_idx in range(0, length(local.input_maps)): 2811 | { 2812 | fields = concat([], [ 2813 | for item in local.mod99[map_idx].remaining: 2814 | [ 2815 | for key in keys(item["value"]): 2816 | { 2817 | key = jsonencode(concat(item["path"], [key])), 2818 | path = concat(item["path"], [key]), 2819 | value = item["value"][key], 2820 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 2821 | } 2822 | ] 2823 | ]...) 2824 | remaining = concat([], [ 2825 | for item in local.mod99[map_idx].remaining: 2826 | [ 2827 | for key in keys(item["value"]): 2828 | { 2829 | path = concat(item["path"], [key]), 2830 | value = item["value"][key] 2831 | } 2832 | if item["value"][key] != null && can(keys(item["value"][key])) 2833 | ] 2834 | ]...) 2835 | } 2836 | ] 2837 | 2838 | modules = [ 2839 | local.mod0, 2840 | local.mod1, 2841 | local.mod2, 2842 | local.mod3, 2843 | local.mod4, 2844 | local.mod5, 2845 | local.mod6, 2846 | local.mod7, 2847 | local.mod8, 2848 | local.mod9, 2849 | local.mod10, 2850 | local.mod11, 2851 | local.mod12, 2852 | local.mod13, 2853 | local.mod14, 2854 | local.mod15, 2855 | local.mod16, 2856 | local.mod17, 2857 | local.mod18, 2858 | local.mod19, 2859 | local.mod20, 2860 | local.mod21, 2861 | local.mod22, 2862 | local.mod23, 2863 | local.mod24, 2864 | local.mod25, 2865 | local.mod26, 2866 | local.mod27, 2867 | local.mod28, 2868 | local.mod29, 2869 | local.mod30, 2870 | local.mod31, 2871 | local.mod32, 2872 | local.mod33, 2873 | local.mod34, 2874 | local.mod35, 2875 | local.mod36, 2876 | local.mod37, 2877 | local.mod38, 2878 | local.mod39, 2879 | local.mod40, 2880 | local.mod41, 2881 | local.mod42, 2882 | local.mod43, 2883 | local.mod44, 2884 | local.mod45, 2885 | local.mod46, 2886 | local.mod47, 2887 | local.mod48, 2888 | local.mod49, 2889 | local.mod50, 2890 | local.mod51, 2891 | local.mod52, 2892 | local.mod53, 2893 | local.mod54, 2894 | local.mod55, 2895 | local.mod56, 2896 | local.mod57, 2897 | local.mod58, 2898 | local.mod59, 2899 | local.mod60, 2900 | local.mod61, 2901 | local.mod62, 2902 | local.mod63, 2903 | local.mod64, 2904 | local.mod65, 2905 | local.mod66, 2906 | local.mod67, 2907 | local.mod68, 2908 | local.mod69, 2909 | local.mod70, 2910 | local.mod71, 2911 | local.mod72, 2912 | local.mod73, 2913 | local.mod74, 2914 | local.mod75, 2915 | local.mod76, 2916 | local.mod77, 2917 | local.mod78, 2918 | local.mod79, 2919 | local.mod80, 2920 | local.mod81, 2921 | local.mod82, 2922 | local.mod83, 2923 | local.mod84, 2924 | local.mod85, 2925 | local.mod86, 2926 | local.mod87, 2927 | local.mod88, 2928 | local.mod89, 2929 | local.mod90, 2930 | local.mod91, 2931 | local.mod92, 2932 | local.mod93, 2933 | local.mod94, 2934 | local.mod95, 2935 | local.mod96, 2936 | local.mod97, 2937 | local.mod98, 2938 | local.mod99, 2939 | local.mod100, 2940 | ] 2941 | 2942 | m101 = {} 2943 | m100 = { 2944 | for field in lookup(local.merged_fields_by_depth, 99, {}): 2945 | field.key => {final_val = field.value, sub_val = { 2946 | for subfield in lookup(local.merged_fields_by_depth, 100, {}): 2947 | subfield.path[length(subfield.path) - 1] => lookup(local.m101, subfield.key, subfield.value) 2948 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 2949 | }}[field.is_final ? "final_val" : "sub_val"] 2950 | } 2951 | m99 = { 2952 | for field in lookup(local.merged_fields_by_depth, 98, {}): 2953 | field.key => {final_val = field.value, sub_val = { 2954 | for subfield in lookup(local.merged_fields_by_depth, 99, {}): 2955 | subfield.path[length(subfield.path) - 1] => lookup(local.m100, subfield.key, subfield.value) 2956 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 2957 | }}[field.is_final ? "final_val" : "sub_val"] 2958 | } 2959 | m98 = { 2960 | for field in lookup(local.merged_fields_by_depth, 97, {}): 2961 | field.key => {final_val = field.value, sub_val = { 2962 | for subfield in lookup(local.merged_fields_by_depth, 98, {}): 2963 | subfield.path[length(subfield.path) - 1] => lookup(local.m99, subfield.key, subfield.value) 2964 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 2965 | }}[field.is_final ? "final_val" : "sub_val"] 2966 | } 2967 | m97 = { 2968 | for field in lookup(local.merged_fields_by_depth, 96, {}): 2969 | field.key => {final_val = field.value, sub_val = { 2970 | for subfield in lookup(local.merged_fields_by_depth, 97, {}): 2971 | subfield.path[length(subfield.path) - 1] => lookup(local.m98, subfield.key, subfield.value) 2972 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 2973 | }}[field.is_final ? "final_val" : "sub_val"] 2974 | } 2975 | m96 = { 2976 | for field in lookup(local.merged_fields_by_depth, 95, {}): 2977 | field.key => {final_val = field.value, sub_val = { 2978 | for subfield in lookup(local.merged_fields_by_depth, 96, {}): 2979 | subfield.path[length(subfield.path) - 1] => lookup(local.m97, subfield.key, subfield.value) 2980 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 2981 | }}[field.is_final ? "final_val" : "sub_val"] 2982 | } 2983 | m95 = { 2984 | for field in lookup(local.merged_fields_by_depth, 94, {}): 2985 | field.key => {final_val = field.value, sub_val = { 2986 | for subfield in lookup(local.merged_fields_by_depth, 95, {}): 2987 | subfield.path[length(subfield.path) - 1] => lookup(local.m96, subfield.key, subfield.value) 2988 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 2989 | }}[field.is_final ? "final_val" : "sub_val"] 2990 | } 2991 | m94 = { 2992 | for field in lookup(local.merged_fields_by_depth, 93, {}): 2993 | field.key => {final_val = field.value, sub_val = { 2994 | for subfield in lookup(local.merged_fields_by_depth, 94, {}): 2995 | subfield.path[length(subfield.path) - 1] => lookup(local.m95, subfield.key, subfield.value) 2996 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 2997 | }}[field.is_final ? "final_val" : "sub_val"] 2998 | } 2999 | m93 = { 3000 | for field in lookup(local.merged_fields_by_depth, 92, {}): 3001 | field.key => {final_val = field.value, sub_val = { 3002 | for subfield in lookup(local.merged_fields_by_depth, 93, {}): 3003 | subfield.path[length(subfield.path) - 1] => lookup(local.m94, subfield.key, subfield.value) 3004 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3005 | }}[field.is_final ? "final_val" : "sub_val"] 3006 | } 3007 | m92 = { 3008 | for field in lookup(local.merged_fields_by_depth, 91, {}): 3009 | field.key => {final_val = field.value, sub_val = { 3010 | for subfield in lookup(local.merged_fields_by_depth, 92, {}): 3011 | subfield.path[length(subfield.path) - 1] => lookup(local.m93, subfield.key, subfield.value) 3012 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3013 | }}[field.is_final ? "final_val" : "sub_val"] 3014 | } 3015 | m91 = { 3016 | for field in lookup(local.merged_fields_by_depth, 90, {}): 3017 | field.key => {final_val = field.value, sub_val = { 3018 | for subfield in lookup(local.merged_fields_by_depth, 91, {}): 3019 | subfield.path[length(subfield.path) - 1] => lookup(local.m92, subfield.key, subfield.value) 3020 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3021 | }}[field.is_final ? "final_val" : "sub_val"] 3022 | } 3023 | m90 = { 3024 | for field in lookup(local.merged_fields_by_depth, 89, {}): 3025 | field.key => {final_val = field.value, sub_val = { 3026 | for subfield in lookup(local.merged_fields_by_depth, 90, {}): 3027 | subfield.path[length(subfield.path) - 1] => lookup(local.m91, subfield.key, subfield.value) 3028 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3029 | }}[field.is_final ? "final_val" : "sub_val"] 3030 | } 3031 | m89 = { 3032 | for field in lookup(local.merged_fields_by_depth, 88, {}): 3033 | field.key => {final_val = field.value, sub_val = { 3034 | for subfield in lookup(local.merged_fields_by_depth, 89, {}): 3035 | subfield.path[length(subfield.path) - 1] => lookup(local.m90, subfield.key, subfield.value) 3036 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3037 | }}[field.is_final ? "final_val" : "sub_val"] 3038 | } 3039 | m88 = { 3040 | for field in lookup(local.merged_fields_by_depth, 87, {}): 3041 | field.key => {final_val = field.value, sub_val = { 3042 | for subfield in lookup(local.merged_fields_by_depth, 88, {}): 3043 | subfield.path[length(subfield.path) - 1] => lookup(local.m89, subfield.key, subfield.value) 3044 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3045 | }}[field.is_final ? "final_val" : "sub_val"] 3046 | } 3047 | m87 = { 3048 | for field in lookup(local.merged_fields_by_depth, 86, {}): 3049 | field.key => {final_val = field.value, sub_val = { 3050 | for subfield in lookup(local.merged_fields_by_depth, 87, {}): 3051 | subfield.path[length(subfield.path) - 1] => lookup(local.m88, subfield.key, subfield.value) 3052 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3053 | }}[field.is_final ? "final_val" : "sub_val"] 3054 | } 3055 | m86 = { 3056 | for field in lookup(local.merged_fields_by_depth, 85, {}): 3057 | field.key => {final_val = field.value, sub_val = { 3058 | for subfield in lookup(local.merged_fields_by_depth, 86, {}): 3059 | subfield.path[length(subfield.path) - 1] => lookup(local.m87, subfield.key, subfield.value) 3060 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3061 | }}[field.is_final ? "final_val" : "sub_val"] 3062 | } 3063 | m85 = { 3064 | for field in lookup(local.merged_fields_by_depth, 84, {}): 3065 | field.key => {final_val = field.value, sub_val = { 3066 | for subfield in lookup(local.merged_fields_by_depth, 85, {}): 3067 | subfield.path[length(subfield.path) - 1] => lookup(local.m86, subfield.key, subfield.value) 3068 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3069 | }}[field.is_final ? "final_val" : "sub_val"] 3070 | } 3071 | m84 = { 3072 | for field in lookup(local.merged_fields_by_depth, 83, {}): 3073 | field.key => {final_val = field.value, sub_val = { 3074 | for subfield in lookup(local.merged_fields_by_depth, 84, {}): 3075 | subfield.path[length(subfield.path) - 1] => lookup(local.m85, subfield.key, subfield.value) 3076 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3077 | }}[field.is_final ? "final_val" : "sub_val"] 3078 | } 3079 | m83 = { 3080 | for field in lookup(local.merged_fields_by_depth, 82, {}): 3081 | field.key => {final_val = field.value, sub_val = { 3082 | for subfield in lookup(local.merged_fields_by_depth, 83, {}): 3083 | subfield.path[length(subfield.path) - 1] => lookup(local.m84, subfield.key, subfield.value) 3084 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3085 | }}[field.is_final ? "final_val" : "sub_val"] 3086 | } 3087 | m82 = { 3088 | for field in lookup(local.merged_fields_by_depth, 81, {}): 3089 | field.key => {final_val = field.value, sub_val = { 3090 | for subfield in lookup(local.merged_fields_by_depth, 82, {}): 3091 | subfield.path[length(subfield.path) - 1] => lookup(local.m83, subfield.key, subfield.value) 3092 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3093 | }}[field.is_final ? "final_val" : "sub_val"] 3094 | } 3095 | m81 = { 3096 | for field in lookup(local.merged_fields_by_depth, 80, {}): 3097 | field.key => {final_val = field.value, sub_val = { 3098 | for subfield in lookup(local.merged_fields_by_depth, 81, {}): 3099 | subfield.path[length(subfield.path) - 1] => lookup(local.m82, subfield.key, subfield.value) 3100 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3101 | }}[field.is_final ? "final_val" : "sub_val"] 3102 | } 3103 | m80 = { 3104 | for field in lookup(local.merged_fields_by_depth, 79, {}): 3105 | field.key => {final_val = field.value, sub_val = { 3106 | for subfield in lookup(local.merged_fields_by_depth, 80, {}): 3107 | subfield.path[length(subfield.path) - 1] => lookup(local.m81, subfield.key, subfield.value) 3108 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3109 | }}[field.is_final ? "final_val" : "sub_val"] 3110 | } 3111 | m79 = { 3112 | for field in lookup(local.merged_fields_by_depth, 78, {}): 3113 | field.key => {final_val = field.value, sub_val = { 3114 | for subfield in lookup(local.merged_fields_by_depth, 79, {}): 3115 | subfield.path[length(subfield.path) - 1] => lookup(local.m80, subfield.key, subfield.value) 3116 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3117 | }}[field.is_final ? "final_val" : "sub_val"] 3118 | } 3119 | m78 = { 3120 | for field in lookup(local.merged_fields_by_depth, 77, {}): 3121 | field.key => {final_val = field.value, sub_val = { 3122 | for subfield in lookup(local.merged_fields_by_depth, 78, {}): 3123 | subfield.path[length(subfield.path) - 1] => lookup(local.m79, subfield.key, subfield.value) 3124 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3125 | }}[field.is_final ? "final_val" : "sub_val"] 3126 | } 3127 | m77 = { 3128 | for field in lookup(local.merged_fields_by_depth, 76, {}): 3129 | field.key => {final_val = field.value, sub_val = { 3130 | for subfield in lookup(local.merged_fields_by_depth, 77, {}): 3131 | subfield.path[length(subfield.path) - 1] => lookup(local.m78, subfield.key, subfield.value) 3132 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3133 | }}[field.is_final ? "final_val" : "sub_val"] 3134 | } 3135 | m76 = { 3136 | for field in lookup(local.merged_fields_by_depth, 75, {}): 3137 | field.key => {final_val = field.value, sub_val = { 3138 | for subfield in lookup(local.merged_fields_by_depth, 76, {}): 3139 | subfield.path[length(subfield.path) - 1] => lookup(local.m77, subfield.key, subfield.value) 3140 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3141 | }}[field.is_final ? "final_val" : "sub_val"] 3142 | } 3143 | m75 = { 3144 | for field in lookup(local.merged_fields_by_depth, 74, {}): 3145 | field.key => {final_val = field.value, sub_val = { 3146 | for subfield in lookup(local.merged_fields_by_depth, 75, {}): 3147 | subfield.path[length(subfield.path) - 1] => lookup(local.m76, subfield.key, subfield.value) 3148 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3149 | }}[field.is_final ? "final_val" : "sub_val"] 3150 | } 3151 | m74 = { 3152 | for field in lookup(local.merged_fields_by_depth, 73, {}): 3153 | field.key => {final_val = field.value, sub_val = { 3154 | for subfield in lookup(local.merged_fields_by_depth, 74, {}): 3155 | subfield.path[length(subfield.path) - 1] => lookup(local.m75, subfield.key, subfield.value) 3156 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3157 | }}[field.is_final ? "final_val" : "sub_val"] 3158 | } 3159 | m73 = { 3160 | for field in lookup(local.merged_fields_by_depth, 72, {}): 3161 | field.key => {final_val = field.value, sub_val = { 3162 | for subfield in lookup(local.merged_fields_by_depth, 73, {}): 3163 | subfield.path[length(subfield.path) - 1] => lookup(local.m74, subfield.key, subfield.value) 3164 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3165 | }}[field.is_final ? "final_val" : "sub_val"] 3166 | } 3167 | m72 = { 3168 | for field in lookup(local.merged_fields_by_depth, 71, {}): 3169 | field.key => {final_val = field.value, sub_val = { 3170 | for subfield in lookup(local.merged_fields_by_depth, 72, {}): 3171 | subfield.path[length(subfield.path) - 1] => lookup(local.m73, subfield.key, subfield.value) 3172 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3173 | }}[field.is_final ? "final_val" : "sub_val"] 3174 | } 3175 | m71 = { 3176 | for field in lookup(local.merged_fields_by_depth, 70, {}): 3177 | field.key => {final_val = field.value, sub_val = { 3178 | for subfield in lookup(local.merged_fields_by_depth, 71, {}): 3179 | subfield.path[length(subfield.path) - 1] => lookup(local.m72, subfield.key, subfield.value) 3180 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3181 | }}[field.is_final ? "final_val" : "sub_val"] 3182 | } 3183 | m70 = { 3184 | for field in lookup(local.merged_fields_by_depth, 69, {}): 3185 | field.key => {final_val = field.value, sub_val = { 3186 | for subfield in lookup(local.merged_fields_by_depth, 70, {}): 3187 | subfield.path[length(subfield.path) - 1] => lookup(local.m71, subfield.key, subfield.value) 3188 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3189 | }}[field.is_final ? "final_val" : "sub_val"] 3190 | } 3191 | m69 = { 3192 | for field in lookup(local.merged_fields_by_depth, 68, {}): 3193 | field.key => {final_val = field.value, sub_val = { 3194 | for subfield in lookup(local.merged_fields_by_depth, 69, {}): 3195 | subfield.path[length(subfield.path) - 1] => lookup(local.m70, subfield.key, subfield.value) 3196 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3197 | }}[field.is_final ? "final_val" : "sub_val"] 3198 | } 3199 | m68 = { 3200 | for field in lookup(local.merged_fields_by_depth, 67, {}): 3201 | field.key => {final_val = field.value, sub_val = { 3202 | for subfield in lookup(local.merged_fields_by_depth, 68, {}): 3203 | subfield.path[length(subfield.path) - 1] => lookup(local.m69, subfield.key, subfield.value) 3204 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3205 | }}[field.is_final ? "final_val" : "sub_val"] 3206 | } 3207 | m67 = { 3208 | for field in lookup(local.merged_fields_by_depth, 66, {}): 3209 | field.key => {final_val = field.value, sub_val = { 3210 | for subfield in lookup(local.merged_fields_by_depth, 67, {}): 3211 | subfield.path[length(subfield.path) - 1] => lookup(local.m68, subfield.key, subfield.value) 3212 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3213 | }}[field.is_final ? "final_val" : "sub_val"] 3214 | } 3215 | m66 = { 3216 | for field in lookup(local.merged_fields_by_depth, 65, {}): 3217 | field.key => {final_val = field.value, sub_val = { 3218 | for subfield in lookup(local.merged_fields_by_depth, 66, {}): 3219 | subfield.path[length(subfield.path) - 1] => lookup(local.m67, subfield.key, subfield.value) 3220 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3221 | }}[field.is_final ? "final_val" : "sub_val"] 3222 | } 3223 | m65 = { 3224 | for field in lookup(local.merged_fields_by_depth, 64, {}): 3225 | field.key => {final_val = field.value, sub_val = { 3226 | for subfield in lookup(local.merged_fields_by_depth, 65, {}): 3227 | subfield.path[length(subfield.path) - 1] => lookup(local.m66, subfield.key, subfield.value) 3228 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3229 | }}[field.is_final ? "final_val" : "sub_val"] 3230 | } 3231 | m64 = { 3232 | for field in lookup(local.merged_fields_by_depth, 63, {}): 3233 | field.key => {final_val = field.value, sub_val = { 3234 | for subfield in lookup(local.merged_fields_by_depth, 64, {}): 3235 | subfield.path[length(subfield.path) - 1] => lookup(local.m65, subfield.key, subfield.value) 3236 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3237 | }}[field.is_final ? "final_val" : "sub_val"] 3238 | } 3239 | m63 = { 3240 | for field in lookup(local.merged_fields_by_depth, 62, {}): 3241 | field.key => {final_val = field.value, sub_val = { 3242 | for subfield in lookup(local.merged_fields_by_depth, 63, {}): 3243 | subfield.path[length(subfield.path) - 1] => lookup(local.m64, subfield.key, subfield.value) 3244 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3245 | }}[field.is_final ? "final_val" : "sub_val"] 3246 | } 3247 | m62 = { 3248 | for field in lookup(local.merged_fields_by_depth, 61, {}): 3249 | field.key => {final_val = field.value, sub_val = { 3250 | for subfield in lookup(local.merged_fields_by_depth, 62, {}): 3251 | subfield.path[length(subfield.path) - 1] => lookup(local.m63, subfield.key, subfield.value) 3252 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3253 | }}[field.is_final ? "final_val" : "sub_val"] 3254 | } 3255 | m61 = { 3256 | for field in lookup(local.merged_fields_by_depth, 60, {}): 3257 | field.key => {final_val = field.value, sub_val = { 3258 | for subfield in lookup(local.merged_fields_by_depth, 61, {}): 3259 | subfield.path[length(subfield.path) - 1] => lookup(local.m62, subfield.key, subfield.value) 3260 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3261 | }}[field.is_final ? "final_val" : "sub_val"] 3262 | } 3263 | m60 = { 3264 | for field in lookup(local.merged_fields_by_depth, 59, {}): 3265 | field.key => {final_val = field.value, sub_val = { 3266 | for subfield in lookup(local.merged_fields_by_depth, 60, {}): 3267 | subfield.path[length(subfield.path) - 1] => lookup(local.m61, subfield.key, subfield.value) 3268 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3269 | }}[field.is_final ? "final_val" : "sub_val"] 3270 | } 3271 | m59 = { 3272 | for field in lookup(local.merged_fields_by_depth, 58, {}): 3273 | field.key => {final_val = field.value, sub_val = { 3274 | for subfield in lookup(local.merged_fields_by_depth, 59, {}): 3275 | subfield.path[length(subfield.path) - 1] => lookup(local.m60, subfield.key, subfield.value) 3276 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3277 | }}[field.is_final ? "final_val" : "sub_val"] 3278 | } 3279 | m58 = { 3280 | for field in lookup(local.merged_fields_by_depth, 57, {}): 3281 | field.key => {final_val = field.value, sub_val = { 3282 | for subfield in lookup(local.merged_fields_by_depth, 58, {}): 3283 | subfield.path[length(subfield.path) - 1] => lookup(local.m59, subfield.key, subfield.value) 3284 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3285 | }}[field.is_final ? "final_val" : "sub_val"] 3286 | } 3287 | m57 = { 3288 | for field in lookup(local.merged_fields_by_depth, 56, {}): 3289 | field.key => {final_val = field.value, sub_val = { 3290 | for subfield in lookup(local.merged_fields_by_depth, 57, {}): 3291 | subfield.path[length(subfield.path) - 1] => lookup(local.m58, subfield.key, subfield.value) 3292 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3293 | }}[field.is_final ? "final_val" : "sub_val"] 3294 | } 3295 | m56 = { 3296 | for field in lookup(local.merged_fields_by_depth, 55, {}): 3297 | field.key => {final_val = field.value, sub_val = { 3298 | for subfield in lookup(local.merged_fields_by_depth, 56, {}): 3299 | subfield.path[length(subfield.path) - 1] => lookup(local.m57, subfield.key, subfield.value) 3300 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3301 | }}[field.is_final ? "final_val" : "sub_val"] 3302 | } 3303 | m55 = { 3304 | for field in lookup(local.merged_fields_by_depth, 54, {}): 3305 | field.key => {final_val = field.value, sub_val = { 3306 | for subfield in lookup(local.merged_fields_by_depth, 55, {}): 3307 | subfield.path[length(subfield.path) - 1] => lookup(local.m56, subfield.key, subfield.value) 3308 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3309 | }}[field.is_final ? "final_val" : "sub_val"] 3310 | } 3311 | m54 = { 3312 | for field in lookup(local.merged_fields_by_depth, 53, {}): 3313 | field.key => {final_val = field.value, sub_val = { 3314 | for subfield in lookup(local.merged_fields_by_depth, 54, {}): 3315 | subfield.path[length(subfield.path) - 1] => lookup(local.m55, subfield.key, subfield.value) 3316 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3317 | }}[field.is_final ? "final_val" : "sub_val"] 3318 | } 3319 | m53 = { 3320 | for field in lookup(local.merged_fields_by_depth, 52, {}): 3321 | field.key => {final_val = field.value, sub_val = { 3322 | for subfield in lookup(local.merged_fields_by_depth, 53, {}): 3323 | subfield.path[length(subfield.path) - 1] => lookup(local.m54, subfield.key, subfield.value) 3324 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3325 | }}[field.is_final ? "final_val" : "sub_val"] 3326 | } 3327 | m52 = { 3328 | for field in lookup(local.merged_fields_by_depth, 51, {}): 3329 | field.key => {final_val = field.value, sub_val = { 3330 | for subfield in lookup(local.merged_fields_by_depth, 52, {}): 3331 | subfield.path[length(subfield.path) - 1] => lookup(local.m53, subfield.key, subfield.value) 3332 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3333 | }}[field.is_final ? "final_val" : "sub_val"] 3334 | } 3335 | m51 = { 3336 | for field in lookup(local.merged_fields_by_depth, 50, {}): 3337 | field.key => {final_val = field.value, sub_val = { 3338 | for subfield in lookup(local.merged_fields_by_depth, 51, {}): 3339 | subfield.path[length(subfield.path) - 1] => lookup(local.m52, subfield.key, subfield.value) 3340 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3341 | }}[field.is_final ? "final_val" : "sub_val"] 3342 | } 3343 | m50 = { 3344 | for field in lookup(local.merged_fields_by_depth, 49, {}): 3345 | field.key => {final_val = field.value, sub_val = { 3346 | for subfield in lookup(local.merged_fields_by_depth, 50, {}): 3347 | subfield.path[length(subfield.path) - 1] => lookup(local.m51, subfield.key, subfield.value) 3348 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3349 | }}[field.is_final ? "final_val" : "sub_val"] 3350 | } 3351 | m49 = { 3352 | for field in lookup(local.merged_fields_by_depth, 48, {}): 3353 | field.key => {final_val = field.value, sub_val = { 3354 | for subfield in lookup(local.merged_fields_by_depth, 49, {}): 3355 | subfield.path[length(subfield.path) - 1] => lookup(local.m50, subfield.key, subfield.value) 3356 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3357 | }}[field.is_final ? "final_val" : "sub_val"] 3358 | } 3359 | m48 = { 3360 | for field in lookup(local.merged_fields_by_depth, 47, {}): 3361 | field.key => {final_val = field.value, sub_val = { 3362 | for subfield in lookup(local.merged_fields_by_depth, 48, {}): 3363 | subfield.path[length(subfield.path) - 1] => lookup(local.m49, subfield.key, subfield.value) 3364 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3365 | }}[field.is_final ? "final_val" : "sub_val"] 3366 | } 3367 | m47 = { 3368 | for field in lookup(local.merged_fields_by_depth, 46, {}): 3369 | field.key => {final_val = field.value, sub_val = { 3370 | for subfield in lookup(local.merged_fields_by_depth, 47, {}): 3371 | subfield.path[length(subfield.path) - 1] => lookup(local.m48, subfield.key, subfield.value) 3372 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3373 | }}[field.is_final ? "final_val" : "sub_val"] 3374 | } 3375 | m46 = { 3376 | for field in lookup(local.merged_fields_by_depth, 45, {}): 3377 | field.key => {final_val = field.value, sub_val = { 3378 | for subfield in lookup(local.merged_fields_by_depth, 46, {}): 3379 | subfield.path[length(subfield.path) - 1] => lookup(local.m47, subfield.key, subfield.value) 3380 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3381 | }}[field.is_final ? "final_val" : "sub_val"] 3382 | } 3383 | m45 = { 3384 | for field in lookup(local.merged_fields_by_depth, 44, {}): 3385 | field.key => {final_val = field.value, sub_val = { 3386 | for subfield in lookup(local.merged_fields_by_depth, 45, {}): 3387 | subfield.path[length(subfield.path) - 1] => lookup(local.m46, subfield.key, subfield.value) 3388 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3389 | }}[field.is_final ? "final_val" : "sub_val"] 3390 | } 3391 | m44 = { 3392 | for field in lookup(local.merged_fields_by_depth, 43, {}): 3393 | field.key => {final_val = field.value, sub_val = { 3394 | for subfield in lookup(local.merged_fields_by_depth, 44, {}): 3395 | subfield.path[length(subfield.path) - 1] => lookup(local.m45, subfield.key, subfield.value) 3396 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3397 | }}[field.is_final ? "final_val" : "sub_val"] 3398 | } 3399 | m43 = { 3400 | for field in lookup(local.merged_fields_by_depth, 42, {}): 3401 | field.key => {final_val = field.value, sub_val = { 3402 | for subfield in lookup(local.merged_fields_by_depth, 43, {}): 3403 | subfield.path[length(subfield.path) - 1] => lookup(local.m44, subfield.key, subfield.value) 3404 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3405 | }}[field.is_final ? "final_val" : "sub_val"] 3406 | } 3407 | m42 = { 3408 | for field in lookup(local.merged_fields_by_depth, 41, {}): 3409 | field.key => {final_val = field.value, sub_val = { 3410 | for subfield in lookup(local.merged_fields_by_depth, 42, {}): 3411 | subfield.path[length(subfield.path) - 1] => lookup(local.m43, subfield.key, subfield.value) 3412 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3413 | }}[field.is_final ? "final_val" : "sub_val"] 3414 | } 3415 | m41 = { 3416 | for field in lookup(local.merged_fields_by_depth, 40, {}): 3417 | field.key => {final_val = field.value, sub_val = { 3418 | for subfield in lookup(local.merged_fields_by_depth, 41, {}): 3419 | subfield.path[length(subfield.path) - 1] => lookup(local.m42, subfield.key, subfield.value) 3420 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3421 | }}[field.is_final ? "final_val" : "sub_val"] 3422 | } 3423 | m40 = { 3424 | for field in lookup(local.merged_fields_by_depth, 39, {}): 3425 | field.key => {final_val = field.value, sub_val = { 3426 | for subfield in lookup(local.merged_fields_by_depth, 40, {}): 3427 | subfield.path[length(subfield.path) - 1] => lookup(local.m41, subfield.key, subfield.value) 3428 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3429 | }}[field.is_final ? "final_val" : "sub_val"] 3430 | } 3431 | m39 = { 3432 | for field in lookup(local.merged_fields_by_depth, 38, {}): 3433 | field.key => {final_val = field.value, sub_val = { 3434 | for subfield in lookup(local.merged_fields_by_depth, 39, {}): 3435 | subfield.path[length(subfield.path) - 1] => lookup(local.m40, subfield.key, subfield.value) 3436 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3437 | }}[field.is_final ? "final_val" : "sub_val"] 3438 | } 3439 | m38 = { 3440 | for field in lookup(local.merged_fields_by_depth, 37, {}): 3441 | field.key => {final_val = field.value, sub_val = { 3442 | for subfield in lookup(local.merged_fields_by_depth, 38, {}): 3443 | subfield.path[length(subfield.path) - 1] => lookup(local.m39, subfield.key, subfield.value) 3444 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3445 | }}[field.is_final ? "final_val" : "sub_val"] 3446 | } 3447 | m37 = { 3448 | for field in lookup(local.merged_fields_by_depth, 36, {}): 3449 | field.key => {final_val = field.value, sub_val = { 3450 | for subfield in lookup(local.merged_fields_by_depth, 37, {}): 3451 | subfield.path[length(subfield.path) - 1] => lookup(local.m38, subfield.key, subfield.value) 3452 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3453 | }}[field.is_final ? "final_val" : "sub_val"] 3454 | } 3455 | m36 = { 3456 | for field in lookup(local.merged_fields_by_depth, 35, {}): 3457 | field.key => {final_val = field.value, sub_val = { 3458 | for subfield in lookup(local.merged_fields_by_depth, 36, {}): 3459 | subfield.path[length(subfield.path) - 1] => lookup(local.m37, subfield.key, subfield.value) 3460 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3461 | }}[field.is_final ? "final_val" : "sub_val"] 3462 | } 3463 | m35 = { 3464 | for field in lookup(local.merged_fields_by_depth, 34, {}): 3465 | field.key => {final_val = field.value, sub_val = { 3466 | for subfield in lookup(local.merged_fields_by_depth, 35, {}): 3467 | subfield.path[length(subfield.path) - 1] => lookup(local.m36, subfield.key, subfield.value) 3468 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3469 | }}[field.is_final ? "final_val" : "sub_val"] 3470 | } 3471 | m34 = { 3472 | for field in lookup(local.merged_fields_by_depth, 33, {}): 3473 | field.key => {final_val = field.value, sub_val = { 3474 | for subfield in lookup(local.merged_fields_by_depth, 34, {}): 3475 | subfield.path[length(subfield.path) - 1] => lookup(local.m35, subfield.key, subfield.value) 3476 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3477 | }}[field.is_final ? "final_val" : "sub_val"] 3478 | } 3479 | m33 = { 3480 | for field in lookup(local.merged_fields_by_depth, 32, {}): 3481 | field.key => {final_val = field.value, sub_val = { 3482 | for subfield in lookup(local.merged_fields_by_depth, 33, {}): 3483 | subfield.path[length(subfield.path) - 1] => lookup(local.m34, subfield.key, subfield.value) 3484 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3485 | }}[field.is_final ? "final_val" : "sub_val"] 3486 | } 3487 | m32 = { 3488 | for field in lookup(local.merged_fields_by_depth, 31, {}): 3489 | field.key => {final_val = field.value, sub_val = { 3490 | for subfield in lookup(local.merged_fields_by_depth, 32, {}): 3491 | subfield.path[length(subfield.path) - 1] => lookup(local.m33, subfield.key, subfield.value) 3492 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3493 | }}[field.is_final ? "final_val" : "sub_val"] 3494 | } 3495 | m31 = { 3496 | for field in lookup(local.merged_fields_by_depth, 30, {}): 3497 | field.key => {final_val = field.value, sub_val = { 3498 | for subfield in lookup(local.merged_fields_by_depth, 31, {}): 3499 | subfield.path[length(subfield.path) - 1] => lookup(local.m32, subfield.key, subfield.value) 3500 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3501 | }}[field.is_final ? "final_val" : "sub_val"] 3502 | } 3503 | m30 = { 3504 | for field in lookup(local.merged_fields_by_depth, 29, {}): 3505 | field.key => {final_val = field.value, sub_val = { 3506 | for subfield in lookup(local.merged_fields_by_depth, 30, {}): 3507 | subfield.path[length(subfield.path) - 1] => lookup(local.m31, subfield.key, subfield.value) 3508 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3509 | }}[field.is_final ? "final_val" : "sub_val"] 3510 | } 3511 | m29 = { 3512 | for field in lookup(local.merged_fields_by_depth, 28, {}): 3513 | field.key => {final_val = field.value, sub_val = { 3514 | for subfield in lookup(local.merged_fields_by_depth, 29, {}): 3515 | subfield.path[length(subfield.path) - 1] => lookup(local.m30, subfield.key, subfield.value) 3516 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3517 | }}[field.is_final ? "final_val" : "sub_val"] 3518 | } 3519 | m28 = { 3520 | for field in lookup(local.merged_fields_by_depth, 27, {}): 3521 | field.key => {final_val = field.value, sub_val = { 3522 | for subfield in lookup(local.merged_fields_by_depth, 28, {}): 3523 | subfield.path[length(subfield.path) - 1] => lookup(local.m29, subfield.key, subfield.value) 3524 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3525 | }}[field.is_final ? "final_val" : "sub_val"] 3526 | } 3527 | m27 = { 3528 | for field in lookup(local.merged_fields_by_depth, 26, {}): 3529 | field.key => {final_val = field.value, sub_val = { 3530 | for subfield in lookup(local.merged_fields_by_depth, 27, {}): 3531 | subfield.path[length(subfield.path) - 1] => lookup(local.m28, subfield.key, subfield.value) 3532 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3533 | }}[field.is_final ? "final_val" : "sub_val"] 3534 | } 3535 | m26 = { 3536 | for field in lookup(local.merged_fields_by_depth, 25, {}): 3537 | field.key => {final_val = field.value, sub_val = { 3538 | for subfield in lookup(local.merged_fields_by_depth, 26, {}): 3539 | subfield.path[length(subfield.path) - 1] => lookup(local.m27, subfield.key, subfield.value) 3540 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3541 | }}[field.is_final ? "final_val" : "sub_val"] 3542 | } 3543 | m25 = { 3544 | for field in lookup(local.merged_fields_by_depth, 24, {}): 3545 | field.key => {final_val = field.value, sub_val = { 3546 | for subfield in lookup(local.merged_fields_by_depth, 25, {}): 3547 | subfield.path[length(subfield.path) - 1] => lookup(local.m26, subfield.key, subfield.value) 3548 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3549 | }}[field.is_final ? "final_val" : "sub_val"] 3550 | } 3551 | m24 = { 3552 | for field in lookup(local.merged_fields_by_depth, 23, {}): 3553 | field.key => {final_val = field.value, sub_val = { 3554 | for subfield in lookup(local.merged_fields_by_depth, 24, {}): 3555 | subfield.path[length(subfield.path) - 1] => lookup(local.m25, subfield.key, subfield.value) 3556 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3557 | }}[field.is_final ? "final_val" : "sub_val"] 3558 | } 3559 | m23 = { 3560 | for field in lookup(local.merged_fields_by_depth, 22, {}): 3561 | field.key => {final_val = field.value, sub_val = { 3562 | for subfield in lookup(local.merged_fields_by_depth, 23, {}): 3563 | subfield.path[length(subfield.path) - 1] => lookup(local.m24, subfield.key, subfield.value) 3564 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3565 | }}[field.is_final ? "final_val" : "sub_val"] 3566 | } 3567 | m22 = { 3568 | for field in lookup(local.merged_fields_by_depth, 21, {}): 3569 | field.key => {final_val = field.value, sub_val = { 3570 | for subfield in lookup(local.merged_fields_by_depth, 22, {}): 3571 | subfield.path[length(subfield.path) - 1] => lookup(local.m23, subfield.key, subfield.value) 3572 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3573 | }}[field.is_final ? "final_val" : "sub_val"] 3574 | } 3575 | m21 = { 3576 | for field in lookup(local.merged_fields_by_depth, 20, {}): 3577 | field.key => {final_val = field.value, sub_val = { 3578 | for subfield in lookup(local.merged_fields_by_depth, 21, {}): 3579 | subfield.path[length(subfield.path) - 1] => lookup(local.m22, subfield.key, subfield.value) 3580 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3581 | }}[field.is_final ? "final_val" : "sub_val"] 3582 | } 3583 | m20 = { 3584 | for field in lookup(local.merged_fields_by_depth, 19, {}): 3585 | field.key => {final_val = field.value, sub_val = { 3586 | for subfield in lookup(local.merged_fields_by_depth, 20, {}): 3587 | subfield.path[length(subfield.path) - 1] => lookup(local.m21, subfield.key, subfield.value) 3588 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3589 | }}[field.is_final ? "final_val" : "sub_val"] 3590 | } 3591 | m19 = { 3592 | for field in lookup(local.merged_fields_by_depth, 18, {}): 3593 | field.key => {final_val = field.value, sub_val = { 3594 | for subfield in lookup(local.merged_fields_by_depth, 19, {}): 3595 | subfield.path[length(subfield.path) - 1] => lookup(local.m20, subfield.key, subfield.value) 3596 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3597 | }}[field.is_final ? "final_val" : "sub_val"] 3598 | } 3599 | m18 = { 3600 | for field in lookup(local.merged_fields_by_depth, 17, {}): 3601 | field.key => {final_val = field.value, sub_val = { 3602 | for subfield in lookup(local.merged_fields_by_depth, 18, {}): 3603 | subfield.path[length(subfield.path) - 1] => lookup(local.m19, subfield.key, subfield.value) 3604 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3605 | }}[field.is_final ? "final_val" : "sub_val"] 3606 | } 3607 | m17 = { 3608 | for field in lookup(local.merged_fields_by_depth, 16, {}): 3609 | field.key => {final_val = field.value, sub_val = { 3610 | for subfield in lookup(local.merged_fields_by_depth, 17, {}): 3611 | subfield.path[length(subfield.path) - 1] => lookup(local.m18, subfield.key, subfield.value) 3612 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3613 | }}[field.is_final ? "final_val" : "sub_val"] 3614 | } 3615 | m16 = { 3616 | for field in lookup(local.merged_fields_by_depth, 15, {}): 3617 | field.key => {final_val = field.value, sub_val = { 3618 | for subfield in lookup(local.merged_fields_by_depth, 16, {}): 3619 | subfield.path[length(subfield.path) - 1] => lookup(local.m17, subfield.key, subfield.value) 3620 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3621 | }}[field.is_final ? "final_val" : "sub_val"] 3622 | } 3623 | m15 = { 3624 | for field in lookup(local.merged_fields_by_depth, 14, {}): 3625 | field.key => {final_val = field.value, sub_val = { 3626 | for subfield in lookup(local.merged_fields_by_depth, 15, {}): 3627 | subfield.path[length(subfield.path) - 1] => lookup(local.m16, subfield.key, subfield.value) 3628 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3629 | }}[field.is_final ? "final_val" : "sub_val"] 3630 | } 3631 | m14 = { 3632 | for field in lookup(local.merged_fields_by_depth, 13, {}): 3633 | field.key => {final_val = field.value, sub_val = { 3634 | for subfield in lookup(local.merged_fields_by_depth, 14, {}): 3635 | subfield.path[length(subfield.path) - 1] => lookup(local.m15, subfield.key, subfield.value) 3636 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3637 | }}[field.is_final ? "final_val" : "sub_val"] 3638 | } 3639 | m13 = { 3640 | for field in lookup(local.merged_fields_by_depth, 12, {}): 3641 | field.key => {final_val = field.value, sub_val = { 3642 | for subfield in lookup(local.merged_fields_by_depth, 13, {}): 3643 | subfield.path[length(subfield.path) - 1] => lookup(local.m14, subfield.key, subfield.value) 3644 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3645 | }}[field.is_final ? "final_val" : "sub_val"] 3646 | } 3647 | m12 = { 3648 | for field in lookup(local.merged_fields_by_depth, 11, {}): 3649 | field.key => {final_val = field.value, sub_val = { 3650 | for subfield in lookup(local.merged_fields_by_depth, 12, {}): 3651 | subfield.path[length(subfield.path) - 1] => lookup(local.m13, subfield.key, subfield.value) 3652 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3653 | }}[field.is_final ? "final_val" : "sub_val"] 3654 | } 3655 | m11 = { 3656 | for field in lookup(local.merged_fields_by_depth, 10, {}): 3657 | field.key => {final_val = field.value, sub_val = { 3658 | for subfield in lookup(local.merged_fields_by_depth, 11, {}): 3659 | subfield.path[length(subfield.path) - 1] => lookup(local.m12, subfield.key, subfield.value) 3660 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3661 | }}[field.is_final ? "final_val" : "sub_val"] 3662 | } 3663 | m10 = { 3664 | for field in lookup(local.merged_fields_by_depth, 9, {}): 3665 | field.key => {final_val = field.value, sub_val = { 3666 | for subfield in lookup(local.merged_fields_by_depth, 10, {}): 3667 | subfield.path[length(subfield.path) - 1] => lookup(local.m11, subfield.key, subfield.value) 3668 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3669 | }}[field.is_final ? "final_val" : "sub_val"] 3670 | } 3671 | m9 = { 3672 | for field in lookup(local.merged_fields_by_depth, 8, {}): 3673 | field.key => {final_val = field.value, sub_val = { 3674 | for subfield in lookup(local.merged_fields_by_depth, 9, {}): 3675 | subfield.path[length(subfield.path) - 1] => lookup(local.m10, subfield.key, subfield.value) 3676 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3677 | }}[field.is_final ? "final_val" : "sub_val"] 3678 | } 3679 | m8 = { 3680 | for field in lookup(local.merged_fields_by_depth, 7, {}): 3681 | field.key => {final_val = field.value, sub_val = { 3682 | for subfield in lookup(local.merged_fields_by_depth, 8, {}): 3683 | subfield.path[length(subfield.path) - 1] => lookup(local.m9, subfield.key, subfield.value) 3684 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3685 | }}[field.is_final ? "final_val" : "sub_val"] 3686 | } 3687 | m7 = { 3688 | for field in lookup(local.merged_fields_by_depth, 6, {}): 3689 | field.key => {final_val = field.value, sub_val = { 3690 | for subfield in lookup(local.merged_fields_by_depth, 7, {}): 3691 | subfield.path[length(subfield.path) - 1] => lookup(local.m8, subfield.key, subfield.value) 3692 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3693 | }}[field.is_final ? "final_val" : "sub_val"] 3694 | } 3695 | m6 = { 3696 | for field in lookup(local.merged_fields_by_depth, 5, {}): 3697 | field.key => {final_val = field.value, sub_val = { 3698 | for subfield in lookup(local.merged_fields_by_depth, 6, {}): 3699 | subfield.path[length(subfield.path) - 1] => lookup(local.m7, subfield.key, subfield.value) 3700 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3701 | }}[field.is_final ? "final_val" : "sub_val"] 3702 | } 3703 | m5 = { 3704 | for field in lookup(local.merged_fields_by_depth, 4, {}): 3705 | field.key => {final_val = field.value, sub_val = { 3706 | for subfield in lookup(local.merged_fields_by_depth, 5, {}): 3707 | subfield.path[length(subfield.path) - 1] => lookup(local.m6, subfield.key, subfield.value) 3708 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3709 | }}[field.is_final ? "final_val" : "sub_val"] 3710 | } 3711 | m4 = { 3712 | for field in lookup(local.merged_fields_by_depth, 3, {}): 3713 | field.key => {final_val = field.value, sub_val = { 3714 | for subfield in lookup(local.merged_fields_by_depth, 4, {}): 3715 | subfield.path[length(subfield.path) - 1] => lookup(local.m5, subfield.key, subfield.value) 3716 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3717 | }}[field.is_final ? "final_val" : "sub_val"] 3718 | } 3719 | m3 = { 3720 | for field in lookup(local.merged_fields_by_depth, 2, {}): 3721 | field.key => {final_val = field.value, sub_val = { 3722 | for subfield in lookup(local.merged_fields_by_depth, 3, {}): 3723 | subfield.path[length(subfield.path) - 1] => lookup(local.m4, subfield.key, subfield.value) 3724 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3725 | }}[field.is_final ? "final_val" : "sub_val"] 3726 | } 3727 | m2 = { 3728 | for field in lookup(local.merged_fields_by_depth, 1, {}): 3729 | field.key => {final_val = field.value, sub_val = { 3730 | for subfield in lookup(local.merged_fields_by_depth, 2, {}): 3731 | subfield.path[length(subfield.path) - 1] => lookup(local.m3, subfield.key, subfield.value) 3732 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3733 | }}[field.is_final ? "final_val" : "sub_val"] 3734 | } 3735 | m1 = { 3736 | for field in lookup(local.merged_fields_by_depth, 0, {}): 3737 | field.key => {final_val = field.value, sub_val = { 3738 | for subfield in lookup(local.merged_fields_by_depth, 1, {}): 3739 | subfield.path[length(subfield.path) - 1] => lookup(local.m2, subfield.key, subfield.value) 3740 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 3741 | }}[field.is_final ? "final_val" : "sub_val"] 3742 | } 3743 | } 3744 | -------------------------------------------------------------------------------- /depth.tmpl: -------------------------------------------------------------------------------- 1 | locals { 2 | mod0toparse = [ 3 | for map_idx in range(0, length(local.input_maps)): 4 | [{ 5 | path = [], 6 | value = local.input_maps[map_idx] 7 | }] 8 | ] 9 | %{ for depth in range(0, max_depth + 1) ~} 10 | mod${depth} = [ 11 | for map_idx in range(0, length(local.input_maps)): 12 | { 13 | fields = concat([], [ 14 | for item in ${depth == 0 ? "local.mod${depth}toparse[map_idx]" : "local.mod${depth - 1}[map_idx].remaining"}: 15 | [ 16 | for key in keys(item["value"]): 17 | { 18 | key = jsonencode(concat(item["path"], [key])), 19 | path = concat(item["path"], [key]), 20 | value = item["value"][key], 21 | is_final = item["value"][key] == null || !can(keys(item["value"][key])) 22 | } 23 | ] 24 | ]...) 25 | remaining = concat([], [ 26 | for item in ${depth == 0 ? "local.mod${depth}toparse[map_idx]" : "local.mod${depth - 1}[map_idx].remaining"}: 27 | [ 28 | for key in keys(item["value"]): 29 | { 30 | path = concat(item["path"], [key]), 31 | value = item["value"][key] 32 | } 33 | if item["value"][key] != null && can(keys(item["value"][key])) 34 | ] 35 | ]...) 36 | } 37 | ] 38 | %{ endfor ~} 39 | 40 | modules = [ 41 | %{ for depth in range(0, max_depth + 1) ~} 42 | local.mod${depth}, 43 | %{ endfor ~} 44 | ] 45 | 46 | m${max_depth + 1} = {} 47 | %{ for depth in range(max_depth, 0, -1) ~} 48 | m${depth} = { 49 | for field in lookup(local.merged_fields_by_depth, ${depth - 1}, {}): 50 | field.key => {final_val = field.value, sub_val = { 51 | for subfield in lookup(local.merged_fields_by_depth, ${depth}, {}): 52 | subfield.path[length(subfield.path) - 1] => lookup(local.m${depth + 1}, subfield.key, subfield.value) 53 | if slice(subfield.path, 0, length(subfield.path) - 1) == field.path 54 | }}[field.is_final ? "final_val" : "sub_val"] 55 | } 56 | %{ endfor ~} 57 | } 58 | -------------------------------------------------------------------------------- /examples/example-1/README.md: -------------------------------------------------------------------------------- 1 | # Example 1 2 | This example will output the following: 3 | ``` 4 | merged = { 5 | "key1-1" = { 6 | "key1-1-1" = "value1-1-1(overwrite)" 7 | "key1-1-2" = "value1-1-2" 8 | "key1-1-3" = { 9 | "key1-1-3-1" = "value1-1-3-1" 10 | "key1-1-3-2" = "value1-1-3-2(overwrite)" 11 | "key1-1-3-3" = { 12 | "key1-1-3-3-1" = "value1-1-3-3-1" 13 | } 14 | } 15 | "key1-1-4" = "value1-1-4" 16 | } 17 | "key1-2" = { 18 | "key1-2-1" = "value1-2-1" 19 | "key1-2-2" = "value1-2-2" 20 | "key1-2-3" = { 21 | "key1-2-3-1" = "value1-2-3-1" 22 | "key1-2-3-2" = "value1-2-3-2" 23 | } 24 | } 25 | "key1-3" = "value1-3(double-overwrite)" 26 | } 27 | ``` -------------------------------------------------------------------------------- /examples/example-1/main.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | map1 = { 3 | key1-1 = { 4 | key1-1-1 = "value1-1-1" 5 | key1-1-2 = "value1-1-2" 6 | key1-1-3 = { 7 | key1-1-3-1 = "value1-1-3-1" 8 | key1-1-3-2 = "value1-1-3-2" 9 | } 10 | } 11 | key1-2 = "value1-2" 12 | key1-3 = { 13 | key1-3-1 = "value1-3-1" 14 | key1-3-2 = "value1-3-2" 15 | } 16 | } 17 | 18 | map2 = { 19 | key1-1 = { 20 | key1-1-1 = "value1-1-1(overwrite)" 21 | key1-1-3 = { 22 | key1-1-3-2 = "value1-1-3-2(overwrite)" 23 | key1-1-3-3 = { 24 | key1-1-3-3-1 = "value1-1-3-3-1" 25 | } 26 | } 27 | key1-1-4 = "value1-1-4" 28 | } 29 | key1-2 = { 30 | key1-2-1 = "value1-2-1" 31 | key1-2-2 = "value1-2-2" 32 | key1-2-3 = { 33 | key1-2-3-1 = "value1-2-3-1" 34 | } 35 | } 36 | key1-3 = "value1-3(overwrite)" 37 | } 38 | 39 | map3 = { 40 | key1-3 = "value1-3(double-overwrite)" 41 | key1-2 = { 42 | key1-2-3 = { 43 | key1-2-3-2 = "value1-2-3-2" 44 | } 45 | } 46 | } 47 | } 48 | 49 | module "deepmerge" { 50 | source = "Invicton-Labs/deepmerge/null" 51 | maps = [ 52 | local.map1, 53 | local.map2, 54 | local.map3 55 | ] 56 | } 57 | -------------------------------------------------------------------------------- /examples/example-1/outputs.tf: -------------------------------------------------------------------------------- 1 | output "merged" { 2 | description = "The merged map." 3 | value = module.deepmerge.merged 4 | } 5 | -------------------------------------------------------------------------------- /examples/example-1/variables.tf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Invicton-Labs/terraform-null-deepmerge/9a0c2880f77ef191383f1805abc287d07b577dbb/examples/example-1/variables.tf -------------------------------------------------------------------------------- /main.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | // If no maps are passed in, we have to provide a default empty map for this module to work with 3 | input_maps = concat(var.maps, length(var.maps) > 0 ? [] : [{}]) 4 | // Find the greatest depth through the maps 5 | greatest_depth = max(concat([1], [ 6 | for mod in local.modules : 7 | concat([ 8 | for i in range(0, length(local.input_maps)) : 9 | [ 10 | for f in mod[i].fields : 11 | length(f["path"]) 12 | ] 13 | ]...) 14 | ]...)...) 15 | 16 | // For each input map, convert it to a single-level map with a unique key for every nested value 17 | fields_json = [ 18 | for i in range(0, length(local.input_maps)) : 19 | merge([ 20 | for j in range(0, local.greatest_depth) : 21 | { 22 | for f in local.modules[j][i].fields : 23 | jsonencode(f.path) => f 24 | } 25 | ]...) 26 | ] 27 | 28 | // Merge the maps using the standard merge function, which will cause higher-precedence map values to overwrite lower-precedence map values 29 | merged_map = merge(local.fields_json...) 30 | 31 | // Split the merged fields into segments for each depth 32 | merged_fields_by_depth = { 33 | for depth in range(0, local.greatest_depth) : 34 | depth => { 35 | for key in keys(local.merged_map) : 36 | key => local.merged_map[key] 37 | if length(local.merged_map[key].path) == depth + 1 38 | } 39 | } 40 | // The lowest level of the re-assembled map is special and not part of the auto-generated depth.tf file 41 | m0 = { 42 | for field in local.merged_fields_by_depth[0] : 43 | field.path[0] => { final_val = field.value, sub_val = lookup(local.m1, field.key, null) }[field.is_final ? "final_val" : "sub_val"] 44 | } 45 | } 46 | 47 | // Check to make sure the highest level module has no remaining values that weren't recursed through 48 | module "asset_sufficient_levels" { 49 | source = "Invicton-Labs/assertion/null" 50 | version = "~>0.2.7" 51 | error_message = "Deepmerge has recursed to insufficient depth (${length(local.modules)} levels is not enough)" 52 | condition = length([ 53 | for i in range(0, length(local.input_maps)) : 54 | true 55 | if length(local.modules[length(local.modules) - 1][i].remaining) > 0 56 | ]) == 0 57 | } 58 | 59 | // Use this from a DIFFERENT terraform project to generate a new file with a different max depth 60 | /* 61 | resource "local_file" "depth" { 62 | content = templatefile("${path.module}/../deepmerge/depth.tmpl", {max_depth = 100}) 63 | filename = "${path.module}/../deepmerge/depth.tf" 64 | } 65 | */ 66 | -------------------------------------------------------------------------------- /outputs.tf: -------------------------------------------------------------------------------- 1 | output "merged" { 2 | description = "The merged map." 3 | value = module.asset_sufficient_levels.checked ? local.m0 : null 4 | } 5 | -------------------------------------------------------------------------------- /tests.tftest.hcl: -------------------------------------------------------------------------------- 1 | run "test_1" { 2 | command = plan 3 | variables { 4 | maps = [ 5 | { 6 | a = "1" 7 | b = 2 8 | }, 9 | { 10 | a = 3 11 | c = 4 12 | } 13 | ] 14 | } 15 | assert { 16 | condition = output.merged == { 17 | a = 3 18 | b = 2 19 | c = 4 20 | } 21 | error_message = "Unexpected output: ${jsonencode(output.merged)}" 22 | } 23 | } 24 | 25 | run "test_2" { 26 | command = plan 27 | variables { 28 | maps = [ 29 | { 30 | key1-1 = { 31 | key1-1-1 = "value1-1-1" 32 | key1-1-2 = "value1-1-2" 33 | key1-1-3 = { 34 | key1-1-3-1 = "value1-1-3-1" 35 | key1-1-3-2 = "value1-1-3-2" 36 | } 37 | } 38 | key1-2 = "value1-2" 39 | key1-3 = { 40 | key1-3-1 = "value1-3-1" 41 | key1-3-2 = "value1-3-2" 42 | } 43 | }, 44 | { 45 | key1-1 = { 46 | key1-1-1 = "value1-1-1(overwrite)" 47 | key1-1-3 = { 48 | key1-1-3-2 = "value1-1-3-2(overwrite)" 49 | key1-1-3-3 = { 50 | key1-1-3-3-1 = "value1-1-3-3-1" 51 | } 52 | } 53 | key1-1-4 = "value1-1-4" 54 | } 55 | key1-2 = { 56 | key1-2-1 = "value1-2-1" 57 | key1-2-2 = "value1-2-2" 58 | key1-2-3 = { 59 | key1-2-3-1 = "value1-2-3-1" 60 | } 61 | } 62 | key1-3 = "value1-3(overwrite)" 63 | }, 64 | { 65 | key1-3 = "value1-3(double-overwrite)" 66 | key1-2 = { 67 | key1-2-3 = { 68 | key1-2-3-2 = "value1-2-3-2" 69 | } 70 | } 71 | } 72 | ] 73 | } 74 | assert { 75 | condition = output.merged == { 76 | "key1-1" = { 77 | "key1-1-1" = "value1-1-1(overwrite)" 78 | "key1-1-2" = "value1-1-2" 79 | "key1-1-3" = { 80 | "key1-1-3-1" = "value1-1-3-1" 81 | "key1-1-3-2" = "value1-1-3-2(overwrite)" 82 | "key1-1-3-3" = { 83 | "key1-1-3-3-1" = "value1-1-3-3-1" 84 | } 85 | } 86 | "key1-1-4" = "value1-1-4" 87 | } 88 | "key1-2" = { 89 | "key1-2-1" = "value1-2-1" 90 | "key1-2-2" = "value1-2-2" 91 | "key1-2-3" = { 92 | "key1-2-3-1" = "value1-2-3-1" 93 | "key1-2-3-2" = "value1-2-3-2" 94 | } 95 | } 96 | "key1-3" = "value1-3(double-overwrite)" 97 | } 98 | error_message = "Unexpected output: ${jsonencode(output.merged)}" 99 | } 100 | } 101 | 102 | // https://github.com/Invicton-Labs/terraform-null-deepmerge/issues/2 103 | run "test_3" { 104 | command = plan 105 | variables { 106 | maps = [ 107 | { 108 | b = { 109 | "fubar" : [ 110 | { 111 | "name" : "foo", 112 | "prefixes" : ["item1", "item2"] 113 | }, 114 | { 115 | "name" : "bar", 116 | "prefixes" : null 117 | } 118 | ] 119 | } 120 | }, 121 | { 122 | arr = [ 123 | { 124 | foo = {} 125 | bar = "bar" 126 | }, 127 | { 128 | foo = {} 129 | baz = "baz" 130 | }, 131 | ] 132 | } 133 | ] 134 | } 135 | assert { 136 | condition = output.merged == { 137 | b = { 138 | "fubar" : [ 139 | { 140 | "name" : "foo", 141 | "prefixes" : ["item1", "item2"] 142 | }, 143 | { 144 | "name" : "bar", 145 | "prefixes" : null 146 | } 147 | ] 148 | } 149 | arr = [ 150 | { 151 | foo = {} 152 | bar = "bar" 153 | }, 154 | { 155 | foo = {} 156 | baz = "baz" 157 | }, 158 | ] 159 | } 160 | error_message = "Unexpected output: ${jsonencode(output.merged)}" 161 | } 162 | } 163 | 164 | // https://github.com/Invicton-Labs/terraform-null-deepmerge/issues/5 165 | run "test_4" { 166 | command = plan 167 | variables { 168 | maps = [ 169 | yamldecode(<