Last active
October 13, 2022 11:30
-
-
Save 53845714nF/088dcc07628cd2436c61b91c154a2b9f to your computer and use it in GitHub Desktop.
Terraform AWS EC2 Ubuntu Server
This file contains 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
terraform { | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 4.0" | |
} | |
} | |
} | |
provider "aws" { | |
region = "us-east-1" | |
access_key = "" | |
secret_key = "" | |
token= "" | |
} | |
module "ec2_instance" { | |
source = "terraform-aws-modules/ec2-instance/aws" | |
version = "~> 3.0" | |
name = "single-instance" | |
ami = "ami-08c40ec9ead489470" | |
instance_type = "t2.nano" | |
key_name = "thb" | |
monitoring = false | |
vpc_security_group_ids = ["sg-019b07b0cafc83419"] | |
subnet_id = "subnet-0424b8e0e0e35c639" | |
tags = { | |
Terraform = "true" | |
Environment = "dev" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment