Skip to content

Commit

Permalink
BAH-3522 | Add variable for configuring mysql RDS timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
mohan-13 committed Apr 24, 2024
1 parent de8ed73 commit bb49150
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
11 changes: 6 additions & 5 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ module "rds" {
mysql_rds_port = var.mysql_rds_port
mysql_version = var.mysql_version
rds_instance_class = var.rds_instance_class
mysql_time_zone = var.mysql_time_zone
}

module "ses" {
source = "./modules/ses"
count = var.enable_ses ? 1 : 0
depends_on = [module.vpc]
domain_name = var.domain_name
zone_id = var.hosted_zone_id
source = "./modules/ses"
count = var.enable_ses ? 1 : 0
depends_on = [module.vpc]
domain_name = var.domain_name
zone_id = var.hosted_zone_id
}

module "bastion" {
Expand Down
5 changes: 5 additions & 0 deletions terraform/modules/rds/rds_parameter_group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ resource "aws_db_parameter_group" "custom_mysql_parameters" {
name = "collation_server"
value = "utf8_general_ci"
}

parameter {
name = "time_zone"
value = var.mysql_time_zone
}
}
7 changes: 6 additions & 1 deletion terraform/modules/rds/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ variable "mysql_version" {
variable "rds_instance_class" {
type = string
description = "Instance class for RDS Instance"
}
}

variable "mysql_time_zone" {
type = string
description = "Time Zone for RDS Instance"
}
1 change: 1 addition & 0 deletions terraform/nonprod.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ vpc_cidr_block = "10.0.0.0/16"
rds_instance_class = "db.t3.large"
mysql_version = "5.7"
mysql_rds_port = "3306"
mysql_time_zone = "Asia/Calcutta"
enable_bastion_host = false
bastion_public_access_cidr = "0.0.0.0/0"
enable_ses = true
5 changes: 5 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ variable "mysql_rds_port" {
description = "RDS Port for MySQL Instance"
}

variable "mysql_time_zone" {
type = string
description = "Time Zone for RDS Instance"
}

variable "enable_bastion_host" {
type = bool
description = "Toggle for Bastion Host"
Expand Down

0 comments on commit bb49150

Please sign in to comment.