Skip to content

Commit

Permalink
main.tf file changes
Browse files Browse the repository at this point in the history
- Added lower case conversion function to do proper validation
- Regex to find if string starts  with "china"
- Updated zsec file to properly format the region list
  • Loading branch information
nmizhquirizs committed Jul 1, 2024
1 parent fd2a356 commit fd70d89
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion examples/base_1cc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ resource "local_file" "user_data_file" {

# Validates which Marketplace to use based on arm location
locals {
is_china = can(regex("^china", var.arm_location))
arm_location_lower_case = lower(var.arm_location)
is_china = can(regex("^china", local.arm_location_lower_case))
conditional_ccvm_image_publisher = local.is_china ? "cbcnetworks" : var.ccvm_image_publisher
conditional_ccvm_image_offer = local.is_china ? "zscaler-cloud-connector" : var.ccvm_image_offer
}
Expand Down
3 changes: 2 additions & 1 deletion examples/base_1cc_zpa/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ resource "local_file" "user_data_file" {

# Validates which Marketplace to use based on arm location
locals {
is_china = can(regex("^china", var.arm_location))
arm_location_lower_case = lower(var.arm_location)
is_china = can(regex("^china", local.arm_location_lower_case))
conditional_ccvm_image_publisher = local.is_china ? "cbcnetworks" : var.ccvm_image_publisher
conditional_ccvm_image_offer = local.is_china ? "zscaler-cloud-connector" : var.ccvm_image_offer
}
Expand Down
3 changes: 2 additions & 1 deletion examples/base_cc_lb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ resource "local_file" "user_data_file" {

# Validates which Marketplace to use based on arm location
locals {
is_china = can(regex("^china", var.arm_location))
arm_location_lower_case = lower(var.arm_location)
is_china = can(regex("^china", local.arm_location_lower_case))
conditional_ccvm_image_publisher = local.is_china ? "cbcnetworks" : var.ccvm_image_publisher
conditional_ccvm_image_offer = local.is_china ? "zscaler-cloud-connector" : var.ccvm_image_offer
}
Expand Down
3 changes: 2 additions & 1 deletion examples/base_cc_lb_zpa/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ resource "local_file" "user_data_file" {

# Validates which Marketplace to use based on arm location
locals {
is_china = can(regex("^china", var.arm_location))
arm_location_lower_case = lower(var.arm_location)
is_china = can(regex("^china", local.arm_location_lower_case))
conditional_ccvm_image_publisher = local.is_china ? "cbcnetworks" : var.ccvm_image_publisher
conditional_ccvm_image_offer = local.is_china ? "zscaler-cloud-connector" : var.ccvm_image_offer
}
Expand Down
4 changes: 2 additions & 2 deletions examples/zsec
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ first_run="yes"
"centraluseuap"
"chinaeast"
"chinaeast2"
"chinaeast3"
"chinaeast3"
"chinanorth"
"chinanorth2"
"chinanorth3"
Expand Down Expand Up @@ -209,7 +209,7 @@ first_run="yes"
"westcentralus"
"westeurope"
"westindia"
"westus"
"westus"
"westus2"
"westus3"
)
Expand Down

0 comments on commit fd70d89

Please sign in to comment.