Skip to content

Commit c5772c6

Browse files
committed
fix: update test file. update output.tf to correct outputs for Building Block integration
1 parent 4b983c6 commit c5772c6

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

modules/azure/vmss/buildingblock/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ resource "azurerm_windows_virtual_machine_scale_set" "vmss" {
244244
single_placement_group = var.single_placement_group
245245
zones = var.zones
246246
zone_balance = length(var.zones) > 0 ? true : false
247-
platform_fault_domain_count = var.single_placement_group ? 5 : 1
247+
platform_fault_domain_count = var.enable_spot_instances ? 1 : (var.single_placement_group ? 5 : 1)
248248
priority = var.enable_spot_instances ? "Spot" : "Regular"
249249
eviction_policy = var.enable_spot_instances ? var.spot_eviction_policy : null
250250
max_bid_price = var.enable_spot_instances ? var.spot_max_bid_price : null

modules/azure/vmss/buildingblock/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ output "load_balancer_frontend_ip" {
4444
}
4545

4646
output "public_ip_address" {
47-
value = var.enable_load_balancer && var.enable_public_ip ? azurerm_public_ip.lb_public_ip[0].ip_address : null
47+
value = var.enable_load_balancer && var.enable_public_ip ? azurerm_public_ip.lb_public_ip[0].ip_address : "no public IP assigned"
4848
description = "The public IP address of the load balancer (if enabled)"
4949
}
5050

modules/azure/vmss/buildingblock/vmss.tftest.hcl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
variables {
2-
vmss_name = "test-vmss"
3-
resource_group_name = "test-vmss-rg"
2+
vmss_name = "hcl-test-vmss"
3+
resource_group_name = "hcl-test-vmss-rg"
44
location = "germanywestcentral"
55
vnet_name = "spoke-vnet"
66
vnet_resource_group_name = "rg-vmss-test"
@@ -34,18 +34,19 @@ run "valid_linux_vmss" {
3434

3535
run "windows_vmss" {
3636
variables {
37-
vmss_name = "windows-vmss"
37+
vmss_name = "win-vmss"
3838
os_type = "Windows"
3939
sku = "Standard_B2s"
4040
instances = 3
4141
admin_password = "P@ssw0rd1234!"
4242
image_publisher = "MicrosoftWindowsServer"
4343
image_offer = "WindowsServer"
4444
image_sku = "2022-Datacenter"
45+
os_disk_size_gb = 128
4546
}
4647

4748
assert {
48-
condition = azurerm_windows_virtual_machine_scale_set.vmss[0].name == "windows-vmss"
49+
condition = azurerm_windows_virtual_machine_scale_set.vmss[0].name == "win-vmss"
4950
error_message = "Windows VMSS name should match input"
5051
}
5152

@@ -267,6 +268,7 @@ run "vmss_with_rdp_access" {
267268
image_publisher = "MicrosoftWindowsServer"
268269
image_offer = "WindowsServer"
269270
image_sku = "2022-Datacenter"
271+
os_disk_size_gb = 127
270272
}
271273

272274
assert {

0 commit comments

Comments
 (0)