BY: Sebastian navia
This repository contains Terraform configuration files to deploy a virtual machine (VM) on Microsoft Azure cloud platform. The main purpose of this deployment is to showcase how to create a VM instance using Terraform and enable SSH access to it.
-
Resource Group: Creates an Azure resource group where all the resources will reside.
-
Virtual Network: Sets up a virtual network (VNet) to provide network connectivity for the VM.
-
Subnet: Defines a subnet within the virtual network to segment the network traffic.
-
Public IP Address: Allocates a static public IP address for the VM to allow external connectivity.
-
Network Security Group: Configures a network security group to control inbound and outbound traffic to the VM.
-
Network Interface: Creates a network interface for the VM, which connects it to the virtual network.
-
Network Security Rule: Defines a network security rule to allow SSH traffic (TCP port 22) to the VM.
Additionally, the script provisions the Azure virtual machine itself with the following specifications:
-
Size: Specifies the VM size as "Standard_DS1_v2" (adjustable based on requirements).
-
Operating System: Uses an Ubuntu Server image from Canonical with the latest LTS version.
-
OS Disk: Configures the operating system disk with caching, managed disk type, and creates it from the specified image.
-
OS Profile: Sets the computer name, admin username, and admin password for logging into the VM.
-
Linux Configuration: Enables password authentication for the Linux OS profile.
NOTE
- Ensure that the admin_username and admin_password fields in the os_profile section are appropriately set to your desired values.
Use the same credentials to create this virtual machine and avoid errors, as it is a practice resource.
-
terraform init: Initializes the Terraform environment.
-
terraform validate: Validates the syntax and configuration of Terraform files.
-
terraform plan: Generates a plan of infrastructure changes.
-
terraform fmt: Applies consistent formatting to Terraform code.
-
terraform apply: Applies the changes defined in Terraform files.
"It is demonstrated that the resource has been created."
SSH active