• Docs
  • Features
  • Apply Requirements

Apply Requirements

Apply Requirements allows for the specification of when an Apply operation can be performed on a pull request that has not been merged.

Terrateam Runtime Configuration

Terrateam behavior can be configured via a config.yml. This file is located in a directory named .terrateam at the root of your Terraform repository: .terrateam/config.yml.

See Configuration documentation for details.

Configuration

Top-level key: apply_requirements

See Configuration Reference documentation for details.

KeyTypeDescription
checksChecksConfiguration for the apply requirement checks.
create_pending_apply_checkBooleanCreate status checks for pending applies. Default is true.

Default configuration:

apply_requirements:
    checks:
        approved:
            enabled: false
            count: 1
        merge_conflicts:
            enabled: true
        status_checks:
            enabled: true
            ignore_matching: []
    create_pending_apply_check: true

The apply_requirements configuration is only evaluated for pull requests that are not merged.

Checks

KeyTypeDescription
approvedApprovedConfiguration for pull request approval.
merge_conflictsMerge ConflictsConfiguration for merge conflicts.
status_checksStatus ChecksConfiguration for status checks.

Approved

Requires that the pull request has received a certain number of approvals.

KeyTypeDescription
enabledBooleanIf the check is enabled. Default is false.
countIntegerNumber of approvals needed to pass. Default is 1.

Merge Conflicts

Requires that the pull request has no merge conflicts.

KeyTypeDescription
enabledBooleanIf the check is enabled. Default is true.

Status Checks

Requires that all status checks associated with the pull request have passed.

KeyTypeDescription
enabledBooleanIf the check is enabled. Default is true.
ignore_matchingListList of regex to match against names of checks to ignore.

Pending Apply Check

The create_pending_apply_check configuration will create a GitHub status check on the pull request for each Dirspace that is marked as pending. Each check is only marked as complete when the Apply operation has executed for the Dirspace. This mode of operation is to prevent a pull request from being merged before all Apply operations have been executed.

If a Dirspace has Autoapply set to true, a status check is not created for the Dirspace. Enabling Autoapply means that the Apply operation is performed after the pull request has been merged, so Terrateam does not want to prevent the pull request from being merged.

Use Cases