Skip to content

Feature/extend provider resources - #23

Open
mmar6729 wants to merge 3 commits into
splunk:masterfrom
mmar6729:feature/extend-provider-resources
Open

Feature/extend provider resources#23
mmar6729 wants to merge 3 commits into
splunk:masterfrom
mmar6729:feature/extend-provider-resources

Conversation

@mmar6729

@mmar6729 mmar6729 commented Mar 6, 2026

Copy link
Copy Markdown

Description:

Add data sources, import support, and new resources (rotation, scheduled_override, paging_policy)

Summary

Extends the provider with several new capabilities:

New Data Sources

  • data.victorops_user — look up an existing user by username
  • data.victorops_team — look up an existing team by slug
  • data.victorops_escalation_policy — look up a policy by name within a team

Import Support

  • victorops_teamterraform import victorops_team.x <slug>
  • victorops_escalation_policyterraform import victorops_escalation_policy.x <slug>
  • victorops_team_membershipterraform import victorops_team_membership.x <team_slug>/<username>

New Resources

  • victorops_rotation — manages on-call rotation groups for a team
  • victorops_scheduled_override — temporary on-call coverage swaps
  • victorops_paging_policy — per-user notification step configuration

Notes

  • The VictorOps API returns groupId as an integer in rotation responses despite the spec saying string — handled in the rotation Read function
  • Rotation shift mask.time_range is required by the live API even when the spec marks it optional
  • All new resources include documentation under website/docs/

Matthew Martinez added 3 commits March 6, 2026 21:54
- victorops_team: add ImportStatePassthrough importer (import by slug)
- victorops_escalation_policy: add ImportStatePassthrough importer (import by slug)
- victorops_team_membership: add custom importer accepting 'team_slug/username' format
Allows referencing pre-existing VictorOps resources not managed by Terraform.

- data.victorops_user: look up user by username; exposes first_name, last_name, email
- data.victorops_team: look up team by slug; exposes name, slug, member_count
- data.victorops_escalation_policy: look up policy by name+team

Also adds makeAPICall() helper on Config for direct HTTP calls where the SDK
does not provide coverage (used by new rotation and scheduled_override resources).
victorops_rotation:
- Manages on-call rotation groups for a team
- Supports multiple shifts with timezone, duration, usernames, and day/time masks
- Resource ID: {team_slug}/{groupId}
- Note: API returns groupId as integer despite spec saying string

victorops_scheduled_override:
- Creates temporary on-call coverage overrides
- Supports user swaps scoped to specific policies or org-wide
- ForceNew on all fields (API has no PUT; must delete and recreate to change)

victorops_paging_policy:
- Manages per-user paging policy steps (how VictorOps notifies a user)
- Supports phone, email, and push notification contacts per step
- Full policy replaced on update (API replaces entire policy on PUT)
@mmar6729
mmar6729 force-pushed the feature/extend-provider-resources branch from 2f3aeaf to 5ae26ef Compare March 6, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant