Created
August 19, 2022 17:08
-
-
Save Resistor52/166aa3b10a6f6d49f9950411a6905df0 to your computer and use it in GitHub Desktop.
For Cloudwars - "Azure Advanced Remote Access" Q2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "azurerm_virtual_network" "sec510_cloudwars" { | |
name = "sec510-cloudwars" | |
resource_group_name = azurerm_resource_group.cloudwars.name | |
location = azurerm_resource_group.cloudwars.location | |
address_space = ["10.10.0.0/16"] | |
} | |
resource "azurerm_subnet" "sec510_cloudwars" { | |
name = "sec510-cloudwars-private" | |
resource_group_name = azurerm_resource_group.cloudwars.name | |
virtual_network_name = azurerm_virtual_network.sec510_cloudwars.name | |
address_prefixes = ["10.10.1.0/24"] | |
} | |
resource "azurerm_network_interface" "sec510_cloudwars" { | |
name = "sec510-cloudwars-nic" | |
resource_group_name = azurerm_resource_group.cloudwars.name | |
location = azurerm_resource_group.cloudwars.location | |
ip_configuration { | |
name = "sec510-cloudwars" | |
subnet_id = azurerm_subnet.sec510_cloudwars.id | |
private_ip_address_allocation = "Dynamic" | |
} | |
} | |
resource "azurerm_linux_virtual_machine" "sec510_cloudwars" { | |
name = "sec510-cloudwars-vm" | |
resource_group_name = azurerm_resource_group.cloudwars.name | |
location = azurerm_resource_group.cloudwars.location | |
network_interface_ids = [azurerm_network_interface.sec510_cloudwars.id] | |
size = "Standard_DS1_v2" | |
computer_name = "sec510-cloudwars" | |
admin_username = "ubuntu" | |
disable_password_authentication = true | |
source_image_reference { | |
publisher = "Canonical" | |
offer = "UbuntuServer" | |
sku = "18.04-LTS" | |
version = "latest" | |
} | |
os_disk { | |
name = "sec510cloudwars" | |
caching = "ReadWrite" | |
storage_account_type = "Standard_LRS" | |
} | |
admin_ssh_key { | |
username = "ubuntu" | |
public_key = file("/home/student/.ssh/id_rsa.pub") | |
} | |
identity { | |
type = "SystemAssigned" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment