Skip to content

lock_policy

The lock_policy configuration specifies, for the whole repository, under what situations Terrateam acquires a lock on a directory and workspace. It is the default for every directory, including those that do not match any workflow. A lock_policy set on a workflow entry overrides this value for the directories that match that workflow.

lock_policy: strict
KeyTypeDescription
lock_policyStringWhen a directory should have a lock acquired. Values are strict (acquire a lock if either it is merged or applied), apply (only acquire a lock when it is applied), merge (only acquire a lock when it is merged), and none (never acquire a lock). Default is strict.

Setting the Policy for the Whole Repository

Section titled “Setting the Policy for the Whole Repository”
lock_policy: apply

Every directory only acquires a lock when it is applied.

Overriding the Policy for Some Directories

Section titled “Overriding the Policy for Some Directories”
lock_policy: apply
workflows:
- tag_query: dir:production
lock_policy: strict

Directories under production use strict, everything else inherits apply from the global key.

  • Be careful when modifying lock_policy. Any value other than strict is considered less safe, but can be useful in the right situation.
  • See Lock Management for a description of each policy and when a lock is acquired and released.