def warn(msg: str, resource: Optional['Resource'] = None, stream_id: Optional[int] = None) -> None:
    """
    Logs a message to the Pulumi CLI's warning channel, associating it with a resource
    and stream_id if provided.

    :param str msg: The message to send to the Pulumi CLI.
    :param Optional[Resource] resource: If provided, associate this message with the given resource in the Pulumi CLI.
    :param Optional[int] stream_id: If provided, associate this message with a stream of other messages.
    """
    engine = get_engine()
    if engine is not None:
        _log(engine, engine_pb2.WARNING, msg, resource, stream_id)
    else:
        print("warning: " + msg, file=sys.stderr)
def warn ( msg : str , resource : Optional [ 'Resource' ] = None , stream_id : Optional [ int ] = None ) -> None : engine = get_engine ( ) if engine is not None : _log ( engine , engine_pb2 . WARNING , msg , resource , stream_id ) else : print ( "warning: " + msg , file = sys . stderr )
Logs a message to the Pulumi CLI's warning channel, associating it with a resource
    and stream_id if provided.

    :param str msg: The message to send to the Pulumi CLI.
    :param Optional[Resource] resource: If provided, associate this message with the given resource in the Pulumi CLI.
    :param Optional[int] stream_id: If provided, associate this message with a stream of other messages.