From 49c0913f2bac1c88e51f0ead942bcf6cd4d7d74e Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 26 Sep 2025 11:19:35 +0000 Subject: [PATCH] Phase1-2 --- environments/dev/main.tf | 13 +++++++++++-- modules/compute/main.tf | 2 +- modules/compute/outputs.tf | 1 + modules/compute/variables.tf | 6 ++++++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/environments/dev/main.tf b/environments/dev/main.tf index ff57cbf..976d180 100644 --- a/environments/dev/main.tf +++ b/environments/dev/main.tf @@ -23,5 +23,14 @@ module "network" { project = "TerraformBootcamp" } - - +/* +module "compute" { + source = "../../modules/compute" + resource_group_name = "terraform" + location = "UK South" + subnet_id = module.network.subnet_ids["public"] + vm_size = "Standard_B1s" + admin_username = "azureuser" + ssh_public_key = "" +} + */ \ No newline at end of file diff --git a/modules/compute/main.tf b/modules/compute/main.tf index 9d43e66..f75d4c3 100644 --- a/modules/compute/main.tf +++ b/modules/compute/main.tf @@ -1,5 +1,5 @@ resource "azurerm_network_interface" "nic" { - name = "example-nic" + name = "vnic" location = var.location resource_group_name = var.resource_group_name diff --git a/modules/compute/outputs.tf b/modules/compute/outputs.tf index e69de29..fcf2d94 100644 --- a/modules/compute/outputs.tf +++ b/modules/compute/outputs.tf @@ -0,0 +1 @@ +output "vm_public_ip" { value = azurerm_public_ip.vm_public.ip_address } \ No newline at end of file diff --git a/modules/compute/variables.tf b/modules/compute/variables.tf index e69de29..e5636fa 100644 --- a/modules/compute/variables.tf +++ b/modules/compute/variables.tf @@ -0,0 +1,6 @@ +variable "resource_group_name" { type = string } +variable "location" { type = string } +variable "subnet_id" { type = string } +variable "vm_size" { type = string } +variable "admin_username" { type = string } +variable "ssh_public_key" { type = string }