Database Deployment Guide
CloudForge 3.0 Database Integration
This guide explains how to deploy applications with RDS databases in CloudForge, including automatic database provisioning, compliance enforcement, and automated remediation.
Table of Contentsโ
- Overview
- Database Requirements by Application
- Deployment Configuration
- Compliance & Security
- Automated Remediation
- Best Practices
- Troubleshooting
Overviewโ
CloudForge 3.0 introduces automatic database provisioning for applications that require persistent storage. Applications declare their database requirements through the DatabaseSpec interface, and CloudForge automatically provisions RDS instances with compliance-enforced configurations.
Key Featuresโ
- โ Automatic RDS provisioning - CloudForge creates and configures RDS instances
- โ Compliance enforcement - Automatic encryption, backups, Multi-AZ for production
- โ Secrets management - Database credentials stored in AWS Secrets Manager
- โ Automated remediation - AWS Config rules detect and fix compliance violations
- โ Framework-specific rules - PCI-DSS, HIPAA, SOC2, GDPR validation
- โ Optional provisioning - Some applications support both RDS and embedded databases
Supported Database Enginesโ
CloudForge 3.0 supports the following RDS database engines:
| Engine | Supported Versions | Use Cases |
|---|---|---|
| PostgreSQL | 11, 12, 13, 14, 15, 16 | Most applications (GitLab, Mattermost, Harbor, Superset, Metabase, Grafana) |
| MySQL | 5.7, 8.0, 8.0.32-35 | Legacy applications requiring MySQL |
| MariaDB | 10.6, 10.11 | MySQL-compatible alternative |
Note: Aurora PostgreSQL and Aurora MySQL are defined in the interface but not yet implemented in RdsFactory. Regular RDS instances are provisioned instead.
Database Requirements by Applicationโ
CloudForge applications have three types of database requirements:
1. REQUIRED Databasesโ
These applications MUST have an RDS database to function:
| Application | Database | Instance | Storage | Backup Days | Notes |
|---|---|---|---|---|---|
| GitLab | PostgreSQL 14 | db.t3.medium | 50GB | 30 | Required for all environments |
| Mattermost | PostgreSQL 13 | db.t3.small | 30GB | 14 | No embedded DB support |
| Superset | PostgreSQL 13 | db.t3.small | 20GB | 14 | Metadata storage |
| Harbor | PostgreSQL 13 | db.t3.medium | 50GB | 30 | Registry metadata |
Deployment:
// Database is automatically provisioned
Map<String, Object> cfc = new HashMap<>();
cfc.put("runtimeType", "FARGATE");
cfc.put("securityProfile", "production");
cfc.put("applicationId", "gitlab"); // Database created automatically
2. OPTIONAL Databasesโ
These applications can use either RDS or embedded databases:
| Application | RDS Database | Embedded DB | Default | Notes |
|---|---|---|---|---|
| Metabase | PostgreSQL 15 | H2 | H2 (dev/staging) | Use RDS for HA |
| Grafana | PostgreSQL 14 | SQLite | SQLite (dev/staging) | Use RDS for multi-instance |
Deployment with RDS:
Map<String, Object> cfc = new HashMap<>();
cfc.put("runtimeType", "FARGATE");
cfc.put("securityProfile", "production");
cfc.put("applicationId", "metabase");
cfc.put("provisionDatabase", true); // โ Enable RDS provisioning
Deployment without RDS (embedded):
Map<String, Object> cfc = new HashMap<>();
cfc.put("runtimeType", "FARGATE");
cfc.put("securityProfile", "dev");
cfc.put("applicationId", "metabase");
// provisionDatabase defaults to false โ uses H2 embedded
โ ๏ธ Important: Embedded databases (H2, SQLite) do not support multiple instances due to file locking. For high availability, use RDS.
3. NO Databaseโ
These applications do not require databases:
- Jenkins
- Gitea
- Drone
- Prometheus
- Nexus
- Vault
- Redis
- PostgreSQL
Deployment Configurationโ
Basic RDS Deploymentโ
import com.cloudforgeci.samples.app.InteractiveDeployer;
public class MyDeployment {
public static void main(String[] args) {
Map<String, Object> cfc = new HashMap<>();
// Basic settings
cfc.put("stackName", "my-gitlab");
cfc.put("region", "us-east-1");
cfc.put("runtimeType", "FARGATE");
cfc.put("securityProfile", "production");
cfc.put("applicationId", "gitlab");
// Database automatically provisioned for GitLab
InteractiveDeployer.deploy(cfc);
}
}
Custom Database Configurationโ
Override default database settings:
// Custom instance size
cfc.put("dbInstanceClass", "db.t3.large"); // Default: varies by app
// Custom storage
cfc.put("dbAllocatedStorage", 100); // Default: varies by app (20-50GB)
// Custom backup retention
cfc.put("dbBackupRetentionDays", 30); // Default: 7-30 days
// Custom database name
cfc.put("dbName", "my_custom_db"); // Default: app-specific
// Custom PostgreSQL version
cfc.put("dbEngineVersion", "15.4"); // Default: varies by app (13-15)
Optional Database Provisioningโ
For applications with OPTIONAL database support:
// Metabase with RDS (production)
Map<String, Object> cfc = new HashMap<>();
cfc.put("applicationId", "metabase");
cfc.put("securityProfile", "production");
cfc.put("provisionDatabase", true); // โ Use RDS PostgreSQL
// Metabase with H2 (development)
Map<String, Object> cfc = new HashMap<>();
cfc.put("applicationId", "metabase");
cfc.put("securityProfile", "dev");
// provisionDatabase defaults to false โ uses H2
Multi-AZ Deploymentโ
For high availability in production:
cfc.put("securityProfile", "production");
cfc.put("dbMultiAz", true); // Enabled by default for PRODUCTION
Compliance & Securityโ
CloudForge enforces compliance requirements automatically based on your security profile and compliance frameworks.
Encryptionโ
Encryption at Rest (Automatic)
- All RDS instances use AWS KMS encryption
- Enforced for all security profiles
- Validates PCI-DSS Req 3.4, HIPAA ยง164.312(a)(2)(iv), GDPR Art.32
// Encryption is automatic - no configuration needed
cfc.put("securityProfile", "production");
// RDS instance created with KMS encryption
Encryption in Transit (Automatic)
- SSL/TLS required for all database connections
- SSL mode:
require(PostgreSQL) - Enforced via connection strings
Automated Backupsโ
Backup retention is automatic and compliance-enforced:
| Security Profile | Default Retention | Compliance |
|---|---|---|
| DEV | 7 days | Optional |
| STAGING | 14 days | SOC2 recommended |
| PRODUCTION | 30 days | HIPAA, PCI-DSS required |
// Custom backup retention
cfc.put("dbBackupRetentionDays", 30); // Override default
// Backup window (optional)
cfc.put("dbBackupWindow", "03:00-04:00"); // UTC
cfc.put("dbMaintenanceWindow", "sun:04:00-sun:05:00"); // UTC
Compliance Framework Enforcementโ
Enable compliance frameworks to activate framework-specific validation:
cfc.put("complianceFrameworks", "HIPAA,SOC2");
cfc.put("awsConfigEnabled", true); // Enable AWS Config monitoring
Framework-Specific Requirements:
PCI-DSS (Payment Card Industry)โ
- โ Req 3.4: Encryption at rest (KMS)
- โ Req 4.1: Encryption in transit (SSL/TLS)
- โ Req 6.2: Automatic minor version upgrades
- โ Req 10.2: Database activity logging
HIPAA (Healthcare)โ
- โ ยง164.312(a)(2)(iv): Encryption mechanisms
- โ ยง164.310(d): Automated backups (7-30 days)
- โ ยง164.308(a)(7)(ii)(B): High availability (Multi-AZ)
- โ ยง164.312(b): Audit controls
SOC2 (Service Organization Controls)โ
- โ CC6.8: Encryption at rest
- โ A1.2: Availability (Multi-AZ for production)
- โ A1.3: Backup procedures
- โ CC7.2: System monitoring
GDPR (Data Protection)โ
- โ Art.32: Security of processing (encryption)
- โ Art.32(1)(c): Backup and recovery capability
- โ Art.30: Records of processing activities
Automated Remediationโ
CloudForge can automatically remediate database compliance violations using AWS Config rules.
Available Remediationsโ
1. RDS Deletion Protectionโ
Automatically enables deletion protection on RDS instances to prevent accidental deletion.
Compliance: HIPAA, SOC2, GDPR
Enable:
cfc.put("awsConfigEnabled", true);
cfc.put("complianceFrameworks", "HIPAA");
cfc.put("enableRdsDeletionProtectionRemediation", true);
What it does:
- AWS Config rule detects RDS instances without deletion protection
- SSM Automation document automatically enables deletion protection
- Retries up to 5 times with 60-second intervals
- Works for all RDS instance types
Framework-Specific Behavior:
| Framework | Environments | Remediation |
|---|---|---|
| SOC2 | PRODUCTION only | โ Enabled |
| HIPAA | All environments | โ Enabled |
| GDPR | All environments | โ Enabled |
| PCI-DSS | N/A |