From f8b4886f25607da7bfe6ff545098b5e42e30f0f2 Mon Sep 17 00:00:00 2001 From: bpontz-rh Date: Fri, 24 Apr 2026 09:01:57 -0400 Subject: [PATCH 1/3] New changes --- infrastructure/Azure/.terraform.lock.hcl | 17 ----------------- infrastructure/Azure/locals.tf | 18 ++++++++++++++---- infrastructure/Azure/main.tf | 2 +- infrastructure/Azure/terraform.tfvars | 8 ++++---- 4 files changed, 19 insertions(+), 26 deletions(-) diff --git a/infrastructure/Azure/.terraform.lock.hcl b/infrastructure/Azure/.terraform.lock.hcl index 8596c9d..25aef6c 100644 --- a/infrastructure/Azure/.terraform.lock.hcl +++ b/infrastructure/Azure/.terraform.lock.hcl @@ -18,23 +18,6 @@ provider "registry.opentofu.org/hashicorp/azurerm" { ] } -provider "registry.opentofu.org/hashicorp/time" { - version = "0.13.1" - hashes = [ - "h1:3X1jTAlLJV6G9AylC+BgX7WrKFcZYHqA+Z4JwB+v7as=", - "zh:10f32af8b544a039f19abd546e345d056a55cb7bdd69d5bbd7322cbc86883848", - "zh:35dd5beb34a9f73de8d0fed332814c69acae69397c9c065ce63ccd8315442bef", - "zh:56545d1dd5f2e7262e0c0c124264974229ec9cc234d0d7a0e36e14b869590f4a", - "zh:8d7259c3f819fd3470ff933c904b6a549502a8351feb1b5c040a4560decaf7e0", - "zh:a40f26878826b142e26fe193f7e3e14fc97f615cd6af140e88ce5bc25f3fcf50", - "zh:b2e82f25fecff172a9a9e24ea37d37e4fc630ee9245617cb40b10e66a6b979c8", - "zh:d4b699850a40ed07ef83c6b827605d24050b2732646ee017bda278e4ddf01c91", - "zh:e4e6a5e5614b6a54557400aabb748ebd57e947cdbd21ad1c7602c51368a80559", - "zh:eb78fb97bca22931e730487a20a90f5a6221ddfb3138aaf070737ea2b7c9c885", - "zh:faba366a1352ee679bba2a5b09c073c6854721db94b191d49b620b60946a065f", - ] -} - provider "registry.opentofu.org/hashicorp/tls" { version = "4.1.0" hashes = [ diff --git a/infrastructure/Azure/locals.tf b/infrastructure/Azure/locals.tf index ec8d9e0..30ca84a 100644 --- a/infrastructure/Azure/locals.tf +++ b/infrastructure/Azure/locals.tf @@ -1,5 +1,8 @@ # --- Local Values for Naming Convention --- locals { + workgroup_name_lower = lower(var.workgroup_name) + workgroup_name_alnum = replace(local.workgroup_name_lower, "-", "") + # Resource Group: {workgroup name}-rhino-{environment}-rg-{seq#} resource_group_name = "${var.workgroup_name}-rhino-${var.environment}-rg-${var.sequence_number}" @@ -12,10 +15,17 @@ locals { # Virtual Machine: {workgroup name}-rhino-{environment}-{seq#} vm_name = "${var.workgroup_name}-rhino-${var.environment}-${var.sequence_number}" - # Storage Accounts: {workgroup name}rhino{type}{seq#} (lowercase, no hyphens for Azure storage account naming) - storage_account_output_logs_name = "${replace(var.workgroup_name, "-", "")}rhinooutput${var.sequence_number}" - storage_account_source_data_name = "${replace(var.workgroup_name, "-", "")}rhinoinput${var.sequence_number}" - storage_account_logs_name = "${replace(var.workgroup_name, "-", "")}rhinolog${var.sequence_number}" + # Azure storage account names are limited to 24 lowercase alphanumeric characters. + storage_account_prefix_max_length = 24 - length(var.sequence_number) - 3 + storage_account_prefix = substr(local.workgroup_name_alnum, 0, local.storage_account_prefix_max_length) + storage_account_output_logs_name = "${local.storage_account_prefix}out${var.sequence_number}" + storage_account_source_data_name = "${local.storage_account_prefix}in${var.sequence_number}" + storage_account_logs_name = "${local.storage_account_prefix}log${var.sequence_number}" + + # Azure Key Vault names are limited to 24 characters and allow dashes. + key_vault_prefix_max_length = 24 - length(var.environment) - 7 + key_vault_prefix = trimsuffix(substr(local.workgroup_name_lower, 0, local.key_vault_prefix_max_length), "-") + key_vault_name = "${local.key_vault_prefix}-rh-${var.environment}-kv" # Standard tags for cost aggregation common_tags = { diff --git a/infrastructure/Azure/main.tf b/infrastructure/Azure/main.tf index 343763f..9ab5a56 100644 --- a/infrastructure/Azure/main.tf +++ b/infrastructure/Azure/main.tf @@ -273,7 +273,7 @@ resource "tls_private_key" "rhino" { # Create Key Vault resource "azurerm_key_vault" "main" { - name = "${var.workgroup_name}-rhino-${var.environment}-kv" + name = local.key_vault_name location = azurerm_resource_group.main.location resource_group_name = azurerm_resource_group.main.name tenant_id = var.tenant_id diff --git a/infrastructure/Azure/terraform.tfvars b/infrastructure/Azure/terraform.tfvars index 888ff73..599688f 100644 --- a/infrastructure/Azure/terraform.tfvars +++ b/infrastructure/Azure/terraform.tfvars @@ -1,10 +1,10 @@ location = "East US" -tenant_id = "your-tenant-id" # Replace with your actual tenant ID -subscription_id = "your-subscription-id" # Replace with your actual subscription ID +tenant_id = "02e2a2b7-0604-47c6-b2b2-0866ae5b7aac" # Replace with your actual tenant ID +subscription_id = "44604625-113d-4bfc-94dc-608200f1dff0" # Replace with your actual subscription ID # Naming Convention Variables -workgroup_name = "workgroup" -environment = "prod" +workgroup_name = "bpontz-azure-test" +environment = "dev" sequence_number = "1" # Network Configuration From 4e7675a6c4f5ba1c162e70e97df1291fe28a5f6e Mon Sep 17 00:00:00 2001 From: bpontz-rh Date: Mon, 27 Apr 2026 12:55:04 -0400 Subject: [PATCH 2/3] Changes for Azure --- infrastructure/Azure/main.tf | 4 +++- infrastructure/Azure/terraform.tfvars | 4 ++-- infrastructure/Azure/variables.tf | 12 ++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/infrastructure/Azure/main.tf b/infrastructure/Azure/main.tf index 9ab5a56..9f4fb58 100644 --- a/infrastructure/Azure/main.tf +++ b/infrastructure/Azure/main.tf @@ -384,8 +384,10 @@ resource "azurerm_linux_virtual_machine" "main" { } custom_data = base64encode(format( - "#!/bin/bash\ncurl -fsS --proto '=https' https://activate.rhinohealth.com | sudo RHINO_AGENT_ID='%s' PACKAGE_REGISTRY_USER='%s' PACKAGE_REGISTRY_PASSWORD='%s' SKIP_HW_CHECK=True bash -", + "#!/bin/bash\ncurl -fsS --proto '=https' https://activate.rhinohealth.com | sudo RHINO_AGENT_ID='%s' ROLE_ID='%s' SECRET_ID='%s' PACKAGE_REGISTRY_USER='%s' PACKAGE_REGISTRY_PASSWORD='%s' SKIP_HW_CHECK=True bash -", var.rhino_agent_id, + var.rhino_role_id, + var.rhino_secret_id, var.rhino_package_registry_user, var.rhino_package_registry_password )) diff --git a/infrastructure/Azure/terraform.tfvars b/infrastructure/Azure/terraform.tfvars index 599688f..23acd1a 100644 --- a/infrastructure/Azure/terraform.tfvars +++ b/infrastructure/Azure/terraform.tfvars @@ -1,4 +1,4 @@ -location = "East US" +location = "North Central US" tenant_id = "02e2a2b7-0604-47c6-b2b2-0866ae5b7aac" # Replace with your actual tenant ID subscription_id = "44604625-113d-4bfc-94dc-608200f1dff0" # Replace with your actual subscription ID @@ -14,7 +14,7 @@ ssh_source_ip_range = ["0.0.0.0/0"] # Allow from anywhere by default; restrict vm_ip_type = "public" # Options: "public", "nat" # VM Configuration -vm_size = "Standard_D4alds_v6" +vm_size = "Standard_D4s_v3" vm_image = "ubuntu-24_04-lts" # Rhino Specific Information diff --git a/infrastructure/Azure/variables.tf b/infrastructure/Azure/variables.tf index aeda460..8fd0ade 100644 --- a/infrastructure/Azure/variables.tf +++ b/infrastructure/Azure/variables.tf @@ -89,6 +89,18 @@ variable "rhino_agent_id" { sensitive = true } +variable "rhino_role_id" { + description = "The role ID for the Rhino Health installation." + type = string + sensitive = true +} + +variable "rhino_secret_id" { + description = "The secret ID for the Rhino Health installation." + type = string + sensitive = true +} + variable "rhino_package_registry_user" { description = "The user for the Rhino Health package registry." type = string From 9624e4894a52faddde90f1c9cce2e3741e16bf4a Mon Sep 17 00:00:00 2001 From: bpontz-rh Date: Mon, 27 Apr 2026 13:14:41 -0400 Subject: [PATCH 3/3] Reverted file --- infrastructure/Azure/terraform.tfvars | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/infrastructure/Azure/terraform.tfvars b/infrastructure/Azure/terraform.tfvars index 23acd1a..888ff73 100644 --- a/infrastructure/Azure/terraform.tfvars +++ b/infrastructure/Azure/terraform.tfvars @@ -1,10 +1,10 @@ -location = "North Central US" -tenant_id = "02e2a2b7-0604-47c6-b2b2-0866ae5b7aac" # Replace with your actual tenant ID -subscription_id = "44604625-113d-4bfc-94dc-608200f1dff0" # Replace with your actual subscription ID +location = "East US" +tenant_id = "your-tenant-id" # Replace with your actual tenant ID +subscription_id = "your-subscription-id" # Replace with your actual subscription ID # Naming Convention Variables -workgroup_name = "bpontz-azure-test" -environment = "dev" +workgroup_name = "workgroup" +environment = "prod" sequence_number = "1" # Network Configuration @@ -14,7 +14,7 @@ ssh_source_ip_range = ["0.0.0.0/0"] # Allow from anywhere by default; restrict vm_ip_type = "public" # Options: "public", "nat" # VM Configuration -vm_size = "Standard_D4s_v3" +vm_size = "Standard_D4alds_v6" vm_image = "ubuntu-24_04-lts" # Rhino Specific Information