Skip to content

Lifecycle Meta-Arguments

The lifecycle meta-argument allows you to customize resource lifecycle behavior directly from main.yml or domain configuration files.


Prevents accidental destruction of critical test cases, plans, or test runs. Following Terraform conventions, lifecycle is declared inside the resource: block:

# main.yml or resource.yml
resource:
testcase:
match: "features/*.case.feature"
lifecycle:
prevent_destroy: true

Or directly on individual scenarios via Gherkin tags:

@tc-1 @smoke
@prevent_destroy
Scenario: Critical authentication

When active, running testform destroy or generating a plan that marks the resource for destruction will halt execution immediately with an error:

Error: Instance cannot be destroyed
Resource github_testcase.auth/login.case.feature.@tc-1 has lifecycle.prevent_destroy set.

Suppresses drift detection for specific volatile attributes (e.g. labels, title, assignees):

# main.yml or resource.yml
resource:
testrun:
match: "suites/*.run.feature"
lifecycle:
ignore_changes:
- labels
- assignees

Or via Gherkin tag:

@tr-1
@ignore_changes("labels", "assignees")
Scenario: Smoke Suite Execution

Attributes listed in ignore_changes will be ignored during testform plan, testform diff, and state refresh calculations.