def list_instance_types(  # type: ignore
    cluster: str | None,
    output: t.Literal["json", "yaml", "table"],
    _cloud_client: BentoCloudClient = Provide[BentoMLContainer.bentocloud_client],
) -> None:
    """List existing instance types in cluster on BentoCloud."""
    try:
        d_list = _cloud_client.deployment.list_instance_types(cluster=cluster)
    except BentoMLException as e:
        raise_deployment_config_error(e, "list_instance_types")
    res: list[dict[str, t.Any]] = [d.to_dict() for d in d_list]
    if output == "table":
        table = Table(box=None, expand=True)
        table.add_column("Name", overflow="fold")
        table.add_column("Price", overflow="fold")
        table.add_column("CPU", overflow="fold")
        table.add_column("Memory", overflow="fold")
        table.add_column("GPU", overflow="fold")
        table.add_column("GPU Type", overflow="fold")
        for info in d_list:
            table.add_row(
                info.name,
                info.price,
                info.cpu,
                info.memory,
                info.gpu,
                info.gpu_type,
            )
        rich.print(table)
    elif output == "json":
        info = json.dumps(res, indent=2, default=str)
        rich.print_json(info)
    else:
        info = yaml.dump(res, indent=2, sort_keys=False)
        rich.print(Syntax(info, "yaml", background_color="default"))
List existing instance types in cluster on BentoCloud.
src/bentoml_cli/deployment.py