Skip to content

Commit

Permalink
Fix backend lookup error (#32)
Browse files Browse the repository at this point in the history
* Fix backend lookup error

* Auto Format

Co-authored-by: cloudpossebot <[email protected]>
  • Loading branch information
nitrocode and cloudpossebot authored Aug 6, 2021
1 parent 6ceffc6 commit 7361110
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/backend/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ locals {
base_component = try(local.config["components"][var.component_type][var.component]["component"], "")

final_component = coalesce(local.base_component, var.component)
backend_type = local.config["components"][var.component_type][local.final_component]["backend_type"]
backend = local.config["components"][var.component_type][local.final_component]["backend"]
backend_type = try(local.config["components"][var.component_type][local.final_component]["backend_type"], "")
backend = try(local.config["components"][var.component_type][local.final_component]["backend"], "")
}
3 changes: 2 additions & 1 deletion modules/remote-state/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ locals {
bypass = [{ outputs = var.defaults }]
}

outputs = local.remote_states[var.bypass ? "bypass" : local.backend_type][0].outputs
remote_state_backend_key = var.bypass ? "bypass" : local.backend_type
outputs = try(length(local.remote_state_backend_key), 0) > 0 ? local.remote_states[local.remote_state_backend_key][0].outputs : {}
}

0 comments on commit 7361110

Please sign in to comment.