Skip to content

Instantly share code, notes, and snippets.

@pmatsinopoulos
Created August 28, 2023 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmatsinopoulos/fed9bf1e059589a5f344235c293157a1 to your computer and use it in GitHub Desktop.
Save pmatsinopoulos/fed9bf1e059589a5f344235c293157a1 to your computer and use it in GitHub Desktop.
AWS Private and Public Subnets - ssh_access.tf
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