<commit_before>#--------------------------------------------------------------
# bastion Server Security Group
#--------------------------------------------------------------
resource "aws_security_group" "bastion_security" {
	name        = "bastion-security"
	description = "Security group for bastion instance"
	vpc_id      = "${aws_vpc.database_setup.id}"

	ingress {
		from_port   = 22
		to_port     = 22
		protocol    = "tcp"
		cidr_blocks = ["172.16.31.10/32"]
	}

  	tags {
  		Name = "bastion-server-security"
  	}

	lifecycle {
		create_before_destroy = true
	}
}<commit_msg>open MySQL port on master and slave security groups<commit_after>#--------------------------------------------------------------
# bastion Server Security Group
#--------------------------------------------------------------
resource "aws_security_group" "bastion_security" {
	name        = "bastion-security"
	description = "Security group for bastion instance"
	vpc_id      = "${aws_vpc.database_setup.id}"

	ingress {
		from_port   = 22
		to_port     = 22
		protocol    = "tcp"
		cidr_blocks = ["172.16.31.10/32"]
	}

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

  	tags {
  		Name = "bastion-server-security"
  	}

	lifecycle {
		create_before_destroy = true
	}
}

#--------------------------------------------------------------
# Database Backup Instances' Security Group
#--------------------------------------------------------------
resource "aws_security_group" "database_backup_security_group" {
	name        = "database_backup_security_group"
	description = "Security group for ec2 slave database instances"
	vpc_id      = "${aws_vpc.database_setup.id}"

	ingress {
		from_port       = 22
		to_port         = 22
		protocol        = "tcp"
		security_groups = ["${aws_security_group.bastion_security.id}"]
	}

	ingress {
		from_port       = 3306
		to_port         = 3306
		protocol        = "tcp"
		cidr_blocks     = ["10.0.2.0/24,10.0.3.0/24,10.0.0.0/24,10.0.1.0/24"]
	}

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

#--------------------------------------------------------------
# Database Master Instances' Security Group
#--------------------------------------------------------------
resource "aws_security_group" "database_master_security_group" {
	name        = "database_backup_security_group"
	description = "Security group for ec2 master database instances"
	vpc_id      = "${aws_vpc.database_setup.id}"

	ingress {
		from_port       = 22
		to_port         = 22
		protocol        = "tcp"
		security_groups = ["${aws_security_group.bastion_security.id}"]
	}

	ingress {
		from_port       = 3306
		to_port         = 3306
		protocol        = "tcp"
		cidr_blocks     = ["10.0.2.0/24,10.0.3.0/24,10.0.0.0/24,10.0.1.0/24"]
	}

	egress {
		from_port   = 0
		to_port     = 0
		protocol    = "-1"
		cidr_blocks = ["0.0.0.0/0"]
	}
}
{'fraction_non_alphanumeric': 0.27108843537414967, 'fraction_numerical': 0.04625850340136054, 'mean_word_length': 1.5115286080273271, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 13, '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': '3782434', 'n_tokens_mistral': 1060, 'n_tokens_neox': 951, 'n_words': 177}