filmov
tv
Terraform creates Aws Security Groups Tamil
Показать описание
#terraform #awssecuritygroups
#create Ec2 Instance
resource "aws_instance" "server" {
ami = "ami-0da59f1af71ea4ad2"
security_groups = [ aws_security_group.T_SG.name ]
tags = {
name = "Terra"
}
}
#creat Security Group
resource "aws_security_group" "T_SG" {
name = "T_SG"
description = "T_SG"
vpc_id = "vpc-04f2f7004743262ac"
ingress {
description = "HTTP"
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
description = "HTTPS"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
description = "SSH"
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"]
}
tags = {
name ="T_SG"
}
}
#create Ec2 Instance
resource "aws_instance" "server" {
ami = "ami-0da59f1af71ea4ad2"
security_groups = [ aws_security_group.T_SG.name ]
tags = {
name = "Terra"
}
}
#creat Security Group
resource "aws_security_group" "T_SG" {
name = "T_SG"
description = "T_SG"
vpc_id = "vpc-04f2f7004743262ac"
ingress {
description = "HTTP"
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
description = "HTTPS"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
description = "SSH"
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"]
}
tags = {
name ="T_SG"
}
}