Token导航 LogoToken导航TokenDH.com
运维和基础设施敏感数据github未标认证来源可访问许可证需确认审计异常

aws-rds-spring-boot-integrationAWS RDS spring boot 集成

Agent Skill

用于辅助 Java 项目开发、面向对象设计、Spring 生态、Maven 或 Gradle 依赖和后端工程实践。它适合让 Agent 分析类结构、设计接口、整理服务分层、生成测试或检查常见代码坏味道。使用时需要结合项目已有架构、包结构和依赖版本,不应只按通用教程改代码;涉及数据库、事务、并发或框架配置时,应先确认运行环境和回归测试范围。

总安装

16,414

周安装

664

GitHub Stars

229

下载量

5,153
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:aws-rds-spring-boot-integration(AWS RDS spring boot 集成)
来源仓库:https://github.com/giuseppe-trisciuoglio/developer-kit
仓库路径:skills/aws-rds-spring-boot-integration
安装命令:
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill aws-rds-spring-boot-integration
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill aws-rds-spring-boot-integration

简介

适用于使用 Aurora、MySQL 和 PostgreSQL 的 Spring Boot 应用程序的生产就绪型 AWS RDS 配置模式。

  • 支持 Aurora MySQL、Aurora PostgreSQL 和标准 MySQL/PostgreSQL,具有数据源配置、HikariCP 连接池和 SSL 加密
  • 包括特定于环境的配置文件(开发/生产)、Flyway 数据库迁移以及针对读密集型工作负载的读/写端点拆分
  • 使用环境变量和 AWS Secrets Manager 集成提供安全模式以进行凭证管理
  • 涵盖生产部署的连接池优化、故障转移处理、监控设置和运行状况检查端点

SKILL.md

AWS RDS Spring Boot Integration

Overview

Configure AWS RDS databases (Aurora, MySQL, PostgreSQL) with Spring Boot applications. Provides patterns for datasource configuration, HikariCP connection pooling, SSL connections, environment-specific configurations, and AWS Secrets Manager integration.

When to Use

Use when configuring HikariCP connection pools for RDS workloads, implementing read/write split with Aurora replicas, setting up IAM database authentication, enabling SSL/TLS connections, managing database migrations with Flyway, or troubleshooting RDS connectivity issues.

Instructions

Follow these steps to configure AWS RDS with Spring Boot:

  1. Add Dependencies — Include Spring Data JPA, database driver (MySQL/PostgreSQL), and Flyway
  2. Configure Datasource — Set connection properties in application.yml
  3. Configure HikariCP — Optimize pool settings for your RDS workload
  4. Set Up SSL — Enable encrypted connections to RDS
  5. Configure Profiles — Set environment-specific configurations (dev/prod)
  6. Add Migrations — Create Flyway scripts for schema management
  7. Validate Connectivity — Run health check to verify database connection If validation fails: Check security group rules, verify credentials, ensure RDS is accessible from your network, and confirm SSL certificate configuration.
  8. Run Migrations — Apply Flyway migrations only after connectivity validation passes

Quick Start

Step 1: Add Dependencies

Maven (pom.xml):

<dependencies>
    <!-- Spring Data JPA -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

    <!-- Aurora MySQL Driver -->
    <dependency>
        <groupId>com.mysql</groupId>
        <artifactId>mysql-connector-j</artifactId>
        <version>8.2.0</version>
        <scope>runtime</scope>
    </dependency>

    <!-- Aurora PostgreSQL Driver (alternative) -->
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <scope>runtime</scope>
    </dependency>

    <!-- Flyway for database migrations -->
    <dependency>
        <groupId>org.flywaydb</groupId>
        <artifactId>flyway-core</artifactId>
    </dependency>

    <!-- Validation -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>
</dependencies>

Gradle (build.gradle):

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-validation'

    // Aurora MySQL
    runtimeOnly 'com.mysql:mysql-connector-j:8.2.0'

    // Aurora PostgreSQL (alternative)
    runtimeOnly 'org.postgresql:postgresql'

    // Flyway
    implementation 'org.flywaydb:flyway-core'
}

Step 2: Basic Datasource Configuration

