Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. Download free →
CLSkills
Cloud (AWS/GCP/Azure)intermediate

RDS Setup

Share

Configure RDS database connection

Works with OpenClaude

You are an AWS cloud infrastructure engineer. The user wants to configure and establish a connection to an Amazon RDS database instance.

What to check first

  • Run aws ec2 describe-security-groups to verify your security group exists and has inbound rules for port 3306 (MySQL/MariaDB), 5432 (PostgreSQL), or 1433 (SQL Server)
  • Run aws rds describe-db-instances --query 'DBInstances[*].[DBInstanceIdentifier,Endpoint.Address,Engine]' to list existing RDS instances and their endpoints

Steps

  1. Create an RDS instance using aws rds create-db-instance --db-instance-identifier mydbinstance --db-instance-class db.t3.micro --engine mysql --master-username admin --master-user-password YourPassword123 --allocated-storage 20
  2. Wait for the instance to reach "available" status with aws rds describe-db-instances --db-instance-identifier mydbinstance --query 'DBInstances[0].DBInstanceStatus'
  3. Retrieve the RDS endpoint from aws rds describe-db-instances --db-instance-identifier mydbinstance --query 'DBInstances[0].Endpoint.Address'
  4. Create or modify the security group to allow inbound traffic on the database port from your application's security group using aws ec2 authorize-security-group-ingress --group-id sg-xxxxx --protocol tcp --port 3306 --source-security-group-id sg-yyyyy
  5. Install the database client tool locally: mysql-client, psql, or sqlcmd depending on your engine type
  6. Test the connection using the endpoint, username, and password you configured
  7. Store credentials securely in AWS Secrets Manager with aws secretsmanager create-secret --name rds/mydb/credentials --secret-string '{"username":"admin","password":"YourPassword123"}'
  8. Update your application connection string to use the RDS endpoint and retrieve credentials from Secrets Manager at runtime

Code

import boto3
import pymysql
from botocore.exceptions import ClientError
import json

def setup_rds_connection(db_instance_id, secret_name, region='us-east-1'):
    """
    Retrieve RDS endpoint and credentials from AWS Secrets Manager,
    then establish database connection.
    """
    rds_client = boto3.client('rds', region_name=region)
    secrets_client = boto3.client('secretsmanager', region_name=region)
    
    try:
        # Get RDS instance endpoint
        rds_response = rds_client.describe_db_instances(
            DBInstanceIdentifier=db_instance_id
        )
        db_endpoint = rds_response['DBInstances'][0]['Endpoint']['Address']
        db_port = rds_response['DBInstances'][0]['Endpoint']['Port']
        db_

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
cloudawsrds

Install command:

curl -o ~/.claude/skills/rds-setup.md https://claude-skills-hub.vercel.app/skills/cloud/rds-setup.md

Related Cloud (AWS/GCP/Azure) Skills

Other Claude Code skills in the same category — free to download.

Want a Cloud (AWS/GCP/Azure) skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.