Skip to content

Commit

Permalink
Fix host encryption issue in Terraform variables
Browse files Browse the repository at this point in the history
  • Loading branch information
heoelri committed Apr 25, 2024
1 parent c236276 commit 2511ca8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
14 changes: 1 addition & 13 deletions src/infra/workload/releaseunit/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ provider "azurerm" {
prevent_deletion_if_contains_resources = false
}
}
skip_provider_registration = true
}

provider "azapi" {}
Expand All @@ -29,17 +30,4 @@ provider "azapi" {}
resource "random_password" "api_key" {
length = 32
special = false
}

# Register the compute resource provider with the EncryptionAtHost feature (optional)
resource "azurerm_resource_provider_registration" "compute" {
name = "Microsoft.Compute"

dynamic "feature" {
for_each = var.aks_enable_host_encryption ? [1] : []
content {
name = "EncryptionAtHost"
registered = true
}
}
}
10 changes: 7 additions & 3 deletions src/infra/workload/releaseunit/stamp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ module "stamp" {

vnet_address_space = module.stamp_addresses.network_cidr_blocks[each.value]

aks_kubernetes_version = var.aks_kubernetes_version # kubernetes version

prefix = local.prefix # handing over the resource prefix
default_tags = local.default_tags # handing over the resource tags
queued_by = var.queued_by
Expand All @@ -39,7 +37,9 @@ module "stamp" {
frontdoor_id_header = var.frontdoor_id_header
acr_name = var.acr_name

aks_enable_host_encryption = var.aks_enable_host_encryption
aks_kubernetes_version = var.aks_kubernetes_version # Defined kubernetes version

aks_enable_host_encryption = var.aks_enable_host_encryption # Enable host encryption

aks_system_node_pool_sku_size = var.aks_system_node_pool_sku_size
aks_system_node_pool_autoscale_minimum = var.aks_system_node_pool_autoscale_minimum
Expand All @@ -57,4 +57,8 @@ module "stamp" {
alerts_enabled = var.alerts_enabled
api_key = random_password.api_key.result
ai_adaptive_sampling = var.ai_adaptive_sampling

depends_on = [
azurerm_resource_provider_registration.compute
]
}

0 comments on commit 2511ca8

Please sign in to comment.