-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path7-client10.tf
59 lines (51 loc) · 1.91 KB
/
7-client10.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
####################################
####### Client 10 #######################
####################################
# Creating a NIC for internal network on Client10
resource "azurerm_network_interface" "client10_internalnic" {
name = "client10_intnic"
location = var.location
resource_group_name = var.rg
ip_configuration {
name = "client10_internal"
subnet_id = azurerm_subnet.subnet.id
private_ip_address_allocation = "Dynamic"
}
}
#Creating client10 VM
resource "azurerm_virtual_machine" "client10" {
name = "client10"
resource_group_name = var.rg
location = var.location
network_interface_ids = [azurerm_network_interface.client10_internalnic.id]
vm_size = "Standard_D1_v2"
primary_network_interface_id = azurerm_network_interface.client10_internalnic.id
delete_os_disk_on_termination = true
delete_data_disks_on_termination = true
storage_image_reference {
publisher = "MicrosoftWindowsDesktop"
offer = "Windows-10"
sku = "win10-22h2-pro"
version = "latest"
}
storage_os_disk {
name = "client10disk"
caching = "ReadWrite"
create_option = "FromImage"
}
os_profile {
computer_name = "client10"
admin_username = var.username
admin_password = var.password
}
# Autologon to bypass the OOBE screen and be able to join client10 to the domain
os_profile_windows_config {
provision_vm_agent = true
additional_unattend_config {
pass = "oobeSystem"
component = "Microsoft-Windows-Shell-Setup"
setting_name = "AutoLogon"
content = "<AutoLogon><Password><Value>${var.password}</Value></Password><Enabled>true</Enabled><LogonCount>1</LogonCount><Username>${var.username}</Username></AutoLogon>"
}
}
}