fix(localgov-drupal): stop MariaDB client verifying Aurora TLS cert#186
Merged
Conversation
The MariaDB CLI in the Alpine base image verifies TLS server certs by default and does not trust the Amazon RDS CA, so every DB probe in init-drupal.sh failed instantly with "Certificate verification failure" and the container silently fell back to an uninstalled state. - Dockerfile: drop /etc/my.cnf.d/rds-ssl.cnf and /root/.my.cnf disabling cert verification for the CLI. PHP PDO has its own TLS stack and is unaffected. Traffic stays inside the VPC. - init-drupal.sh: MAX_DB_RETRIES 60 -> 180 and add --connect-timeout=3 so a single hung TCP attempt cannot burn the retry budget. - entrypoint.sh: propagate the init script's exit code out of the tee pipe and exit the container on failure so ECS restarts the task instead of serving supervisord with no Drupal. - database.ts: Aurora Serverless v2 max capacity 2 -> 8 ACU so the 33-module first-boot install does not peg the cluster; idle cost unchanged (scales back to min). - localgov-drupal-stack.ts: bump ReadSecretFn to NODEJS_22_X.
This was referenced Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Drupal init was silently failing on every new sandbox deploy with
Database not readyfor 5 minutes then falling back to an uninstalled supervisord state.Root cause: the MariaDB CLI in the Alpine base image verifies TLS server certs by default and the Amazon RDS CA isn't in its trust store, so every
mysql … -e "SELECT 1"probe failed instantly withERROR 2026 (HY000): TLS/SSL error: Certificate verification failure. The DB was always up; the probe was broken.Changes
/etc/my.cnf.d/rds-ssl.cnf+/root/.my.cnfwithssl-verify-server-cert=OFF. PHP PDO has its own TLS stack and is unaffected; traffic stays inside the VPC.MAX_DB_RETRIES60→180 and--connect-timeout=3on the probe so a single hung TCP attempt can't burn the budget.teeand exit the container on failure so ECS restarts the task instead of serving supervisord with no Drupal.ReadSecretFnruntime to NODEJS_22_X.Test plan
TLS/SSL error: Certificate verification failurefrom MariaDB CLI/root/.my.cnfwithssl-verify-server-cert=OFFin the running task, re-launched init-drupal.sh → DB probe succeeded first try, install completed, site up at CloudFront URL