Skip to content
Snippets Groups Projects
security.tf 930 B
Newer Older
data "aws_security_group" "sec-group" {
data "aws_security_group" "default" {
  vpc_id = data.aws_vpc.vpc.id
  name = "default"
}

// open port 2049 for NFSv4
resource "aws_security_group" "secure-agent-efs-sg" {
  name   = var.secure_agent_efs_sg
  vpc_id = data.aws_vpc.vpc.id

  // NFS
  ingress {
    security_groups = [
    data.aws_security_group.sec-group.id]
    from_port = 2049
    to_port   = 2049
    protocol  = "tcp"
  # allow SSH connections from configured security group,
  # for debugging purposes(can set up a bastion host).
  ingress {
    security_groups = [
    data.aws_security_group.sec-group.id]
    from_port = 22
    to_port   = 22
    protocol  = "tcp"
  }

    data.aws_security_group.sec-group.id]
    from_port = 0
    to_port   = 0
    protocol  = "-1"