generated from pagopa/terraform-infrastructure-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Italy vm for debug purpose (#2128)
* created vm debug in italy * pre-commit fixs
- Loading branch information
1 parent
bafc3c9
commit 8e6de66
Showing
9 changed files
with
91 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
data "azurerm_key_vault" "kv_italy" { | ||
name = local.kv_italy_name | ||
resource_group_name = local.kv_italy_rg_name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,62 @@ | ||
data "azurerm_key_vault_secret" "vm_debug_ssh_user" { | ||
name = "vm-debug-ssh-user" | ||
key_vault_id = data.azurerm_key_vault.kv_italy.id | ||
} | ||
|
||
data "azurerm_key_vault_secret" "vm_debug_ssh_pass" { | ||
name = "vm-debug-ssh-pass" | ||
key_vault_id = data.azurerm_key_vault.kv_italy.id | ||
} | ||
|
||
resource "azurerm_linux_virtual_machine" "vm_debug" { | ||
name = "${local.product_location}-aks-vm-debug" | ||
resource_group_name = azurerm_resource_group.rg_aks.name | ||
|
||
# Creazione dell'interfaccia di rete | ||
resource "azurerm_network_interface" "vm_debug_italy" { | ||
name = "${local.project}-vm-debug-italy" | ||
location = azurerm_resource_group.rg_aks.location | ||
size = "Standard_B2ms" | ||
admin_username = "adminuser" | ||
admin_password = "P@ssw0rd1234!" | ||
resource_group_name = azurerm_resource_group.rg_aks.name | ||
|
||
ip_configuration { | ||
name = "aks-user-subnet" | ||
subnet_id = azurerm_subnet.user_aks_subnet.id | ||
private_ip_address_allocation = "Dynamic" | ||
} | ||
} | ||
|
||
# Creazione della macchina virtuale | ||
resource "azurerm_linux_virtual_machine" "vm_debug_italy" { | ||
name = "${local.project}-vm-debug-italy" | ||
resource_group_name = azurerm_resource_group.rg_aks.name | ||
location = azurerm_resource_group.rg_aks.location | ||
size = "Standard_B2ms" | ||
admin_username = data.azurerm_key_vault_secret.vm_debug_ssh_user.value | ||
admin_password = data.azurerm_key_vault_secret.vm_debug_ssh_pass.value | ||
disable_password_authentication = false | ||
network_interface_ids = [ | ||
azurerm_network_interface.example.id, | ||
azurerm_network_interface.vm_debug_italy.id, | ||
] | ||
|
||
os_disk { | ||
caching = "ReadWrite" | ||
storage_account_type = "Standard_LRS" | ||
storage_account_type = "StandardSSD_LRS" | ||
} | ||
|
||
source_image_reference { | ||
publisher = "Canonical" | ||
offer = "0001-com-ubuntu-server-focal" | ||
sku = "22.04-LTS" | ||
offer = "0001-com-ubuntu-server-jammy" | ||
sku = "22_04-lts-gen2" | ||
version = "latest" | ||
} | ||
} | ||
|
||
### TODO dev test is not avaible in Italy | ||
# # Creazione della pianificazione di spegnimento automatico | ||
# resource "azurerm_dev_test_global_vm_shutdown_schedule" "shutdown_schedule" { | ||
# location = azurerm_resource_group.rg_aks.location | ||
# virtual_machine_id = azurerm_linux_virtual_machine.vm_debug_italy.id | ||
# enabled = true | ||
# daily_recurrence_time = "1900" | ||
# timezone = "Central Europe Standard Time" | ||
# notification_settings { | ||
# enabled = false | ||
# } | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters