diff --git a/006_route_table/terraform.tfstate b/006_route_table/terraform.tfstate index e82dce3..971e01a 100644 --- a/006_route_table/terraform.tfstate +++ b/006_route_table/terraform.tfstate @@ -812,7 +812,7 @@ "resource_group_name": "rg-spoke-1-006", "secret": [], "secure_boot_enabled": false, - "size": "Standard_B2als_v2", + "size": "Standard_B2ats_v2", "source_image_id": "", "source_image_reference": [ { @@ -978,7 +978,7 @@ "resource_group_name": "rg-spoke-2-006", "secret": [], "secure_boot_enabled": false, - "size": "Standard_B2als_v2", + "size": "Standard_B2ats_v2", "source_image_id": "", "source_image_reference": [ { diff --git a/300_load_balancer_vm/vm.tf b/300_load_balancer_vm/vm.tf index 38f446f..7979cd8 100644 --- a/300_load_balancer_vm/vm.tf +++ b/300_load_balancer_vm/vm.tf @@ -16,11 +16,13 @@ resource "azurerm_linux_virtual_machine" "vm" { name = "vm-linux" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - size = "Standard_B2als_v2" + size = "Standard_B2ats_v2" disable_password_authentication = false admin_username = "azureuser" admin_password = "@Aa123456789" network_interface_ids = [azurerm_network_interface.nic_vm.id] + priority = "Spot" + eviction_policy = "Deallocate" custom_data = filebase64("../scripts/install-webapp.sh") diff --git a/301_load_balancer_vmss/vmss.tf b/301_load_balancer_vmss/vmss.tf index 458abcb..0d0e6f3 100644 --- a/301_load_balancer_vmss/vmss.tf +++ b/301_load_balancer_vmss/vmss.tf @@ -3,7 +3,7 @@ resource "azurerm_linux_virtual_machine_scale_set" "vmss" { resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location instances = 3 - sku = "Standard_B2als_v2" + sku = "Standard_B2ats_v2" zones = ["1", "2", "3"] disable_password_authentication = false admin_username = "azureuser" diff --git a/302_load_balancer_internal_vmss_natgateway/vmss.tf b/302_load_balancer_internal_vmss_natgateway/vmss.tf index 458abcb..0d0e6f3 100644 --- a/302_load_balancer_internal_vmss_natgateway/vmss.tf +++ b/302_load_balancer_internal_vmss_natgateway/vmss.tf @@ -3,7 +3,7 @@ resource "azurerm_linux_virtual_machine_scale_set" "vmss" { resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location instances = 3 - sku = "Standard_B2als_v2" + sku = "Standard_B2ats_v2" zones = ["1", "2", "3"] disable_password_authentication = false admin_username = "azureuser" diff --git a/400_private_dns_zone/vm.tf b/400_private_dns_zone/vm.tf index ed7b98e..045da15 100644 --- a/400_private_dns_zone/vm.tf +++ b/400_private_dns_zone/vm.tf @@ -16,11 +16,13 @@ resource "azurerm_linux_virtual_machine" "vm" { name = "vm-linux" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - size = "Standard_B2als_v2" + size = "Standard_B2ats_v2" disable_password_authentication = false admin_username = "azureuser" admin_password = "@Aa123456789" network_interface_ids = [azurerm_network_interface.nic_vm.id] + priority = "Spot" + eviction_policy = "Deallocate" os_disk { caching = "ReadWrite" diff --git a/410_private_endpoint_mssql/vm_jumpbox.tf b/410_private_endpoint_mssql/vm_jumpbox.tf index c133804..4414960 100644 --- a/410_private_endpoint_mssql/vm_jumpbox.tf +++ b/410_private_endpoint_mssql/vm_jumpbox.tf @@ -15,7 +15,7 @@ resource "azurerm_windows_virtual_machine" "vm" { name = "vm-jumpbox-w11" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - size = "Standard_B2als_v2" + size = "Standard_B2ats_v2" admin_username = "azureuser" admin_password = "@Aa123456789" network_interface_ids = [azurerm_network_interface.nic-vm.id] diff --git a/420_private_endpoint_pls/vm_jumpbox.tf b/420_private_endpoint_pls/vm_jumpbox.tf index 0714bec..b40a9d3 100644 --- a/420_private_endpoint_pls/vm_jumpbox.tf +++ b/420_private_endpoint_pls/vm_jumpbox.tf @@ -16,11 +16,13 @@ resource "azurerm_linux_virtual_machine" "vm" { name = "vm-linux" resource_group_name = azurerm_resource_group.rg-consumer.name location = azurerm_resource_group.rg-consumer.location - size = "Standard_B2ls_v2" # "Standard_B2als_v2" + size = "Standard_B2ls_v2" # "Standard_B2ats_v2" disable_password_authentication = false admin_username = "azureuser" admin_password = "@Aa123456789" network_interface_ids = [azurerm_network_interface.nic_vm.id] + priority = "Spot" + eviction_policy = "Deallocate" os_disk { caching = "ReadWrite" diff --git a/420_private_endpoint_pls/vmss.tf b/420_private_endpoint_pls/vmss.tf index b2e665b..b97c03d 100644 --- a/420_private_endpoint_pls/vmss.tf +++ b/420_private_endpoint_pls/vmss.tf @@ -3,7 +3,7 @@ resource "azurerm_linux_virtual_machine_scale_set" "vmss" { resource_group_name = azurerm_resource_group.rg-provider.name location = azurerm_resource_group.rg-provider.location instances = 3 - sku = "Standard_B2als_v2" + sku = "Standard_B2ats_v2" zones = ["1", "2", "3"] disable_password_authentication = false admin_username = "azureuser" diff --git a/430_service_endpoint_storage_account/linux_vm.tf b/430_service_endpoint_storage_account/linux_vm.tf index c3c7f91..ceb751f 100644 --- a/430_service_endpoint_storage_account/linux_vm.tf +++ b/430_service_endpoint_storage_account/linux_vm.tf @@ -16,11 +16,13 @@ resource "azurerm_linux_virtual_machine" "vm" { name = "vm-linux" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - size = "Standard_B2als_v2" + size = "Standard_B2ats_v2" disable_password_authentication = false admin_username = "azureuser" admin_password = "@Aa123456789" network_interface_ids = [azurerm_network_interface.nic_vm.id] + priority = "Spot" + eviction_policy = "Deallocate" os_disk { caching = "ReadWrite" diff --git a/431_service_endpoint_app_service/linux_vm.tf b/431_service_endpoint_app_service/linux_vm.tf index c3c7f91..ceb751f 100644 --- a/431_service_endpoint_app_service/linux_vm.tf +++ b/431_service_endpoint_app_service/linux_vm.tf @@ -16,11 +16,13 @@ resource "azurerm_linux_virtual_machine" "vm" { name = "vm-linux" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - size = "Standard_B2als_v2" + size = "Standard_B2ats_v2" disable_password_authentication = false admin_username = "azureuser" admin_password = "@Aa123456789" network_interface_ids = [azurerm_network_interface.nic_vm.id] + priority = "Spot" + eviction_policy = "Deallocate" os_disk { caching = "ReadWrite" diff --git a/500_application_gateway_vmss/vmss.tf b/500_application_gateway_vmss/vmss.tf index 81c119f..1296253 100644 --- a/500_application_gateway_vmss/vmss.tf +++ b/500_application_gateway_vmss/vmss.tf @@ -3,7 +3,7 @@ resource "azurerm_linux_virtual_machine_scale_set" "vmss" { resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location instances = 3 - sku = "Standard_B2als_v2" + sku = "Standard_B2ats_v2" zones = ["1", "2", "3"] disable_password_authentication = false admin_username = "azureuser" diff --git a/520_application_gateway_vmss_tls_cert_keyvault/vmss.tf b/520_application_gateway_vmss_tls_cert_keyvault/vmss.tf index 8f84b16..0d907ec 100644 --- a/520_application_gateway_vmss_tls_cert_keyvault/vmss.tf +++ b/520_application_gateway_vmss_tls_cert_keyvault/vmss.tf @@ -3,7 +3,7 @@ resource "azurerm_linux_virtual_machine_scale_set" "vmss" { resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location instances = 3 - sku = "Standard_B2als_v2" + sku = "Standard_B2ats_v2" zones = ["1", "2", "3"] disable_password_authentication = false admin_username = "azureuser" diff --git a/600_public_ip_vm/linux_vm.tf b/600_public_ip_vm/linux_vm.tf index 049e777..e0d3e5d 100644 --- a/600_public_ip_vm/linux_vm.tf +++ b/600_public_ip_vm/linux_vm.tf @@ -16,11 +16,13 @@ resource "azurerm_linux_virtual_machine" "vm" { name = "vm-linux" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - size = "Standard_B2als_v2" + size = "Standard_B2ats_v2" disable_password_authentication = false admin_username = "azureuser" admin_password = "@Aa123456789" network_interface_ids = [azurerm_network_interface.nic-vm.id] + priority = "Spot" + eviction_policy = "Deallocate" os_disk { caching = "ReadWrite" diff --git a/620_nat_gateway/linux_vm.tf b/620_nat_gateway/linux_vm.tf index c3c7f91..ceb751f 100644 --- a/620_nat_gateway/linux_vm.tf +++ b/620_nat_gateway/linux_vm.tf @@ -16,11 +16,13 @@ resource "azurerm_linux_virtual_machine" "vm" { name = "vm-linux" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - size = "Standard_B2als_v2" + size = "Standard_B2ats_v2" disable_password_authentication = false admin_username = "azureuser" admin_password = "@Aa123456789" network_interface_ids = [azurerm_network_interface.nic_vm.id] + priority = "Spot" + eviction_policy = "Deallocate" os_disk { caching = "ReadWrite" diff --git a/621_nat_gateway_lb/vmss.tf b/621_nat_gateway_lb/vmss.tf index 458abcb..0d0e6f3 100644 --- a/621_nat_gateway_lb/vmss.tf +++ b/621_nat_gateway_lb/vmss.tf @@ -3,7 +3,7 @@ resource "azurerm_linux_virtual_machine_scale_set" "vmss" { resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location instances = 3 - sku = "Standard_B2als_v2" + sku = "Standard_B2ats_v2" zones = ["1", "2", "3"] disable_password_authentication = false admin_username = "azureuser" diff --git a/710_api_management_internal/windows_vm-jumpbox.tf b/710_api_management_internal/windows_vm-jumpbox.tf index 16b3b6b..7aeec5f 100644 --- a/710_api_management_internal/windows_vm-jumpbox.tf +++ b/710_api_management_internal/windows_vm-jumpbox.tf @@ -15,7 +15,7 @@ resource "azurerm_windows_virtual_machine" "vm-windows" { name = "vm-windows-w11" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - size = "Standard_B2als_v2" + size = "Standard_B2ats_v2" admin_username = "azureuser" admin_password = "@Aa123456789" network_interface_ids = [azurerm_network_interface.nic-vm-windows.id] diff --git a/715_api_management_internal_app_gateway/windows_vm-jumpbox.tf b/715_api_management_internal_app_gateway/windows_vm-jumpbox.tf index 16b3b6b..7aeec5f 100644 --- a/715_api_management_internal_app_gateway/windows_vm-jumpbox.tf +++ b/715_api_management_internal_app_gateway/windows_vm-jumpbox.tf @@ -15,7 +15,7 @@ resource "azurerm_windows_virtual_machine" "vm-windows" { name = "vm-windows-w11" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - size = "Standard_B2als_v2" + size = "Standard_B2ats_v2" admin_username = "azureuser" admin_password = "@Aa123456789" network_interface_ids = [azurerm_network_interface.nic-vm-windows.id] diff --git a/800_onprem_vpn_gateway_p2s/terraform.tfstate b/800_onprem_vpn_gateway_p2s/terraform.tfstate index 3358f73..1352b52 100644 --- a/800_onprem_vpn_gateway_p2s/terraform.tfstate +++ b/800_onprem_vpn_gateway_p2s/terraform.tfstate @@ -95,7 +95,7 @@ "resource_group_name": "rg-vpn-gateway-p2s-800", "secret": [], "secure_boot_enabled": false, - "size": "Standard_B2als_v2", + "size": "Standard_B2ats_v2", "source_image_id": "", "source_image_reference": [ { @@ -945,7 +945,7 @@ "resource_group_name": "rg-vpn-gateway-p2s-800", "secret": [], "secure_boot_enabled": false, - "size": "Standard_B2als_v2", + "size": "Standard_B2ats_v2", "source_image_id": "", "source_image_reference": [ { diff --git a/800_onprem_vpn_gateway_p2s/vm_linux.tf b/800_onprem_vpn_gateway_p2s/vm_linux.tf index 76e7a90..7814ac5 100644 --- a/800_onprem_vpn_gateway_p2s/vm_linux.tf +++ b/800_onprem_vpn_gateway_p2s/vm_linux.tf @@ -23,11 +23,13 @@ resource "azurerm_linux_virtual_machine" "vm" { name = "vm-linux" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - size = "Standard_B2als_v2" + size = "Standard_B2ats_v2" disable_password_authentication = false admin_username = "azureuser" admin_password = "@Aa123456789" network_interface_ids = [azurerm_network_interface.nic-vm.id] + priority = "Spot" + eviction_policy = "Deallocate" custom_data = filebase64("./install-webapp.sh") diff --git a/800_onprem_vpn_gateway_p2s/vm_windows.tf b/800_onprem_vpn_gateway_p2s/vm_windows.tf index 723276c..ae69448 100644 --- a/800_onprem_vpn_gateway_p2s/vm_windows.tf +++ b/800_onprem_vpn_gateway_p2s/vm_windows.tf @@ -15,7 +15,7 @@ resource "azurerm_windows_virtual_machine" "vm" { name = "vm-jumpbox-w11" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location - size = "Standard_B2als_v2" + size = "Standard_B2ats_v2" admin_username = "azureuser" admin_password = "@Aa123456789" network_interface_ids = [azurerm_network_interface.nic-vm-windows.id] diff --git a/810_onprem_vpn_gateway_p2s_hub_spokes/modules/vm_linux/main.tf b/810_onprem_vpn_gateway_p2s_hub_spokes/modules/vm_linux/main.tf index cdae66f..e5ef559 100644 --- a/810_onprem_vpn_gateway_p2s_hub_spokes/modules/vm_linux/main.tf +++ b/810_onprem_vpn_gateway_p2s_hub_spokes/modules/vm_linux/main.tf @@ -25,7 +25,7 @@ resource "azurerm_linux_virtual_machine" "vm" { name = var.vm_name resource_group_name = var.resource_group_name location = var.location - size = "Standard_B2ats_v2" # "Standard_B2als_v2" + size = "Standard_B2ats_v2" # "Standard_B2ats_v2" disable_password_authentication = false admin_username = "azureuser" admin_password = "@Aa123456789" diff --git a/modules/bastion/variables.tf b/modules/bastion/variables.tf index 00e073b..3ea57a6 100644 --- a/modules/bastion/variables.tf +++ b/modules/bastion/variables.tf @@ -1,5 +1,5 @@ variable "name" { - type = string + type = string default = "bastion-host" } diff --git a/modules/vm_linux/main.tf b/modules/vm_linux/main.tf index 452f407..4baffe0 100644 --- a/modules/vm_linux/main.tf +++ b/modules/vm_linux/main.tf @@ -33,6 +33,8 @@ resource "azurerm_linux_virtual_machine" "vm" { admin_username = var.admin_username admin_password = var.admin_password network_interface_ids = [azurerm_network_interface.nic_vm.id] + priority = "Spot" + eviction_policy = "Deallocate" tags = var.tags custom_data = var.install_webapp ? filebase64("../scripts/install-webapp.sh") : null diff --git a/modules/vm_linux/variables.tf b/modules/vm_linux/variables.tf index 8245460..70ad23a 100644 --- a/modules/vm_linux/variables.tf +++ b/modules/vm_linux/variables.tf @@ -1,14 +1,14 @@ variable "resource_group_name" {} variable "location" {} variable "tags" { - type = map + type = map(any) default = {} } variable "subnet_id" {} variable "vm_name" {} variable "vm_size" { type = string - default = "Standard_B2als_v2" # "Standard_B1ms" # Standard_B2ls_v2 # Standard_B2s_v2 + default = "Standard_B2ats_v2" # "Standard_B1ms" # Standard_B2ls_v2 # Standard_B2s_v2 } variable "admin_username" { type = string diff --git a/modules/vm_windows/main.tf b/modules/vm_windows/main.tf index bccc6eb..0a4f8d9 100644 --- a/modules/vm_windows/main.tf +++ b/modules/vm_windows/main.tf @@ -30,6 +30,8 @@ resource "azurerm_windows_virtual_machine" "vm" { admin_username = var.admin_username admin_password = var.admin_password network_interface_ids = [azurerm_network_interface.nic_vm.id] + priority = "Spot" + eviction_policy = "Deallocate" tags = var.tags custom_data = var.install_webapp ? filebase64("../scripts/install-tools-windows.ps1") : null diff --git a/modules/vm_windows/variables.tf b/modules/vm_windows/variables.tf index 8245460..70ad23a 100644 --- a/modules/vm_windows/variables.tf +++ b/modules/vm_windows/variables.tf @@ -1,14 +1,14 @@ variable "resource_group_name" {} variable "location" {} variable "tags" { - type = map + type = map(any) default = {} } variable "subnet_id" {} variable "vm_name" {} variable "vm_size" { type = string - default = "Standard_B2als_v2" # "Standard_B1ms" # Standard_B2ls_v2 # Standard_B2s_v2 + default = "Standard_B2ats_v2" # "Standard_B1ms" # Standard_B2ls_v2 # Standard_B2s_v2 } variable "admin_username" { type = string