devopshobbies / terraform-tutorial

you can follow up this repo to learn terraform with practical examples. also we recommend to check our youtube channel for this topic.
GNU General Public License v3.0
64 stars 25 forks source link

v012 is finished #23

Open signorrayan opened 1 year ago

signorrayan commented 1 year ago

Update the main branch. (v012 > main) (The main branch haven't the latest changes that applied in v012 branch.)

halavehzadeh commented 7 months ago

Hi this is new request for adding security group for SSH traffic in code. please let me know

'resource "aws_security_group" "allow_tls" { name = "Terrafrom-firewall" description = "Managed from Terraform" }

resource "aws_vpc_security_group_ingress_rule" "allow_tls_ipv4" { security_group_id = aws_security_group.allow_tls.id cidr_ipv4 = "0.0.0.0/0" from_port = 22 ip_protocol = "tcp" to_port = 22 }

resource "aws_vpc_security_group_egress_rule" "allow_all_traffic_ipv4" { security_group_id = aws_security_group.allow_tls.id cidr_ipv4 = "0.0.0.0/0" ip_protocol = "-1" # semantically equivalent to all ports } '