@@ -4,22 +4,22 @@ resource "aws_security_group" "rds_security_group" {
44 description = " Security group for RDS instance"
55
66 ingress {
7- from_port = 3306
8- to_port = 3306
9- protocol = " tcp "
7+ from_port = var . from_port
8+ to_port = var . to_port
9+ protocol = var . protocol
1010 cidr_blocks = var. cidr_block
1111 }
1212
1313 egress {
1414 from_port = 0
1515 to_port = 0
1616 protocol = " -1"
17- cidr_blocks = var . cidr_block
17+ cidr_blocks = [ " 0.0.0.0/0 " ]
1818 }
1919
2020 tags = merge (
2121 {
22- Name = " petclinic-alb -sg" ,
22+ Name = " ${ var . name } -sg" ,
2323 Environment = var.environment,
2424 Owner = var.owner,
2525 CostCenter = var.cost_center,
@@ -31,11 +31,10 @@ resource "aws_security_group" "rds_security_group" {
3131
3232resource "aws_db_instance" "rds_instance" {
3333 identifier = var. db_name
34- engine = " mysql "
34+ engine = var . db_engine
3535 instance_class = var. db_instance_class
3636 allocated_storage = var. db_storage_size
37- storage_type = " gp2"
38- # manage_master_user_password = var.set_secret_manager_password ? true : false
37+ storage_type = var. db_storage_type
3938 manage_master_user_password = var. set_secret_manager_password ? true : null
4039 username = var. db_username
4140 password = var. set_db_password ? var. db_password : null
@@ -51,7 +50,7 @@ resource "aws_db_instance" "rds_instance" {
5150
5251 tags = merge (
5352 {
54- Name = " petclinic-rds "
53+ Name = var.name,
5554 Environment = var.environment,
5655 Owner = var.owner,
5756 CostCenter = var.cost_center,
0 commit comments