Upgrading¶
3.x → 4.x (RDS module + MySQL 8.4) — breaking¶
This major version replaces the in-module aws_db_instance with the InfraHouse rds module and pins MySQL 8.4. It is a breaking change for both callers and existing deployments.
Breaking changes¶
- Database engine and ownership. RDS is now created by
module.rdsat MySQL 8.4. The Terraform address of the instance changes, and the registry module cannot adopt the existing instance — so a plainapplywould destroy and recreate the database. Data must be migrated with a logical dump/restore. See the cold-cutover runbook. - New required inputs:
environment(the default was removed) andaccess_log_replication_region. - AWS provider v5 dropped. The constraint is now
>= 6.0, < 7.0. db_instance_typedefault moveddb.t3.micro→db.t3.medium(Performance Insights is now unconditional and unsupported on the small burstable classes).- website-pod 6.x.
internet_gateway_idandalb_access_log_enabledare removed; cross-region access-log replication (access_log_replication_region) is required. - Removed inputs: the per-alarm RDS threshold variables and
enable_rds_*toggles (RDS alarms are now provided bymodule.rds), plusdb_identifierandenable_ses_alarms(SES alarms are always on).
Behavior changes to note¶
- Performance Insights is always on (retention via
rds_performance_insights_retention_days). - RDS log exports are error + slow-query only (the previous
generallog export is gone). alarm_emailsis now also consumed by therdsandwebsite-podsub-modules, so subscribers receive multiple SNS confirmation emails.
Database migration runbook¶
Migrating an existing MySQL 8.0 deployment to the 8.4 module.rds instance is a logical dump/restore (which doubles as the 8.0→8.4 upgrade — the schema is rebuilt by 8.4, and only the application database moves). The full step-by-step runbook (cold cutover, downtime acceptable) lives in the repository at MIGRATION.md.
In short:
- Stop writes (
php artisan down/ scale the ASG to 0). - Snapshot the old instance (rollback safety net) and disable its
deletion_protection. mysqldumpthe old 8.0 database (--set-gtid-purged=OFF --no-tablespaces --single-transaction).terraform applythis version (creates the empty 8.4module.rdsinstance; destroys the old one).- Load the dump into the new instance (
mysqldump's defaultDROP TABLE IF EXISTScleanly replaces any schema Puppet created). - Bring the app up, run
php artisan migrate --force, and verify (login, pages, uploads, search).
Warning
Take the snapshot and the dump before running terraform apply — the apply destroys the old instance, after which the snapshot is your only rollback.
BookStack officially supports MySQL 8.4, so no application-level changes are required.