-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path5-dc2.tf
More file actions
52 lines (45 loc) · 1.48 KB
/
Copy path5-dc2.tf
File metadata and controls
52 lines (45 loc) · 1.48 KB
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
####################################
####### DC 2 #######################
####################################
# Creating a NIC for internal network on DC2
resource "azurerm_network_interface" "dc2_internalnic" {
name = "dc2_intnic"
location = var.location
resource_group_name = var.rg
ip_configuration {
name = "dc2_internal"
subnet_id = azurerm_subnet.subnet.id
private_ip_address_allocation = "Dynamic"
}
dns_servers = [var.int_dns_address]
}
#Creating DC2 VM
resource "azurerm_virtual_machine" "dc2sub" {
name = "dc2sub"
resource_group_name = var.rg
location = var.location
network_interface_ids = [azurerm_network_interface.dc2_internalnic.id]
vm_size = "Standard_D1_v2"
primary_network_interface_id = azurerm_network_interface.dc2_internalnic.id
delete_os_disk_on_termination = true
delete_data_disks_on_termination = true
storage_image_reference {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2012-R2-Datacenter"
version = "latest"
}
storage_os_disk {
name = "dc2disk"
caching = "ReadWrite"
create_option = "FromImage"
}
os_profile {
computer_name = "DC2"
admin_username = var.username
admin_password = var.password
}
os_profile_windows_config {
provision_vm_agent = true
}
}