Created
August 28, 2023 06:45
-
-
Save pmatsinopoulos/fed9bf1e059589a5f344235c293157a1 to your computer and use it in GitHub Desktop.
AWS Private and Public Subnets - ssh_access.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_security_group" "ssh_access" { | |
name = "${local.project}-ssh-access" | |
description = "Allow SSH traffic from anywhere" | |
vpc_id = aws_vpc.private_and_public_subnets.id | |
ingress { | |
description = "allow SSH from anywhere" | |
from_port = 22 | |
to_port = 22 | |
protocol = "tcp" | |
cidr_blocks = ["0.0.0.0/0"] | |
} | |
egress { | |
description = "Outgoing to anywhere" | |
from_port = 0 | |
to_port = 0 | |
protocol = "-1" | |
cidr_blocks = ["0.0.0.0/0"] | |
} | |
tags = { | |
"Name" = "${local.project}-ssh-access" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment