Skip to content

Instantly share code, notes, and snippets.

@muathendirangu
Created March 3, 2024 20:14
Show Gist options
  • Save muathendirangu/09bab29a660a495d1e91957474f07386 to your computer and use it in GitHub Desktop.
Save muathendirangu/09bab29a660a495d1e91957474f07386 to your computer and use it in GitHub Desktop.
Here's an example of how you might define a basic virtual machine (VM) on AWS using Terraform
# Configure AWS provider
provider "aws" {
region = "us-east-1" # Specify your desired region
}
# Define a resource for the VM instance
resource "aws_instance" "web_server" {
ami = "ami-0XXXXXXXXXXXXXX" # Amazon Machine Image (pre-built OS)
instance_type = "t2.micro" # VM instance type
tags = {
Name = "My Web Server"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment