Skip to content

Commit

Permalink
let's regex and math right
Browse files Browse the repository at this point in the history
Co-Authored-By: James Gilmore <[email protected]>
  • Loading branch information
somesylvie and GilmoreA6 committed Oct 22, 2024
1 parent 7a13e2a commit 5e4ff03
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions operations/template/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ locals {
rs_domain_prefix = "${local.selected_rs_environment_prefix}${length(local.selected_rs_environment_prefix) == 0 ? "" : "."}"
higher_environment_level = var.environment == "stg" || var.environment == "prd"
cdc_domain_environment = var.environment == "dev" || var.environment == "stg" || var.environment == "prd"
// If the environment looks like pr123, regex will return matches. If there are no matches, it's a non-pr env
non_pr_environment = regex("pr\\d+", var.environment) != []

// If the environment looks like pr123, regexall will contain matches. If there are no matches, it's a non-pr env
non_pr_environment = length(regexall("pr\\d+", var.environment)) == 0
}

data "azurerm_resource_group" "group" {
Expand Down

0 comments on commit 5e4ff03

Please sign in to comment.