Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oliver Lundh Andersson #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Azure3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Azure3-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Azure3-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Azure3-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Azure3-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ resource "azurerm_resource_group" "rg" {

# Create virtual network
resource "azurerm_virtual_network" "my_terraform_network" {
name = "myVnet"
name = "OliverLundhAnderssonVnet"
address_space = ["10.0.0.0/16"]
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
}

# Create subnet
resource "azurerm_subnet" "my_terraform_subnet" {
name = "mySubnet"
name = "OliverLundhAnderssonSubnet"
resource_group_name = azurerm_resource_group.rg.name
virtual_network_name = azurerm_virtual_network.my_terraform_network.name
address_prefixes = ["10.0.1.0/24"]
}

# Create public IPs
resource "azurerm_public_ip" "my_terraform_public_ip" {
name = "myPublicIP"
name = "OliverLundhAnderssonPublicIP"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
allocation_method = "Dynamic"
}

# Create Network Security Group and rule
resource "azurerm_network_security_group" "my_terraform_nsg" {
name = "myNetworkSecurityGroup"
name = "OliverLundhAnderssonNetworkSecurityGroup"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name

Expand All @@ -52,7 +52,7 @@ resource "azurerm_network_security_group" "my_terraform_nsg" {

# Create network interface
resource "azurerm_network_interface" "my_terraform_nic" {
name = "myNIC"
name = "OliverLundhAnderssonNIC"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name

Expand Down Expand Up @@ -91,14 +91,14 @@ resource "azurerm_storage_account" "my_storage_account" {

# Create virtual machine
resource "azurerm_linux_virtual_machine" "my_terraform_vm" {
name = "myVM"
name = "OliverLundhAnderssonVM"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
network_interface_ids = [azurerm_network_interface.my_terraform_nic.id]
size = "Standard_DS1_v2"

os_disk {
name = "myOsDisk"
name = "OliverLundhAnderssonOsDisk"
caching = "ReadWrite"
storage_account_type = "Premium_LRS"
}
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variable "resource_group_location" {
type = string
default = "uksouth"
default = "swedencentral"
description = "Location of the resource group."
}

Expand Down