Terraform - AWS Sync
In this post will see how to create a security group to allow ports 22 and 80. And how to modify the security group by adding port 443. # Creating a security group to allow access on port 80 and 22.data resource "aws_security_group" "webserver-sg" { name = "webserver-sg" description = "Allow HTTP and SSH traffic" vpc_id = var . vpcid ingress { from_port = 80 to_port = 80 protocol = "tcp" cidr_blocks = [ "0.0.0.0/0" ] } ingress { from_port = 22 to_port = 22 protocol = "tcp" cidr_blocks = [ "0.0.0.0/0" ] } egress { from_port = 0 to_port = 0 ...