def apply(  # type: ignore
    bento: str | None,
    name: str | None,
    cluster: str | None,
    access_authorization: bool | None,
    scaling_min: int | None,
    scaling_max: int | None,
    instance_type: str | None,
    strategy: str | None,
    env: tuple[str] | None,
    secret: tuple[str] | None,
    config_file: str | t.TextIO | None,
    config_dict: str | None,
    _cloud_client: BentoCloudClient = Provide[BentoMLContainer.bentocloud_client],
) -> None:
    """Apply a deployment on BentoCloud.

    \b
    A deployment can be applied using config yaml file.
    """
    cfg_dict = None
    if config_dict is not None and config_dict != "":
        cfg_dict = json.loads(config_dict)
    config_params = DeploymentConfigParameters(
        name=name,
        bento=bento,
        cluster=cluster,
        access_authorization=access_authorization,
        scaling_max=scaling_max,
        scaling_min=scaling_min,
        instance_type=instance_type,
        strategy=strategy,
        envs=convert_env_to_dict(env),
        secrets=list(secret) if secret is not None else None,
        config_file=config_file,
        config_dict=cfg_dict,
        cli=True,
    )
    try:
        config_params.verify(create=False)
    except BentoMLException as e:
        raise_deployment_config_error(e, "apply")
    deployment_info = _cloud_client.deployment.apply(
        deployment_config_params=config_params
    )

    rich.print(f"Deployment [green]'{deployment_info.name}'[/] applied successfully.")
Apply a deployment on BentoCloud.

\b
A deployment can be applied using config yaml file.
src/bentoml_cli/deployment.py