Skip to content

Commit

Permalink
Update remote-state module (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
aknysh authored Jan 20, 2021
1 parent 5a96524 commit 0c86ac9
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions modules/remote-state/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,12 @@ module "backend_config" {
component_type = var.component_type
}

module "vars" {
source = "../vars"
config = var.config
component_type = var.component_type
component = var.component
}

locals {
backend_type = module.backend_config.backend_type
backend = module.backend_config.backend
vars = module.vars.vars

environment = coalesce(module.this.environment, local.vars.environment)
stage = coalesce(module.this.stage, local.vars.stage)

workspace_from_environment_stage = var.include_component_in_workspace_name ? format("%s-%s-%s", local.environment, local.stage, var.component) : (
format("%s-%s", local.environment, local.stage)
workspace_from_environment_stage = var.include_component_in_workspace_name ? format("%s-%s-%s", module.this.environment, module.this.stage, var.component) : (
format("%s-%s", module.this.environment, module.this.stage)
)

workspace = var.workspace != null ? var.workspace : (
Expand Down

0 comments on commit 0c86ac9

Please sign in to comment.