<commit_before>resource "aws_security_group" "etcd" {
  vpc_id = "${data.aws_vpc.cluster_vpc.id}"

  tags = "${merge(map(
      "Name", "${var.cluster_name}_etcd_sg",
      "kubernetes.io/cluster/${var.cluster_name}", "owned",
      "tectonicClusterID", "${var.cluster_id}"
    ), var.extra_tags)}"

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

  ingress {
    protocol    = "icmp"
    cidr_blocks = ["0.0.0.0/0"]
    from_port   = 0
    to_port     = 0
  }

  ingress {
    protocol  = "tcp"
    from_port = 22
    to_port   = 22
    self      = true

    security_groups = ["${aws_security_group.master.id}"]
  }

  ingress {
    protocol  = "tcp"
    from_port = 2379
    to_port   = 2379
    self      = true

    security_groups = ["${aws_security_group.master.id}"]
  }

  ingress {
    protocol  = "tcp"
    from_port = 2380
    to_port   = 2380
    self      = true
  }
}<commit_msg>modules/aws/vpc/sg-etcd: Split out aws_security_group_rule for etcd<commit_after>resource "aws_security_group" "etcd" {
  vpc_id = "${data.aws_vpc.cluster_vpc.id}"

  tags = "${merge(map(
      "Name", "${var.cluster_name}_etcd_sg",
      "kubernetes.io/cluster/${var.cluster_name}", "owned",
      "tectonicClusterID", "${var.cluster_id}"
    ), var.extra_tags)}"
}

resource "aws_security_group_rule" "etcd_egress" {
  type              = "egress"
  security_group_id = "${aws_security_group.etcd.id}"

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

resource "aws_security_group_rule" "etcd_ingress_icmp" {
  type              = "ingress"
  security_group_id = "${aws_security_group.etcd.id}"

  protocol    = "icmp"
  cidr_blocks = ["0.0.0.0/0"]
  from_port   = 0
  to_port     = 0
}

resource "aws_security_group_rule" "etcd_ingress_ssh" {
  type              = "ingress"
  security_group_id = "${aws_security_group.etcd.id}"

  protocol  = "tcp"
  from_port = 22
  to_port   = 22
  self      = true
}

resource "aws_security_group_rule" "etcd_ingress_etcd" {
  type              = "ingress"
  security_group_id = "${aws_security_group.etcd.id}"

  protocol  = "tcp"
  from_port = 2379
  to_port   = 2379
  self      = true
}

resource "aws_security_group_rule" "etcd_ingress_peer" {
  type              = "ingress"
  security_group_id = "${aws_security_group.etcd.id}"

  protocol  = "tcp"
  from_port = 2380
  to_port   = 2380
  self      = true
}
{'fraction_non_alphanumeric': 0.13691437802907916, 'fraction_numerical': 0.02827140549273021, 'mean_word_length': 2.5589080459770117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3713369', 'n_tokens_mistral': 1017, 'n_tokens_neox': 960, 'n_words': 159}