Amazon RDS (Relational Database Service) is a managed service that makes it easy to set up, operate, and scale relational databases in the cloud. It supports multiple engines like MySQL, PostgreSQL, MariaDB, Oracle, and SQL Server, and provides features such as automated backups, scaling, monitoring, and high availability.

Example

To create the RDS Handler, you must pass AWS credentials (access_key, secret_key, and region). This enables you to interact with RDS resources, clusters, proxies, and their associations with EC2.
import os
from superagentx_handlers.aws.rds import AWSRDSHandler

rds_handler = AWSRDSHandler(
    aws_access_key_id=os.getenv("AWS_ACCESS_KEY_ID"),
    aws_secret_access_key=os.getenv("AWS_SECRET_ACCESS_KEY"),
    region_name="eu-central-1"
)
Get RDS Association Details:
Provides a comprehensive inventory of RDS resources and their associations.
details = await rds_handler.get_rds_association_details()
print(details)
List RDS Instances:
Fetches all RDS database instances in the account.
instances = await rds_handler.get_rds_instances()
print(instances)
List RDS Clusters:
Fetches all Aurora RDS clusters.
clusters = await rds_handler.get_rds_clusters()
print(clusters)
List RDS Proxies:
Fetches all RDS database proxies.
proxies = await rds_handler.get_rds_proxies()
print(proxies)
Get Proxy Targets:
Retrieves targets associated with a specific RDS proxy.
targets = await rds_handler.get_proxy_targets(
    proxy_name="my-rds-proxy"
)
print(targets)
Get EC2 Associations:
Finds EC2 instances that are associated with RDS security groups.
associations = await rds_handler.get_ec2_associations(
    rds_instances=instances
)
print(associations)
Get Backup Configuration:
Fetches backup details such as retention period, backup window, and maintenance window for an RDS instance or cluster.
backup = await rds_handler.get_backup_config(
    db_identifier="my-db-instance",
    is_cluster=False  # set True for clusters
)
print(backup)