RDS instances in AWS should have automatic minor version upgrades enabled by setting the auto_minor_version_upgrade attribute to true. This ensures that the database receives timely security patches and important bug fixes without manual intervention. If this attribute is set to false, as shown in the following configuration, the RDS instance will not automatically apply minor updates, potentially leaving it exposed to vulnerabilities and unsupported bugs until manually updated.
auto_minor_version_upgrade = false
This increases the risk of security incidents and database outages due to missed critical patches.
module"db"{source="terraform-aws-modules/rds/aws"version="~> 3.0"identifier="demodb"engine="mysql"engine_version="5.7.19"instance_class="db.t2.large"allocated_storage=5auto_minor_version_upgrade=truename="demodb"username="user"password="YourPwdShouldBeLongAndSecure!"port="3306"iam_database_authentication_enabled=truevpc_security_group_ids=["sg-12345678"]maintenance_window="Mon:00:00-Mon:03:00"backup_window="03:00-06:00" # Enhanced Monitoring - see example for details on how to create the role
# by yourself, in case you don't want to create it automatically
monitoring_interval="30"monitoring_role_name="MyRDSMonitoringRole"create_monitoring_role=truetags={Owner="user"Environment="dev"} # DB subnet group
subnet_ids=["subnet-12345678","subnet-87654321"] # DB parameter group
family="mysql5.7" # DB option group
major_engine_version="5.7" # Database Deletion Protection
deletion_protection=trueparameters=[{name="character_set_client"value="utf8mb4"},{name="character_set_server"value="utf8mb4"}]options=[{option_name="MARIADB_AUDIT_PLUGIN"option_settings=[{name="SERVER_AUDIT_EVENTS"value="CONNECT"},{name="SERVER_AUDIT_FILE_ROTATIONS"value="37"},]},]}