def METHOD_NAME(
    stack_name: str,
    resource_id: str,
    event: str,
    event_file: TextIOWrapper,
    output: RemoteInvokeOutputFormat,
    parameter: dict,
    region: str,
    profile: str,
    config_file: str,
    config_env: str,
) -> None:
    """
    Implementation of the ``cli`` method
    """
    from botocore.exceptions import (
        NoCredentialsError,
        NoRegionError,
        ProfileNotFound,
    )
    from samcli.commands.exceptions import UserException
    from samcli.commands.remote.remote_invoke_context import RemoteInvokeContext
    from samcli.lib.remote_invoke.exceptions import (
        ErrorBotoApiCallException,
        InvalideBotoResponseException,
        InvalidResourceBotoParameterException,
    )
    from samcli.lib.remote_invoke.remote_invoke_executors import RemoteInvokeExecutionInfo
    from samcli.lib.utils.boto_utils import get_boto_client_provider_with_config, get_boto_resource_provider_with_config
    try:
        boto_client_provider = get_boto_client_provider_with_config(region_name=region, profile=profile)
        boto_resource_provider = get_boto_resource_provider_with_config(region_name=region, profile=profile)
        with RemoteInvokeContext(
            boto_client_provider=boto_client_provider,
            boto_resource_provider=boto_resource_provider,
            stack_name=stack_name,
            resource_id=resource_id,
        ) as remote_invoke_context:
            remote_invoke_input = RemoteInvokeExecutionInfo(
                payload=event, payload_file=event_file, parameters=parameter, output_format=output
            )
            remote_invoke_context.run(remote_invoke_input=remote_invoke_input)
    except (
        ErrorBotoApiCallException,
        InvalideBotoResponseException,
        InvalidResourceBotoParameterException,
        ProfileNotFound,
        NoCredentialsError,
        NoRegionError,
    ) as ex:
        raise UserException(str(ex), wrapped_from=ex.__class__.__name__) from ex