Skip to content

Commit 6b0235d

Browse files
committed
now using a boolean check for the sas keys rather than hard coding the environment (review)
1 parent 1bb06e5 commit 6b0235d

7 files changed

Lines changed: 20 additions & 5 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
enable_gateway_test_vm = true
2+
screening_entra_group_id = "14f915c3-ef0a-471b-b9bf-31187d18f8b6"
3+
enable_relay_sas_keys = true

infrastructure/modules/arc-infra/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ output "app_insights_connection_string" {
3737
output "relay_listen_sas_keys" {
3838
description = "Per-machine relay listen SAS primary keys, keyed by Arc resource name. Populated only for the review environment."
3939
sensitive = true
40-
value = var.enable_arc_servers && var.env_config == "review" ? {
40+
value = {
4141
for k, rule in azurerm_relay_hybrid_connection_authorization_rule.per_machine_listen :
4242
k => rule.primary_key
43-
} : {}
43+
}
4444
}

infrastructure/modules/arc-infra/relay.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ resource "azurerm_relay_hybrid_connection_authorization_rule" "per_machine_liste
5151
for_each = {
5252
for machine_name, machine_config in local.arc_machines :
5353
machine_name => machine_config
54-
if var.env_config == "review"
54+
if var.enable_relay_sas_keys
5555
}
5656

5757
name = "listen"

infrastructure/modules/arc-infra/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ variable "static_arc_machine_names" {
2828
type = list(string)
2929
default = []
3030
}
31+
32+
variable "enable_relay_sas_keys" {
33+
description = "Whether to create relay SAS keys for the Arc machines. Only used in the review environment."
34+
type = bool
35+
}

infrastructure/terraform/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module "arc_infra" {
1111
env_config = var.env_config
1212
resource_group_name = local.resource_group_name
1313
enable_arc_servers = var.enable_arc_servers
14+
enable_relay_sas_keys = var.enable_relay_sas_keys
1415

1516
# Create the HC for the test VM in the same run as VM creation.
1617
# The Arc data source won't see a machine registered in the same apply.

infrastructure/terraform/variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ variable "gateway_test_vm_size" {
5050
default = "Standard_B2s"
5151
}
5252

53+
variable "enable_relay_sas_keys" {
54+
description = "Whether to create relay SAS keys for the Arc machines"
55+
default = false
56+
type = bool
57+
}
58+
5359
locals {
5460
region = "uksouth"
5561
resource_group_name = "rg-${var.app_short_name}-${var.environment}-uks"
56-
}
62+
}

scripts/bash/deploy_arc_ring.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ LOG_LEVEL=INFO
100100
SAMPLE_IMAGES_PATH=${BASE_PATH}/current/sample_images"
101101

102102
if [[ -n "${RELAY_AUTH_BLOCK}" ]]; then
103-
ENV_CONTENT="${ENV_CONTENT}${RELAY_AUTH_BLOCK}"
103+
ENV_CONTENT="${ENV_CONTENT}
104+
${RELAY_AUTH_BLOCK}"
104105
fi
105106

106107
# Cross-platform base64 encoding (works on macOS and Linux)

0 commit comments

Comments
 (0)