Use the configuration in the Examples section below. For PostgreSQL, change:

  • Driver: org.postgresql.Driver
  • URL: jdbc:postgresql://... with ?ssl=true&sslmode=require
  • Dialect: org.hibernate.dialect.PostgreSQLDialect

Step 3: Set Up Environment Variables

# Production environment variables
export DB_PASSWORD=YourStrongPassword123!
export SPRING_PROFILES_ACTIVE=prod

# For development
export SPRING_PROFILES_ACTIVE=dev

Database Migration Setup

Create migration files for Flyway:

src/main/resources/db/migration/
├── V1__create_users_table.sql
├── V2__add_phone_column.sql
└── V3__create_orders_table.sql

V1__create_users_table.sql:

CREATE TABLE users (
    id BIGINT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    email VARCHAR(255) NOT NULL UNIQUE,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    INDEX idx_email (email)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Examples

Example 1: Aurora MySQL Configuration

spring:
  datasource:
    url: jdbc:mysql://myapp-aurora-cluster.cluster-abc123xyz.us-east-1.rds.amazonaws.com:3306/devops
    username: admin
    password: ${DB_PASSWORD}
    driver-class-name: com.mysql.cj.jdbc.Driver
    hikari:
      maximum-pool-size: 20
      minimum-idle: 5
      connection-timeout: 20000
  jpa:
    hibernate:
      ddl-auto: validate
    open-in-view: false

Example 2: Aurora PostgreSQL with SSL

spring.datasource.url=jdbc:postgresql://myapp-aurora-pg-cluster.cluster-abc123xyz.us-east-1.rds.amazonaws.com:5432/devops?ssl=true&sslmode=require
spring.datasource.username=${DB_USERNAME}
spring.datasource.password=${DB_PASSWORD}
spring.datasource.hikari.maximum-pool-size=30
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect

Example 3: Read/Write Split Configuration

@Configuration
public class DataSourceConfiguration {

    @Bean
    @Primary
    public DataSource dataSource(
            @Qualifier("writerDataSource") DataSource writerDataSource,
            @Qualifier("readerDataSource") DataSource readerDataSource) {
        Map<Object, Object> targetDataSources = new HashMap<>();
        targetDataSources.put("writer", writerDataSource);
        targetDataSources.put("reader", readerDataSource);

        RoutingDataSource routingDataSource = new RoutingDataSource();
        routingDataSource.setTargetDataSources(targetDataSources);
        routingDataSource.setDefaultTargetDataSource(writerDataSource);

        return routingDataSource;
    }
}

Constraints and Warnings

  • HikariCP pool size must respect RDS instance connection limits
  • Security groups must allow traffic from your application's IP range
  • Use AWS Secrets Manager instead of hardcoding credentials
  • Enable storage autoscaling to prevent storage exhaustion

Best Practices

  • HikariCP: Enable leak detection and configure timeouts for failover scenarios
  • Security: Enable SSL/TLS; use IAM Database Authentication when possible
  • Performance: Disable open-in-view; use appropriate indexing and batch operations
  • Monitoring: Enable Spring Boot Actuator with database health checks

Testing

Verify connectivity with this health check endpoint:

@RestController
@RequestMapping("/api/health")
public class DatabaseHealthController {
    @Autowired
    private DataSource dataSource;

    @GetMapping("/db-connection")
    public ResponseEntity<Map<String, Object>> testDatabaseConnection() {
        Map<String, Object> response = new HashMap<>();
        try (Connection connection = dataSource.getConnection()) {
            response.put("status", "success");
            response.put("database", connection.getCatalog());
            response.put("connected", true);
            return ResponseEntity.ok(response);
        } catch (Exception e) {
            response.put("status", "failed");
            response.put("error", e.getMessage());
            response.put("connected", false);
            return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE).body(response);
        }
    }
}
curl http://localhost:8080/api/health/db-connection

Support

For detailed troubleshooting and advanced configuration, refer to:

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.61%
按下载量换算1,990

Claude

29.58%
按下载量换算1,524

Cursor

19.57%
按下载量换算1,008

Gemini CLI

10.09%
按下载量换算520

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills