Skip to content

windows_directory

Experimental. A folder on a Windows host, with any missing above it. Removing the step leaves the folder.

Experimental. Windows support is new, and this module may change between releases.

Use windows_directory to make a folder, and any missing above it, on a Windows host. With acl the folder has its rules from the moment it exists, so there’s no moment when anyone else can get in.

step "app" {
windows_directory {
path = "C:\\app"
}
}
step "private" {
windows_directory {
path = "C:\\app\\private"
acl {
principal = "S-1-5-32-544"
rights = ["FullControl"]
}
acl {
principal = "S-1-5-18"
rights = ["FullControl"]
}
}
}
Name Type Required Description
path string Yes Full path on a local drive, such as C:\app\logs.

Conn3x sets these; reference them as conn3x_windows_directory.<circuit>__<step>["<host>"].<name>.

Name Type Description
in_sync bool Whether the folder’s rules matched at the last refresh.
revision string Changes each time Conn3x changes this on the host. Handlers watch it.

A step lowers to the conn3x_windows_directory resource, one instance per host, and connects with its circuit’s ssh block.

It holds each folder on the way open, so none can be renamed or removed while it works, and it won’t pass through a symbolic link, junction or mount point. With acl, it also refuses a folder on the way that another account could change, and the folder itself if another account owns it. See windows_file for exactly what counts.

Deleting a windows_directory step leaves the folder and everything in it.