-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
118 lines (115 loc) · 3.28 KB
/
main.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
resource "azurerm_resource_group" "rg_VM" {
name = "rg1_VM"
location = "UK South"
}
#
##resource "azurerm_resource_group" "rg_2" {
## name = "rg2_SP"
## location = "UK South"
##}
#resource "azurerm_virtual_network" "VM_VNET" {
# name = "VM_VNET"
# location = azurerm_resource_group.rg_VM.location
# resource_group_name = azurerm_resource_group.rg_VM.name
# address_space = ["10.0.0.0/16"]
# dns_servers = ["10.0.0.4", "10.0.0.5"]
#
## subnet {
## name = "VM_subnet1"
## address_prefix = "10.0.1.0/24"
## }
##
## subnet {
## name = "VM_subnet2"
## address_prefix = "10.0.2.0/24"
## security_group = azurerm_network_security_group.VM_NSG.id
## }
#
# tags = {
# environment = "Dev"
# }
#}
#
#resource "azurerm_subnet" "VM_subnet1" {
# name = "VM_subnet1"
# resource_group_name = azurerm_resource_group.rg_VM.name
# virtual_network_name = azurerm_virtual_network.VM_VNET.name
# address_prefixes = ["10.0.1.0/24"]
#}
#
#
#
#resource "azurerm_network_security_group" "VM_NSG" {
# name = "VM_NSG"
# location = azurerm_resource_group.rg_VM.location
# resource_group_name = azurerm_resource_group.rg_VM.name
#
# security_rule {
# name = "test123"
# priority = 100
# direction = "Inbound"
# access = "Allow"
# protocol = "Tcp"
# source_port_range = "*"
# destination_port_range = "*"
# source_address_prefix = "*"
# destination_address_prefix = "*"
# }
#}
#
#resource "azurerm_subnet_network_security_group_association" "security_group_association" {
# subnet_id = azurerm_subnet.VM_subnet1.id
# network_security_group_id = azurerm_network_security_group.VM_NSG.id
#}
#
#resource "azurerm_network_interface" "VM_nic" {
# name = "VM_nic"
# location = azurerm_resource_group.rg_VM.location
# resource_group_name = azurerm_resource_group.rg_VM.name
#
# ip_configuration {
# name = "VM_nic_internal"
# subnet_id = azurerm_subnet.VM_subnet1.id
# private_ip_address_allocation = "Dynamic"
# public_ip_address_id = azurerm_public_ip.VM_PIP.id
# }
#}
#
#resource "azurerm_public_ip" "VM_PIP" {
# name = "VM_PIP"
# resource_group_name = azurerm_resource_group.rg_VM.name
# location = azurerm_resource_group.rg_VM.location
# allocation_method = "Static"
#
# tags = {
# environment = "Dev"
# }
#}
#
#resource "azurerm_linux_virtual_machine" "VM_machine" {
# name = "VMmachine"
# resource_group_name = azurerm_resource_group.rg_VM.name
# location = azurerm_resource_group.rg_VM.location
# size = "Standard_B1ls"
# admin_username = "adminuser"
# network_interface_ids = [
# azurerm_network_interface.VM_nic.id,
# ]
#
# admin_ssh_key {
# username = "adminuser"
# public_key = file("~/.ssh/id_rsa.pub")
# }
#
# os_disk {
# caching = "ReadWrite"
# storage_account_type = "Standard_LRS"
# }
#
# source_image_reference {
# publisher = "Oracle"
# offer = "Oracle-Linux"
# sku = "ol84-lvm-gen2"
# version = "latest"
# }
#}