# general


02/29/2024, 12:51 PM
The documentation on
FileAsset: The contents of the asset are read from a file on disk.
However I only get an object with a path to the file and not its contents. Am I doing something wrong or does it only return the path?


02/29/2024, 3:08 PM
I am just learning pulumi myself, so take with a grain of salt, but I believe this is the intended behavior. The wording is a bit confusing but I think the FileAsset will give you just a reference to a local file that will be read from when you pass the reference to a function (like the example here )
.. thus adding this file reference to the state i suppose


02/29/2024, 3:10 PM
Yep, seems like some resource providers accept FileAsset inputs and will take care of reading the contents. Looked at the definition which only returns path so there's no reading of contents going on.
Copy code
class FileAsset(Asset):
    A FileAsset is a kind of asset produced from a given path to a file on
    the local filesystem.

    path: str

    def __init__(self, path: Union[str, PathLike]) -> None:
        if not isinstance(path, (str, PathLike)):
            raise TypeError("FileAsset path must be a string or os.PathLike")
        self.path = fspath(path)