Skip to content

Instantly share code, notes, and snippets.

@DuranIsrael
Last active March 11, 2024 19:10
Show Gist options
  • Save DuranIsrael/c2891f75e562249bbd99a64952203840 to your computer and use it in GitHub Desktop.
Save DuranIsrael/c2891f75e562249bbd99a64952203840 to your computer and use it in GitHub Desktop.
Terraform EC2 Module
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.27"
}
}
required_version = ">= 0.14.9"
}
provider "aws" {
profile = "default"
region = "us-east-1"
}
resource "aws_instance" "app_server" {
ami = var.ami
instance_type = var.instance_type
tags = {
Name = "ExampleAppServerInstance"
}
}
variable "ami_id" {}
variable "instance_type" {
type = string
default = "t2,micro"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment