forked from chrissmiller/etc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.tf
64 lines (56 loc) · 2.12 KB
/
deploy.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
# Configure the Azure Provider
provider "azurerm" {
# Whilst version is optional, we /strongly recommend/ using it to pin the version of the Provider being used
version = "=2.20.0"
features {}
}
# Create a resource group
resource "azurerm_resource_group" "terraformDeployment" {
name = "chrismiller-fidalgo-rg"
location = "East US 2"
}
# Create a virtual network within the resource group
resource "azurerm_virtual_network" "terraformDeployment" {
name = "example-network"
resource_group_name = azurerm_resource_group.terraformDeployment.name
location = azurerm_resource_group.terraformDeployment.location
address_space = ["10.0.0.0/16"]
}
resource "azurerm_subnet" "terraformDeployment" {
name = "internal"
resource_group_name = azurerm_resource_group.terraformDeployment.name
virtual_network_name = azurerm_virtual_network.terraformDeployment.name
address_prefixes = ["10.0.2.0/24"]
}
resource "azurerm_network_interface" "terraformDeployment" {
name = "example-nic"
location = azurerm_resource_group.terraformDeployment.location
resource_group_name = azurerm_resource_group.terraformDeployment.name
ip_configuration {
name = "internal"
subnet_id = azurerm_subnet.terraformDeployment.id
private_ip_address_allocation = "Dynamic"
}
}
resource "azurerm_linux_virtual_machine" "terraformDeployment" {
name = "chrismiller-fidalgo-machine"
disable_password_authentication = "false"
resource_group_name = azurerm_resource_group.terraformDeployment.name
location = azurerm_resource_group.terraformDeployment.location
size = "Standard_B1s"
admin_username = "adminuser"
admin_password = "TestPassword123!"
network_interface_ids = [
azurerm_network_interface.terraformDeployment.id,
]
os_disk {
caching = "ReadWrite"
storage_account_type = "Standard_LRS"
}
source_image_reference {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "16.04-LTS"
version = "latest"
}
}