Skip to content

Commit

Permalink
Initialise repo to spin an EC2 instance
Browse files Browse the repository at this point in the history
  • Loading branch information
kooskoos20 committed May 12, 2022
1 parent ac6d004 commit 154b7ad
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions terraform-tfvars/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}

provider "aws" {
region = "us-east-1"
}

//referencing ubuntu AMI
data "aws_ami" "ubuntu" {
most_recent = true
owners = ["099720109477"] #Canonical

filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}
}

//spinning up billing server
resource "aws_instance" "billing_server" {
ami = data.aws_ami.ubuntu.id
instance_type = "t2.micro"
tags = {
"service" = "billing"
}
}

0 comments on commit 154b7ad

Please sign in to comment.