SKILL.md--- name: rds description: AWS RDS relational database service for managed databases. Use when provisioning databases, configuring backups, managing replicas, troubleshooting connectivity, or optimizing performance. last_updated: "2026-01-07" doc_source: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/ --- # AWS RDS Amazon Relational Database Service (RDS) provides managed relational databases including MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, and Aurora. RDS handles provisioning, patching, backups, and failover. ## Table of Contents - [Core Concepts](#core-concepts) - [Common Patterns](#common-patterns) - [CLI Reference](#cli-reference) - [Best Practices](#best-practices) - [Troubleshooting](#troubleshooting) - [References](#references) ## Core Concepts ### DB Instance Classes | Category | Example | Use Case | |----------|---------|----------| | Standard | db.m6g.large | General purpose | | Memory Optimized | db.r6g.large | High memory workloads | | Burstable | db.t3.medium | Variable workloads, dev/test | ### Storage Types | Type | IOPS | Use Case | |------|------|----------| | gp3 | 3,000-16,000 | Most workloads | | io1/io2 | Up to 256,000 | High-performance OLTP | | magnetic | N/A | Legacy, avoid | ### Multi-AZ Deployments - **Multi-AZ Instance**: Synchronous standby in different AZ - **Multi-AZ Cluster**: One writer, two reader instances (Aurora-like) ### Read Replicas Asynchronous copies for read scaling. Can be cross-region. ## Common Patterns ### Create a PostgreSQL Instance **AWS CLI:** ```bash # Create DB subnet group aws rds create-db-subnet-group \ --db-subnet-group-name my-db-subnet-group \ --db-subnet-group-description "Private subnets for RDS" \ --subnet-ids subnet-12345678 subnet-87654321 # Create security group (allow PostgreSQL from app) aws ec2 create-security-group \ --group-name rds-postgres-sg \ --description "RDS PostgreSQL access" \ --vpc-id vpc-12345678 aws ec2 authorize-security-group-ingress \ --group-id sg-rds12345 \ --protocol tcp \ --port 5432 \ --source-group sg-app12345 # Create RDS instance aws rds create-db-instance \ --db-instance-identifier my-postgres \ --db-instance-class db.t3.medium \ --engine postgres \ --engine-version 16.1 \ --master-username admin \ --master-user-password 'SecurePassword123!' \ --allocated-storage 100 \ --storage-type gp3 \ --db-subnet-group-name my-db-subnet-group \ --vpc-security-group-ids sg-rds12345 \ --multi-az \ --backup-retention-period 7 \ --storage-encrypted \ --no-publicly-accessible ``` **boto3:** ```python import boto3 rds = boto3.client('rds') response = rds.create_db_instance( DBInstanceIdentifier='my-postgres', DBInstanceClass='db.t3.medium', Engine='postgres', EngineVersion='16.1', MasterUsername='admin', MasterUserPassword='SecurePassword123!', AllocatedStorage=100, StorageType='gp3', DBSubnetGroupName='my-db-subnet-group', VpcSecurityGroupIds=['sg-rds12345'