Skip to content
Merged
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
83 changes: 83 additions & 0 deletions .vscode/terraform-linuxvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>2.0"
}
}
}

provider "azurerm" {
features {}

# put credentials below this

}

# create a resource group
resource "azurerm_resource_group" "main" {
name = "rg1"
location = "south india"
}

resource "azurerm_virtual_network" "main" {
name = "vn1"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
address_space = ["10.0.0.0/18"]
}
resource "azurerm_subnet" "main" {
name = "subnet1"
virtual_network_name = azurerm_virtual_network.main.name
resource_group_name = azurerm_resource_group.main.name
address_prefixes = ["10.0.0.0/24"]
}
resource "azurerm_public_ip" "main" {
name = "publicip1"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
allocation_method = "Dynamic"
}
resource "azurerm_network_interface" "main" {
name = "netface1"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
ip_configuration {
name = "internal"
subnet_id = azurerm_subnet.main.id
private_ip_address_allocation = "Dynamic"
public_ip_address_id = azurerm_public_ip.main.id
}

}



resource "azurerm_virtual_machine" "main" {
name = "azurevm1"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
network_interface_ids = [azurerm_network_interface.main.id]
vm_size = "Standard_B1s"
os_profile {
computer_name = "shreya"
admin_username = "shreya"
admin_password = "Shreya123"
}
storage_image_reference {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "16.04-LTS"
version = "latest"
}
storage_os_disk {
name = "mydisk1"
caching = "ReadWrite"
create_option = "FromImage"
managed_disk_type = "Standard_LRS"
}
os_profile_linux_config {
disable_password_authentication = false
}

}