AWS RDS (Relational Database Service) management using AWS SDK for Java 2.x. Use when creating, modifying, monitoring, or managing Amazon RDS database instances, snapshots, parameter groups, and configurations.
/plugin marketplace add giuseppe-trisciuoglio/developer-kit/plugin install developer-kit@giuseppe.trisciuoglioThis skill is limited to using the following tools:
references/api-reference.mdreferences/lambda-integration.mdreferences/spring-boot-integration.mdThis skill provides comprehensive guidance for working with Amazon RDS (Relational Database Service) using the AWS SDK for Java 2.x, covering database instance management, snapshots, parameter groups, and RDS operations.
Use this skill when:
The RdsClient is the main entry point for interacting with Amazon RDS.
Basic Client Creation:
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.rds.RdsClient;
RdsClient rdsClient = RdsClient.builder()
.region(Region.US_EAST_1)
.build();
// Use client
describeInstances(rdsClient);
// Always close the client
rdsClient.close();
Client with Custom Configuration:
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
import software.amazon.awssdk.http.apache.ApacheHttpClient;
RdsClient rdsClient = RdsClient.builder()
.region(Region.US_WEST_2)
.credentialsProvider(ProfileCredentialsProvider.create("myprofile"))
.httpClient(ApacheHttpClient.builder()
.connectionTimeout(Duration.ofSeconds(30))
.socketTimeout(Duration.ofSeconds(60))
.build())
.build();
Retrieve information about existing RDS instances.
List All DB Instances:
public static void describeInstances(RdsClient rdsClient) {
try {
DescribeDbInstancesResponse response = rdsClient.describeDBInstances();
List<DBInstance> instanceList = response.dbInstances();
for (DBInstance instance : instanceList) {
System.out.println("Instance ARN: " + instance.dbInstanceArn());
System.out.println("Engine: " + instance.engine());
System.out.println("Status: " + instance.dbInstanceStatus());
System.out.println("Endpoint: " + instance.endpoint().address());
System.out.println("Port: " + instance.endpoint().port());
System.out.println("---");
}
} catch (RdsException e) {
System.err.println(e.getMessage());
System.exit(1);
}
}
Create new RDS database instances with various configurations.
Create Basic DB Instance:
public static String createDBInstance(RdsClient rdsClient,
String dbInstanceIdentifier,
String dbName,
String masterUsername,
String masterPassword) {
try {
CreateDbInstanceRequest request = CreateDbInstanceRequest.builder()
.dbInstanceIdentifier(dbInstanceIdentifier)
.dbName(dbName)
.engine("postgres")
.engineVersion("14.7")
.dbInstanceClass("db.t3.micro")
.allocatedStorage(20)
.masterUsername(masterUsername)
.masterUserPassword(masterPassword)
.publiclyAccessible(false)
.build();
CreateDbInstanceResponse response = rdsClient.createDBInstance(request);
System.out.println("Creating DB instance: " + response.dbInstance().dbInstanceArn());
return response.dbInstance().dbInstanceArn();
} catch (RdsException e) {
System.err.println("Error creating instance: " + e.getMessage());
throw e;
}
}
Create and manage custom parameter groups for database configuration.
Create DB Parameter Group:
public static void createDBParameterGroup(RdsClient rdsClient,
String groupName,
String description) {
try {
CreateDbParameterGroupRequest request = CreateDbParameterGroupRequest.builder()
.dbParameterGroupName(groupName)
.dbParameterGroupFamily("postgres15")
.description(description)
.build();
CreateDbParameterGroupResponse response = rdsClient.createDBParameterGroup(request);
System.out.println("Created parameter group: " + response.dbParameterGroup().dbParameterGroupName());
} catch (RdsException e) {
System.err.println("Error creating parameter group: " + e.getMessage());
throw e;
}
}
Create, restore, and manage database snapshots.
Create DB Snapshot:
public static String createDBSnapshot(RdsClient rdsClient,
String dbInstanceIdentifier,
String snapshotIdentifier) {
try {
CreateDbSnapshotRequest request = CreateDbSnapshotRequest.builder()
.dbInstanceIdentifier(dbInstanceIdentifier)
.dbSnapshotIdentifier(snapshotIdentifier)
.build();
CreateDbSnapshotResponse response = rdsClient.createDBSnapshot(request);
System.out.println("Creating snapshot: " + response.dbSnapshot().dbSnapshotIdentifier());
return response.dbSnapshot().dbSnapshotArn();
} catch (RdsException e) {
System.err.println("Error creating snapshot: " + e.getMessage());
throw e;
}
}
Refer to references/spring-boot-integration.md for complete Spring Boot integration examples including:
Refer to references/lambda-integration.md for Lambda integration examples including:
Update existing RDS instances.
public static void modifyDBInstance(RdsClient rdsClient,
String dbInstanceIdentifier,
String newInstanceClass) {
try {
ModifyDbInstanceRequest request = ModifyDbInstanceRequest.builder()
.dbInstanceIdentifier(dbInstanceIdentifier)
.dbInstanceClass(newInstanceClass)
.applyImmediately(false) // Apply during maintenance window
.build();
ModifyDbInstanceResponse response = rdsClient.modifyDBInstance(request);
System.out.println("Modified instance: " + response.dbInstance().dbInstanceIdentifier());
System.out.println("New class: " + response.dbInstance().dbInstanceClass());
} catch (RdsException e) {
System.err.println("Error modifying instance: " + e.getMessage());
throw e;
}
}
Delete RDS instances with optional final snapshot.
public static void deleteDBInstanceWithSnapshot(RdsClient rdsClient,
String dbInstanceIdentifier,
String finalSnapshotIdentifier) {
try {
DeleteDbInstanceRequest request = DeleteDbInstanceRequest.builder()
.dbInstanceIdentifier(dbInstanceIdentifier)
.skipFinalSnapshot(false)
.finalDBSnapshotIdentifier(finalSnapshotIdentifier)
.build();
DeleteDbInstanceResponse response = rdsClient.deleteDBInstance(request);
System.out.println("Deleting instance: " + response.dbInstance().dbInstanceIdentifier());
} catch (RdsException e) {
System.err.println("Error deleting instance: " + e.getMessage());
throw e;
}
}
Always use encryption:
CreateDbInstanceRequest request = CreateDbInstanceRequest.builder()
.storageEncrypted(true)
.kmsKeyId("arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012")
.build();
Use VPC security groups:
CreateDbInstanceRequest request = CreateDbInstanceRequest.builder()
.vpcSecurityGroupIds("sg-12345678")
.publiclyAccessible(false)
.build();
Enable Multi-AZ for production:
CreateDbInstanceRequest request = CreateDbInstanceRequest.builder()
.multiAZ(true)
.build();
Configure automated backups:
CreateDbInstanceRequest request = CreateDbInstanceRequest.builder()
.backupRetentionPeriod(7)
.preferredBackupWindow("03:00-04:00")
.build();
Enable CloudWatch logs:
CreateDbInstanceRequest request = CreateDbInstanceRequest.builder()
.enableCloudwatchLogsExports("postgresql", "upgrade")
.build();
Use appropriate instance class:
// Development
.dbInstanceClass("db.t3.micro")
// Production
.dbInstanceClass("db.r5.large")
Enable for production databases:
CreateDbInstanceRequest request = CreateDbInstanceRequest.builder()
.deletionProtection(true)
.build();
Always close clients:
try (RdsClient rdsClient = RdsClient.builder()
.region(Region.US_EAST_1)
.build()) {
// Use client
} // Automatically closed
<dependencies>
<!-- AWS SDK for RDS -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.20.0</version> // Use the latest version available
</dependency>
<!-- PostgreSQL Driver -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.6.0</version> // Use the correct version available
</dependency>
<!-- MySQL Driver -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>
</dependencies>
dependencies {
// AWS SDK for RDS
implementation 'software.amazon.awssdk:rds:2.20.0'
// PostgreSQL Driver
implementation 'org.postgresql:postgresql:42.6.0'
// MySQL Driver
implementation 'mysql:mysql-connector-java:8.0.33'
}
For detailed API reference, see:
See API Reference for comprehensive error handling patterns including common exceptions, error response structure, and pagination support.
For support with AWS RDS operations using AWS SDK for Java 2.x:
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.