<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ls(ctx, list_formatted):
 """List RDS instances"""

    session = create_session(ctx.obj['AWS_PROFILE_NAME'])

    rds = session.client('rds')
    instances = rds.describe_db_instances()
    out = format_output(instances['DBInstances'], list_formatted)
    click.echo('\n'.join(out))