Closed coderabbitai[bot] closed 1 week ago
The current implementation of the env variable uses a nested ternary operator, which can be complex and hard to read. To improve readability and maintainability, consider using a map-based approach.
env
locals { env_map = { "sandbox" = "sb" "non-production" = "non-prod" "production" = "prod" } env = lookup(local.env_map, var.environment, "none") }
This approach avoids nested ternary operators and makes it easier to extend in the future.
The current implementation of the
env
variable uses a nested ternary operator, which can be complex and hard to read. To improve readability and maintainability, consider using a map-based approach.Example Solution:
This approach avoids nested ternary operators and makes it easier to extend in the future.