Problem
There is no way to manage OpsLevel campaigns as code. Campaign creation, scheduling, check association, and updates must be done manually through the OpsLevel UI, which makes it difficult to version-control campaign rollouts, reproduce them across environments, or compose them alongside the checks and scorecards they reference.
Proposed Solution
Add an opslevel_campaign Terraform resource with full CRUD lifecycle support.
Managed Attributes
| Attribute |
Type |
Description |
name |
Required |
Campaign name |
owner_id |
Required |
Team that owns the campaign |
filter_id |
Optional |
Filter applied to the campaign |
project_brief |
Optional |
Markdown project brief |
check_ids |
Optional |
List of rubric check IDs to associate |
start_date |
Optional |
Start date (YYYY-MM-DD) |
target_date |
Optional |
Target date (YYYY-MM-DD) |
Computed Attributes
id, status, html_url
Key Behaviors
- Create: Creates a draft campaign. If both
start_date and target_date are set, immediately schedules it. If check_ids is set, copies rubric checks into the campaign.
- Read: Fetches campaign by ID. Queries the campaign's actual checks from the API and cross-references them against the configured rubric check IDs to detect drift (checks removed outside Terraform).
- Update: Updates campaign fields. Manages schedule lifecycle (add/change/remove dates). Reconciles
check_ids — adds new checks via checksCopyToCampaign and removes stale checks by matching rubric check names to campaign check instances and deleting them.
- Delete: Deletes the campaign.
- Import: Supports
terraform import by campaign ID.
Data Sources
opslevel_campaign — look up a single campaign
opslevel_campaigns — list all campaigns
Dependencies
Requires campaign CRUD methods in opslevel-go (see OpsLevel/opslevel-go#612).
Problem
There is no way to manage OpsLevel campaigns as code. Campaign creation, scheduling, check association, and updates must be done manually through the OpsLevel UI, which makes it difficult to version-control campaign rollouts, reproduce them across environments, or compose them alongside the checks and scorecards they reference.
Proposed Solution
Add an
opslevel_campaignTerraform resource with full CRUD lifecycle support.Managed Attributes
nameowner_idfilter_idproject_briefcheck_idsstart_datetarget_dateComputed Attributes
id,status,html_urlKey Behaviors
start_dateandtarget_dateare set, immediately schedules it. Ifcheck_idsis set, copies rubric checks into the campaign.check_ids— adds new checks viachecksCopyToCampaignand removes stale checks by matching rubric check names to campaign check instances and deleting them.terraform importby campaign ID.Data Sources
opslevel_campaign— look up a single campaignopslevel_campaigns— list all campaignsDependencies
Requires campaign CRUD methods in opslevel-go (see OpsLevel/opslevel-go#612).