Created
March 3, 2024 20:14
-
-
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
This file contains hidden or 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
# 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