Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ops-north/shipyard/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The RDS module creates Amazon RDS database instances (PostgreSQL, MySQL, or MariaDB) with security groups, subnet groups, parameter groups, and automated password generation.Features
Multiple Database Engines
Support for PostgreSQL, MySQL, and MariaDB
Automated Backups
Configurable backup retention and maintenance windows
Encryption
Encryption at rest with KMS (enabled by default)
Security Groups
Automatic security group with CIDR and security group ID allow lists
Password Generation
Automatic secure password generation if not provided
Multi-AZ
Optional Multi-AZ deployment for high availability
Usage Examples
Basic PostgreSQL Instance
If
password is not provided, a random 24-character password is generated and stored in Terraform state as a sensitive output.Production PostgreSQL with Multi-AZ
MySQL Database
With Custom Parameters
Public RDS (Not Recommended)
Inputs
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
identifier | RDS instance name | string | n/a | yes |
engine | Database engine (postgres, mysql, mariadb) | string | "postgres" | no |
engine_version | Engine version | string | "15" | no |
instance_class | Instance type | string | "db.t3.micro" | no |
allocated_storage | Storage in GB | number | 20 | no |
max_allocated_storage | Max storage for autoscaling (0 = disabled) | number | 0 | no |
storage_type | Storage type (gp2, gp3, io1) | string | "gp2" | no |
storage_encrypted | Enable encryption | bool | true | no |
kms_key_id | Custom KMS key ARN | string | null | no |
db_name | Database name | string | n/a | yes |
username | Master username | string | n/a | yes |
password | Master password (auto-generated if null) | string | null | no |
port | Database port | number | 5432 | no |
vpc_id | VPC ID | string | n/a | yes |
subnet_ids | Subnet IDs for DB subnet group | list(string) | n/a | yes |
publicly_accessible | Allow public access | bool | false | no |
allowed_security_group_ids | Security groups allowed to connect | list(string) | [] | no |
allowed_cidr_blocks | CIDR blocks allowed to connect | list(string) | [] | no |
multi_az | Enable Multi-AZ | bool | false | no |
backup_retention_period | Backup retention days | number | 7 | no |
deletion_protection | Enable deletion protection | bool | false | no |
performance_insights_enabled | Enable Performance Insights | bool | false | no |
family | Parameter group family | string | "postgres15" | no |
parameters | Custom DB parameters | list(object) | [] | no |
tags | Tags to apply | map(string) | {} | no |
Outputs
| Name | Description |
|---|---|
db_instance_id | RDS instance ID |
db_instance_endpoint | Connection endpoint (host:port) |
db_instance_address | Hostname |
db_instance_port | Port |
db_instance_name | Database name |
db_instance_username | Master username (sensitive) |
db_instance_password | Master password (sensitive) |
security_group_id | Security group ID |
connection_string | PostgreSQL connection string template |
Connection Strings
Using Terraform Outputs
PostgreSQL Connection
MySQL Connection
From Application
- Go
- Python
- Node.js
Security Best Practices
Private Subnets
Always deploy RDS in private subnets without public access.
Encryption
Enable encryption at rest using KMS keys for sensitive data.
Strong Passwords
Use auto-generated passwords or strong custom passwords (min 24 characters).
Least Privilege
Restrict security group access to only required sources.
Backup Retention
Set appropriate backup retention (7-35 days for production).
Deletion Protection
Enable deletion protection for production databases.
Performance Tuning
Instance Sizing
| Workload | Instance Class | Storage |
|---|---|---|
| Development | db.t3.micro | 20 GB gp2 |
| Small Production | db.t3.medium | 100 GB gp3 |
| Medium Production | db.m5.large | 500 GB gp3 |
| Large Production | db.m5.2xlarge | 1 TB io1 |
Storage Auto-Scaling
Performance Insights
Enable for production databases:Backup and Recovery
Automated Backups
Manual Snapshot
Restore from Snapshot
Troubleshooting
Cannot Connect to Database
Check security group rules:Performance Issues
Check Performance Insights:- RDS Console → Performance Insights
- Look for slow queries and high wait events
Storage Full
Enable auto-scaling:Cost Optimization
Right-Size Instances
Right-Size Instances
Start with smaller instances and scale based on CloudWatch metrics. Over-provisioning wastes money.Development: db.t3.micro (~150/month)
Use gp3 Instead of gp2
Use gp3 Instead of gp2
gp3 provides better baseline performance at lower cost:
- 100 GB gp2: ~$11.50/month
- 100 GB gp3: ~$10.00/month
Reduce Backup Retention
Reduce Backup Retention
Shorter retention saves on backup storage costs:
- Development: 7 days
- Production: 14-30 days
Use Single-AZ for Dev
Use Single-AZ for Dev
Multi-AZ doubles RDS costs. Only use in production:
- Single-AZ: $150/month
- Multi-AZ: $300/month
Related Documentation
VPC Module
Create VPC and subnets for RDS
EKS Module
Connect RDS to EKS workloads
K8s Scheduler Configuration
Configure database connection
Infrastructure Guide
Complete deployment workflow