Home > other >  Unable to change 'Type' in security group rule
Unable to change 'Type' in security group rule

Time:09-22

I am trying to update security group inbound rules with desired IPs and select 'Type' as 'MSSQL', with my terraform, the rules are getting added with 'Custom TCP' type. below is my tf sec grp construct

resource "aws_security_group" "global_protect_db" {
  name        = "${local.service_name}-vpn_${var.traffic_port_db}"
  description = "HTTPS"
  vpc_id      = data.aws_vpc.systems-tools-vpc.id

  egress {
    cidr_blocks = ["0.0.0.0/0"]
    from_port   = 0
    protocol    = "-1"
    to_port     = 0
  }

  ingress {
    cidr_blocks = concat(local.sg_split, formatlist(local.cidr))
    description = "SQL"
    from_port   = 1443
    protocol    = "tcp"
    to_port     = 1443
  }

  ingress {
    description     = "SQL from service"
    from_port   = 1443
    protocol    = "tcp"
    to_port     = 1443
    security_groups = [aws_security_group.service.id]
  }

}

Both these ingress rules should add IPs with type as 'MSSQL'. What change should be done?

CodePudding user response:

The default port for MSSQL is 1433, not 1443. This will explain why you have issues with the SG and possibly connections.

  • Related