跳到正文
Skillpedia
部署与云(DevOps)48k · #3864

aws-rds

它能做什么

这个工具帮你在亚马逊云(AWS RDS)上创建和管理关系型数据库。你可以配置自动备份、复制到其他位置(复制,即 replication),以及安全措施。

适用场景

  • ✓当你的应用需要一个可靠的数据库时。
  • ✓当你希望数据能自动保存并可以恢复时。
  • ✓当你需要数据库的副本来提高读取速度或用于灾难恢复时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/aws-rds/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/aws-rds/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“为我的网页应用创建一个 PostgreSQL 数据库,要求每天备份,并具备高可用性。”

每周 5 个新技能,1 分钟读完。

工作原理

你提供想要的数据库类型等详细信息,工具会使用特定的 AWS 命令完成所有设置,包括创建、安全配置和日常维护。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

AWS RDS

Deploy and manage Amazon RDS relational databases with production-grade backups, replication, monitoring, and security.

When to Use This Skill

  • Provisioning a managed PostgreSQL, MySQL, MariaDB, Oracle, or SQL Server database
  • Setting up Multi-AZ deployments for high availability
  • Creating read replicas for horizontal read scaling
  • Configuring automated backups, snapshots, and point-in-time recovery
  • Tuning database parameters for performance
  • Migrating from self-managed databases to RDS
  • Monitoring database performance and setting up alarms

Prerequisites

  • AWS CLI v2 installed and configured
  • IAM permissions: rds:*, ec2:DescribeSecurityGroups, ec2:DescribeSubnets, kms:*, cloudwatch:*
  • A VPC with at least two subnets in different AZs (for subnet group)
  • Security group allowing database port access from application subnets only

Create a DB Subnet Group

# Create a subnet group spanning two AZs
aws rds create-db-subnet-group \
  --db-subnet-group-name production-db-subnets \
  --db-subnet-group-description "Production database subnets" \
  --subnet-ids subnet-private-a subnet-private-b

# List subnet groups
aws rds describe-db-subnet-groups \
  --query "DBSubnetGroups[].{Name:DBSubnetGroupName,VPC:VpcId,Status:SubnetGroupStatus}" \
  --output table

Create a Production Database

# Create a PostgreSQL 16 Multi-AZ instance
aws rds create-db-instance \
  --db-instance-identifier production-api-db \
  --db-instance-class db.r6g.large \
  --engine postgres \
  --engine-version 16.4 \
  --master-username appadmin \
  --manage-master-user-password \
  --allocated-storage 100 \
  --max-allocated-storage 500 \
  --storage-type gp3 \
  --storage-encrypted \
  --kms-key-id alias/rds-key \
  --vpc-security-group-ids sg-db-access \
  --db-subnet-group-name production-db-subnets \
  --db-name appdb \
  --backup-retention-period 14 \
  --preferred-backup-window "03:00-04:00" \
  --preferred-maintenance-window "sun:05:00-sun:06:00" \
  --multi-az \
  --auto-minor-version-upgrade \
  --deletion-protection \
  --copy-tags-to-snapshot \
  --monitoring-interval 60 \
  --monitoring-role-arn arn:aws:iam::123456789012:role/rds-monitoring-role \
  --enable-performance-insights \
  --performance-insights-retention-period 7 \
  --enable-cloudwatch-logs-exports '["postgresql","upgrade"]' \
  --tags '[
    {"Key":"Environment","Value":"production"},
    {"Key":"Team","Value":"backend"},
    {"Key":"Backup","Value":"daily"}
  ]'

# Wait for instance to become available
aws rds wait db-instance-available --db-instance-identifier production-api-db

# Get connection endpoint
aws rds describe-db-instances \
  --db-instance-identifier production-api-db \
  --query "DBInstances[0].Endpoint.{Address:Address,Port:Port}" \
  --output table

Retrieve Master Password from Secrets Manager

# When using --manage-master-user-password, RDS stores the password in Secrets Manager
aws rds describe-db-instances \
  --db-instance-identifier production-api-db \
  --query "DBInstances[0].MasterUserSecret.SecretArn" \
  --output text

# Retrieve the secret value
aws secretsmanager get-secret-value \
  --secret-id arn:aws:secretsmanager:us-east-1:123456789012:secret:rds-db-secret-abc123 \
  --query SecretString --output text

Parameter Groups

# Create a custom parameter group
aws rds create-db-parameter-group \
  --db-parameter-group-name production-pg16 \
  --db-parameter-group-family postgres16 \
  --description "Production PostgreSQL 16 parameters"

# Set performance parameters
aws rds modify-db-parameter-group \
  --db-parameter-group-name production-pg16 \
  --parameters \
    "ParameterName=max_connections,ParameterValue=200,ApplyMethod=pending-reboot" \
    "ParameterName=shared_buffers,ParameterValue={DBInstanceClassMemory/4},ApplyMethod=pending-reboot" \
    "ParameterName=effective_cache_size,ParameterValue={DBInstanceClassMemory*3/4},ApplyMethod=pending-reboot" \
    "ParameterName=work_mem,ParameterValue=65536,ApplyMethod=immediate" \
    "ParameterName=maintenance_work_mem,ParameterValue=524288,ApplyMethod=immediate" \
    "ParameterName=random_page_cost,ParameterValue=1.1,ApplyMethod=immediate" \
    "ParameterName=log_min_duration_statement,ParameterValue=1000,ApplyMethod=immediate" \
    "ParameterName=log_statement,ParameterValue=ddl,ApplyMethod=immediate" \
    "ParameterName=idle_in_transaction_session_timeout,ParameterValue=60000,ApplyMethod=immediate"


…
常见问题

什么是关系型数据库?

这是一种把数据组织成表格的数据库,类似电子表格,由行和列构成,便于查询和关联信息。

“高可用性”是什么意思?

指数据库经过特殊设置,当其中一部分出现故障时,另一部分会自动接管,从而把停机时间降到最低,保证你的应用持续运行。

什么是“只读副本”?

它是主数据库的副本,专门用于处理读取请求。这样可以避免主数据库负载过高,并让读取速度更快。

详情

作者的原始描述

Provision and manage RDS databases. Configure backups, replication, and security. Use when deploying managed relational databases on AWS.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#3864
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能