published on Thursday, Aug 20, 2026 by jschady
published on Thursday, Aug 20, 2026 by jschady
A Lock can be used by your custom-developed applications to implement file locking and concurrency features. These locks are advisory, meaning that while a lock can be created, it does not prevent other API requests from being processed concurrently. You are responsible for checking locks prior to accessing a file.
The lock feature is designed to emulate the locking functionality provided by WebDAV. For a deeper understanding of how the lock mechanism works, refer to the WebDAV specification, which outlines how these endpoints function.
Files.com’s WebDAV offering and desktop app leverage this locking API to manage concurrent file operations, ensuring consistency when multiple users or systems interact with the same files. It is not used within the Files.com web interface.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as filescom from "pulumi-filescom";
const exampleLock = new filescom.Lock("example_lock", {
path: "locked_file",
allowAccessByAnyUser: false,
exclusive: false,
recursive: true,
timeout: 1,
});
import pulumi
import pulumi_filescom as filescom
example_lock = filescom.Lock("example_lock",
path="locked_file",
allow_access_by_any_user=False,
exclusive=False,
recursive=True,
timeout=1)
package main
import (
"github.com/jschady/pulumi-filescom/sdk/go/filescom"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := filescom.NewLock(ctx, "example_lock", &filescom.LockArgs{
Path: pulumi.String("locked_file"),
AllowAccessByAnyUser: pulumi.Bool(false),
Exclusive: pulumi.Bool(false),
Recursive: pulumi.Bool(true),
Timeout: pulumi.Int(1),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Filescom = Jschady.Filescom;
return await Deployment.RunAsync(() =>
{
var exampleLock = new Filescom.Lock("example_lock", new()
{
Path = "locked_file",
AllowAccessByAnyUser = false,
Exclusive = false,
Recursive = true,
Timeout = 1,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.filescom.Lock;
import com.pulumi.filescom.LockArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleLock = new Lock("exampleLock", LockArgs.builder()
.path("locked_file")
.allowAccessByAnyUser(false)
.exclusive(false)
.recursive(true)
.timeout(1)
.build());
}
}
resources:
exampleLock:
type: filescom:Lock
name: example_lock
properties:
path: locked_file
allowAccessByAnyUser: false
exclusive: false
recursive: true
timeout: 1
pulumi {
required_providers {
filescom = {
source = "pulumi/filescom"
}
}
}
resource "filescom_lock" "example_lock" {
path = "locked_file"
allow_access_by_any_user = false
exclusive = false
recursive = true
timeout = 1
}
Create Lock Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Lock(name: string, args: LockArgs, opts?: CustomResourceOptions);@overload
def Lock(resource_name: str,
args: LockArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Lock(resource_name: str,
opts: Optional[ResourceOptions] = None,
path: Optional[str] = None,
allow_access_by_any_user: Optional[bool] = None,
exclusive: Optional[bool] = None,
recursive: Optional[bool] = None,
timeout: Optional[int] = None)func NewLock(ctx *Context, name string, args LockArgs, opts ...ResourceOption) (*Lock, error)public Lock(string name, LockArgs args, CustomResourceOptions? opts = null)type: filescom:Lock
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "filescom_lock" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args LockArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args LockArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LockArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LockArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LockArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var lockResource = new Filescom.Lock("lockResource", new()
{
Path = "string",
AllowAccessByAnyUser = false,
Exclusive = false,
Recursive = false,
Timeout = 0,
});
example, err := filescom.NewLock(ctx, "lockResource", &filescom.LockArgs{
Path: pulumi.String("string"),
AllowAccessByAnyUser: pulumi.Bool(false),
Exclusive: pulumi.Bool(false),
Recursive: pulumi.Bool(false),
Timeout: pulumi.Int(0),
})
resource "filescom_lock" "lockResource" {
lifecycle {
create_before_destroy = true
}
path = "string"
allow_access_by_any_user = false
exclusive = false
recursive = false
timeout = 0
}
var lockResource = new Lock("lockResource", LockArgs.builder()
.path("string")
.allowAccessByAnyUser(false)
.exclusive(false)
.recursive(false)
.timeout(0)
.build());
lock_resource = filescom.Lock("lockResource",
path="string",
allow_access_by_any_user=False,
exclusive=False,
recursive=False,
timeout=0)
const lockResource = new filescom.Lock("lockResource", {
path: "string",
allowAccessByAnyUser: false,
exclusive: false,
recursive: false,
timeout: 0,
});
type: filescom:Lock
properties:
allowAccessByAnyUser: false
exclusive: false
path: string
recursive: false
timeout: 0
Lock Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Lock resource accepts the following input properties:
- Path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- Allow
Access boolBy Any User - Can lock be modified by users other than its creator?
- Exclusive bool
- Is lock exclusive?
- Recursive bool
- Does lock apply to subfolders?
- Timeout int
- Lock timeout in seconds
- Path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- Allow
Access boolBy Any User - Can lock be modified by users other than its creator?
- Exclusive bool
- Is lock exclusive?
- Recursive bool
- Does lock apply to subfolders?
- Timeout int
- Lock timeout in seconds
- path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- allow_
access_ boolby_ any_ user - Can lock be modified by users other than its creator?
- exclusive bool
- Is lock exclusive?
- recursive bool
- Does lock apply to subfolders?
- timeout number
- Lock timeout in seconds
- path String
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- allow
Access BooleanBy Any User - Can lock be modified by users other than its creator?
- exclusive Boolean
- Is lock exclusive?
- recursive Boolean
- Does lock apply to subfolders?
- timeout Integer
- Lock timeout in seconds
- path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- allow
Access booleanBy Any User - Can lock be modified by users other than its creator?
- exclusive boolean
- Is lock exclusive?
- recursive boolean
- Does lock apply to subfolders?
- timeout number
- Lock timeout in seconds
- path str
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- allow_
access_ boolby_ any_ user - Can lock be modified by users other than its creator?
- exclusive bool
- Is lock exclusive?
- recursive bool
- Does lock apply to subfolders?
- timeout int
- Lock timeout in seconds
- path String
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- allow
Access BooleanBy Any User - Can lock be modified by users other than its creator?
- exclusive Boolean
- Is lock exclusive?
- recursive Boolean
- Does lock apply to subfolders?
- timeout Number
- Lock timeout in seconds
Outputs
All input properties are implicitly available as output properties. Additionally, the Lock resource produces the following output properties:
Look up Existing Lock Resource
Get an existing Lock resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: LockState, opts?: CustomResourceOptions): Lock@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
allow_access_by_any_user: Optional[bool] = None,
depth: Optional[str] = None,
exclusive: Optional[bool] = None,
owner: Optional[str] = None,
path: Optional[str] = None,
recursive: Optional[bool] = None,
scope: Optional[str] = None,
timeout: Optional[int] = None,
token: Optional[str] = None,
type: Optional[str] = None,
user_id: Optional[int] = None,
username: Optional[str] = None) -> Lockfunc GetLock(ctx *Context, name string, id IDInput, state *LockState, opts ...ResourceOption) (*Lock, error)public static Lock Get(string name, Input<string> id, LockState? state, CustomResourceOptions? opts = null)public static Lock get(String name, Output<String> id, LockState state, CustomResourceOptions options)resources: _: type: filescom:Lock get: id: ${id}import {
to = filescom_lock.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Allow
Access boolBy Any User - Can lock be modified by users other than its creator?
- Depth string
- Exclusive bool
- Is lock exclusive?
- Owner string
- Owner of the lock. This can be any arbitrary string.
- Path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- Recursive bool
- Does lock apply to subfolders?
- Scope string
- Timeout int
- Lock timeout in seconds
- Token string
- Lock token. Use to release lock.
- Type string
- User
Id int - Lock creator user ID
- Username string
- Lock creator username
- Allow
Access boolBy Any User - Can lock be modified by users other than its creator?
- Depth string
- Exclusive bool
- Is lock exclusive?
- Owner string
- Owner of the lock. This can be any arbitrary string.
- Path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- Recursive bool
- Does lock apply to subfolders?
- Scope string
- Timeout int
- Lock timeout in seconds
- Token string
- Lock token. Use to release lock.
- Type string
- User
Id int - Lock creator user ID
- Username string
- Lock creator username
- allow_
access_ boolby_ any_ user - Can lock be modified by users other than its creator?
- depth string
- exclusive bool
- Is lock exclusive?
- owner string
- Owner of the lock. This can be any arbitrary string.
- path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- recursive bool
- Does lock apply to subfolders?
- scope string
- timeout number
- Lock timeout in seconds
- token string
- Lock token. Use to release lock.
- type string
- user_
id number - Lock creator user ID
- username string
- Lock creator username
- allow
Access BooleanBy Any User - Can lock be modified by users other than its creator?
- depth String
- exclusive Boolean
- Is lock exclusive?
- owner String
- Owner of the lock. This can be any arbitrary string.
- path String
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- recursive Boolean
- Does lock apply to subfolders?
- scope String
- timeout Integer
- Lock timeout in seconds
- token String
- Lock token. Use to release lock.
- type String
- user
Id Integer - Lock creator user ID
- username String
- Lock creator username
- allow
Access booleanBy Any User - Can lock be modified by users other than its creator?
- depth string
- exclusive boolean
- Is lock exclusive?
- owner string
- Owner of the lock. This can be any arbitrary string.
- path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- recursive boolean
- Does lock apply to subfolders?
- scope string
- timeout number
- Lock timeout in seconds
- token string
- Lock token. Use to release lock.
- type string
- user
Id number - Lock creator user ID
- username string
- Lock creator username
- allow_
access_ boolby_ any_ user - Can lock be modified by users other than its creator?
- depth str
- exclusive bool
- Is lock exclusive?
- owner str
- Owner of the lock. This can be any arbitrary string.
- path str
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- recursive bool
- Does lock apply to subfolders?
- scope str
- timeout int
- Lock timeout in seconds
- token str
- Lock token. Use to release lock.
- type str
- user_
id int - Lock creator user ID
- username str
- Lock creator username
- allow
Access BooleanBy Any User - Can lock be modified by users other than its creator?
- depth String
- exclusive Boolean
- Is lock exclusive?
- owner String
- Owner of the lock. This can be any arbitrary string.
- path String
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- recursive Boolean
- Does lock apply to subfolders?
- scope String
- timeout Number
- Lock timeout in seconds
- token String
- Lock token. Use to release lock.
- type String
- user
Id Number - Lock creator user ID
- username String
- Lock creator username
Import
The pulumi import command can be used, for example:
Locks can be imported by specifying the path.
$ pulumi import filescom:index/lock:Lock example_lock path
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- filescom jschady/pulumi-filescom
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
filescomTerraform Provider.
published on Thursday, Aug 20, 2026 by jschady