Skip to content

Commit

Permalink
adding v2 version
Browse files Browse the repository at this point in the history
  • Loading branch information
ValaxyTech committed Jun 20, 2023
1 parent 622c43b commit 601801a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions terraform_code/V2-EC2.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
provider "aws" {
region = "us-east-1"
}

resource "aws_instance" "demo-server" {
ami = "ami-022e1a32d3f742bd8"
instance_type = "t2.micro"
key_name = "dpp"
security_groups = [ "demo-sg" ]
}

resource "aws_security_group" "demo-sg" {
name = "demo-sg"
description = "SSH Access"

ingress {
description = "Shh access"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}

egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}

tags = {
Name = "ssh-prot"

}
}

0 comments on commit 601801a

Please sign in to comment.