def list_rds_attached_secgroups(rds) -> list:
    """
    List security groups attached to RDS instances
    """
    rds_attached_groups = []
    boto_rds_instances = rds.describe_db_instances()
    for db_instance_obj in boto_rds_instances['DBInstances']:
        for security_group in db_instance_obj['VpcSecurityGroups']:
            rds_attached_groups.append(
                security_group['VpcSecurityGroupId']
            )
    return rds_attached_groups