-
Notifications
You must be signed in to change notification settings - Fork 1
/
jumpbox-vm.tf
101 lines (85 loc) · 3.15 KB
/
jumpbox-vm.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
resource "azurerm_network_interface" "jumpbox_01" {
name = "jumpbox-01-nic"
location = azurerm_resource_group.region_01.location
resource_group_name = azurerm_resource_group.region_01.name
ip_configuration {
name = "internal"
subnet_id = azurerm_subnet.region_01_virtual_network_01_subnet_02.id
private_ip_address_allocation = "Dynamic"
public_ip_address_id = azurerm_public_ip.region_01_public_ip_02.id
}
}
resource "azurerm_windows_virtual_machine" "jumpbox_01" {
name = "jumpbox-vm"
resource_group_name = azurerm_resource_group.region_01.name
location = azurerm_resource_group.region_01.location
size = "Standard_B2s"
admin_username = var.admin_username
admin_password = var.admin_password
network_interface_ids = [
azurerm_network_interface.jumpbox_01.id,
]
os_disk {
caching = "ReadWrite"
storage_account_type = "Standard_LRS"
}
source_image_reference {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2016-Datacenter"
version = "latest"
}
}
resource "azurerm_dev_test_global_vm_shutdown_schedule" "jumpbox_01_shutdown_schedule" {
virtual_machine_id = azurerm_windows_virtual_machine.jumpbox_01.id
location = azurerm_resource_group.region_01.location
enabled = true
daily_recurrence_time = "1700"
timezone = "Turkey Standard Time"
notification_settings {
enabled = false
}
}
###################################
resource "azurerm_network_interface" "jumpbox_02" {
name = "jumpbox-02-nic"
location = azurerm_resource_group.region_02.location
resource_group_name = azurerm_resource_group.region_02.name
ip_configuration {
name = "internal"
subnet_id = azurerm_subnet.region_02_virtual_network_01_subnet_02.id
private_ip_address_allocation = "Dynamic"
public_ip_address_id = azurerm_public_ip.region_02_public_ip_02.id
}
}
resource "azurerm_windows_virtual_machine" "jumpbox_02" {
name = "jumpbox-vm-02"
resource_group_name = azurerm_resource_group.region_02.name
location = azurerm_resource_group.region_02.location
size = "Standard_B2s"
admin_username = var.admin_username
admin_password = var.admin_password
network_interface_ids = [
azurerm_network_interface.jumpbox_02.id,
]
os_disk {
caching = "ReadWrite"
storage_account_type = "Standard_LRS"
}
source_image_reference {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2016-Datacenter"
version = "latest"
}
}
resource "azurerm_dev_test_global_vm_shutdown_schedule" "jumpbox_02_shutdown_schedule" {
virtual_machine_id = azurerm_windows_virtual_machine.jumpbox_02.id
location = azurerm_resource_group.region_02.location
enabled = true
daily_recurrence_time = "1700"
timezone = "Turkey Standard Time"
notification_settings {
enabled = false
}
}