# CPU utilisation
awscloudwatchget-metric-statistics\--namespaceAWS/RDS\--metric-nameCPUUtilization\--dimensionsName=DBInstanceIdentifier,Value=idp-mvp-backstage\--start-time$(date-u-v-30M+%Y-%m-%dT%H:%M:%SZ)\--end-time$(date-u+%Y-%m-%dT%H:%M:%SZ)\--period300\--statisticsAverage\--regionus-east-1
# Free storage space
awscloudwatchget-metric-statistics\--namespaceAWS/RDS\--metric-nameFreeStorageSpace\--dimensionsName=DBInstanceIdentifier,Value=idp-mvp-backstage\--start-time$(date-u-v-30M+%Y-%m-%dT%H:%M:%SZ)\--end-time$(date-u+%Y-%m-%dT%H:%M:%SZ)\--period300\--statisticsAverage\--regionus-east-1
# Restart Backstage pods to force a fresh connection
kubectlrolloutrestartdeployment/backstage-nbackstage
# Watch pods come up
kubectlgetpods-nbackstage-w
# Check Backstage logs for DB connection errors
kubectllogsdeployment/backstage-nbackstage--tail=50
# List available snapshots
awsrdsdescribe-db-snapshots\--db-instance-identifieridp-mvp-backstage\--regionus-east-1\--query'DBSnapshots[*].{ID:DBSnapshotIdentifier,Time:SnapshotCreateTime,Status:Status}'\--outputtable
# Restore from the most recent snapshot to a new instance
awsrdsrestore-db-instance-from-db-snapshot\--db-instance-identifieridp-mvp-backstage-restored\--db-snapshot-identifier<snapshot-id>\--db-instance-classdb.t3.micro\--regionus-east-1\--no-publicly-accessible
# Wait for the restored instance to be available (~10 min)
awsrdswaitdb-instance-available\--db-instance-identifieridp-mvp-backstage-restored\--regionus-east-1
# Get the new endpoint
awsrdsdescribe-db-instances\--db-instance-identifieridp-mvp-backstage-restored\--query'DBInstances[0].Endpoint.Address'\--outputtext\--regionus-east-1
Update the DB host in Secrets Manager and restart Backstage:
# Connect to RDS via port-forward through a debug pod
kubectlrunpg-debug--image=postgres:15--restart=Never-nbackstage--sleep3600
kubectlexec-itpg-debug-nbackstage--psql\-h<rds-endpoint>-Ubackstage-dbackstage
--Checktablesizes
SELECTrelname,pg_size_pretty(pg_total_relation_size(oid))ASsize
FROMpg_classWHERErelkind='r'ORDERBYpg_total_relation_size(oid)DESCLIMIT10;
--Vacuumtoreclaimspace
VACUUMFULL;
Alternatively, increase RDS storage via Terraform: update allocated_storage in terraform/rds.tf and run terraform apply.