1. Packages
  2. Local Provider
  3. API Docs
  4. getFile
local 2.6.1 published on Monday, Nov 17, 2025 by hashicorp
local logo
local 2.6.1 published on Monday, Nov 17, 2025 by hashicorp

    Reads a file from the local filesystem.

    Using getFile

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getFile(args: GetFileArgs, opts?: InvokeOptions): Promise<GetFileResult>
    function getFileOutput(args: GetFileOutputArgs, opts?: InvokeOptions): Output<GetFileResult>
    def get_file(filename: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetFileResult
    def get_file_output(filename: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetFileResult]
    func LookupFile(ctx *Context, args *LookupFileArgs, opts ...InvokeOption) (*LookupFileResult, error)
    func LookupFileOutput(ctx *Context, args *LookupFileOutputArgs, opts ...InvokeOption) LookupFileResultOutput

    > Note: This function is named LookupFile in the Go SDK.

    public static class GetFile 
    {
        public static Task<GetFileResult> InvokeAsync(GetFileArgs args, InvokeOptions? opts = null)
        public static Output<GetFileResult> Invoke(GetFileInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetFileResult> getFile(GetFileArgs args, InvokeOptions options)
    public static Output<GetFileResult> getFile(GetFileArgs args, InvokeOptions options)
    
    fn::invoke:
      function: local:index/getFile:getFile
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filename string
    Path to the file that will be read. The data source will return an error if the file does not exist.
    Filename string
    Path to the file that will be read. The data source will return an error if the file does not exist.
    filename String
    Path to the file that will be read. The data source will return an error if the file does not exist.
    filename string
    Path to the file that will be read. The data source will return an error if the file does not exist.
    filename str
    Path to the file that will be read. The data source will return an error if the file does not exist.
    filename String
    Path to the file that will be read. The data source will return an error if the file does not exist.

    getFile Result

    The following output properties are available:

    Content string
    Raw content of the file that was read, as UTF-8 encoded string. Files that do not contain UTF-8 text will have invalid UTF-8 sequences in content replaced with the Unicode replacement character.
    ContentBase64 string
    Base64 encoded version of the file content (use this when dealing with binary data).
    ContentBase64sha256 string
    Base64 encoded SHA256 checksum of file content.
    ContentBase64sha512 string
    Base64 encoded SHA512 checksum of file content.
    ContentMd5 string
    MD5 checksum of file content.
    ContentSha1 string
    SHA1 checksum of file content.
    ContentSha256 string
    SHA256 checksum of file content.
    ContentSha512 string
    SHA512 checksum of file content.
    Filename string
    Path to the file that will be read. The data source will return an error if the file does not exist.
    Id string
    The hexadecimal encoding of the SHA1 checksum of the file content.
    Content string
    Raw content of the file that was read, as UTF-8 encoded string. Files that do not contain UTF-8 text will have invalid UTF-8 sequences in content replaced with the Unicode replacement character.
    ContentBase64 string
    Base64 encoded version of the file content (use this when dealing with binary data).
    ContentBase64sha256 string
    Base64 encoded SHA256 checksum of file content.
    ContentBase64sha512 string
    Base64 encoded SHA512 checksum of file content.
    ContentMd5 string
    MD5 checksum of file content.
    ContentSha1 string
    SHA1 checksum of file content.
    ContentSha256 string
    SHA256 checksum of file content.
    ContentSha512 string
    SHA512 checksum of file content.
    Filename string
    Path to the file that will be read. The data source will return an error if the file does not exist.
    Id string
    The hexadecimal encoding of the SHA1 checksum of the file content.
    content String
    Raw content of the file that was read, as UTF-8 encoded string. Files that do not contain UTF-8 text will have invalid UTF-8 sequences in content replaced with the Unicode replacement character.
    contentBase64 String
    Base64 encoded version of the file content (use this when dealing with binary data).
    contentBase64sha256 String
    Base64 encoded SHA256 checksum of file content.
    contentBase64sha512 String
    Base64 encoded SHA512 checksum of file content.
    contentMd5 String
    MD5 checksum of file content.
    contentSha1 String
    SHA1 checksum of file content.
    contentSha256 String
    SHA256 checksum of file content.
    contentSha512 String
    SHA512 checksum of file content.
    filename String
    Path to the file that will be read. The data source will return an error if the file does not exist.
    id String
    The hexadecimal encoding of the SHA1 checksum of the file content.
    content string
    Raw content of the file that was read, as UTF-8 encoded string. Files that do not contain UTF-8 text will have invalid UTF-8 sequences in content replaced with the Unicode replacement character.
    contentBase64 string
    Base64 encoded version of the file content (use this when dealing with binary data).
    contentBase64sha256 string
    Base64 encoded SHA256 checksum of file content.
    contentBase64sha512 string
    Base64 encoded SHA512 checksum of file content.
    contentMd5 string
    MD5 checksum of file content.
    contentSha1 string
    SHA1 checksum of file content.
    contentSha256 string
    SHA256 checksum of file content.
    contentSha512 string
    SHA512 checksum of file content.
    filename string
    Path to the file that will be read. The data source will return an error if the file does not exist.
    id string
    The hexadecimal encoding of the SHA1 checksum of the file content.
    content str
    Raw content of the file that was read, as UTF-8 encoded string. Files that do not contain UTF-8 text will have invalid UTF-8 sequences in content replaced with the Unicode replacement character.
    content_base64 str
    Base64 encoded version of the file content (use this when dealing with binary data).
    content_base64sha256 str
    Base64 encoded SHA256 checksum of file content.
    content_base64sha512 str
    Base64 encoded SHA512 checksum of file content.
    content_md5 str
    MD5 checksum of file content.
    content_sha1 str
    SHA1 checksum of file content.
    content_sha256 str
    SHA256 checksum of file content.
    content_sha512 str
    SHA512 checksum of file content.
    filename str
    Path to the file that will be read. The data source will return an error if the file does not exist.
    id str
    The hexadecimal encoding of the SHA1 checksum of the file content.
    content String
    Raw content of the file that was read, as UTF-8 encoded string. Files that do not contain UTF-8 text will have invalid UTF-8 sequences in content replaced with the Unicode replacement character.
    contentBase64 String
    Base64 encoded version of the file content (use this when dealing with binary data).
    contentBase64sha256 String
    Base64 encoded SHA256 checksum of file content.
    contentBase64sha512 String
    Base64 encoded SHA512 checksum of file content.
    contentMd5 String
    MD5 checksum of file content.
    contentSha1 String
    SHA1 checksum of file content.
    contentSha256 String
    SHA256 checksum of file content.
    contentSha512 String
    SHA512 checksum of file content.
    filename String
    Path to the file that will be read. The data source will return an error if the file does not exist.
    id String
    The hexadecimal encoding of the SHA1 checksum of the file content.

    Package Details

    Repository
    local hashicorp/terraform-provider-local
    License
    Notes
    This Pulumi package is based on the local Terraform Provider.
    local logo
    local 2.6.1 published on Monday, Nov 17, 2025 by hashicorp
      Meet Neo: Your AI Platform Teammate