Skip to content

feat: add okta_request_sequences data source - #2920

Open
exitcode0 wants to merge 1 commit into
okta:masterfrom
exitcode0:feat/request-sequences-datasource
Open

feat: add okta_request_sequences data source#2920
exitcode0 wants to merge 1 commit into
okta:masterfrom
exitcode0:feat/request-sequences-datasource

Conversation

@exitcode0

@exitcode0 exitcode0 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #2919

Summary

Adds a new okta_request_sequences data source that lists all access request sequences for a resource, using the Governance API listResourceRequestSequencesV2 endpoint (GET /governance/api/v2/resources/{resourceId}/request-sequences), which is already exposed by okta-governance-sdk-golang v1.1.0.

The existing singular okta_request_sequence data source requires the sequence id to be known ahead of time, but sequence IDs are opaque and typically created in the Okta Admin Console — there was previously no way to discover them from Terraform. This data source enables looking up a sequence ID by name:

data "okta_request_sequences" "example" {
  resource_id = "<okta_resource_id>"
}

locals {
  manager_approval_sequence_id = one([
    for seq in data.okta_request_sequences.example.request_sequences : seq.id
    if seq.name == "Requester's Manager Approval"
  ])
}

Changes

  • New data source okta_request_sequences (okta/services/governance/data_source_request_sequences.go)
    • resource_id (required) — the resource in Okta ID or ORN format
    • request_sequences (computed) — list of objects with id, name, description, link and compatible_resource_types
    • Uses schema.ListAttribute with types.ObjectType for protocol v5 mux compatibility
  • Renames the singular data source's constructor newRequestSequencesDataSourcenewRequestSequenceDataSource so its name matches the okta_request_sequence type it registers (internal only, no user-facing change), freeing the plural name for the new data source
  • Acceptance test TestAccDataSourceOktaRequestSequences_read plus example fixtures
  • Documentation generated with tfplugindocs

Notes

  • The list endpoint takes no pagination parameters, so a single call returns all sequences for the resource.
  • No VCR cassette is included. The test fixture points at the same maintainer test-org resource (0oaoum6j3cElINe1z1d7) used by TestAccDataSourceOktaRequestSequence_read, so this can be recorded against the maintainer test orgs the same way that cassette was. Recording it from an external org isn't practical today: the VCR hook sanitizes request hostnames but not response bodies, and this list endpoint returns the names, descriptions and org-domain links of every sequence on the resource (see feat: check for leaked data in VCRs after recording #2740 / fix: sanitize hostnames in existing VCR cassettes #2741 for proposed response-body sanitization).

Adds a plural data source that lists all access request sequences for a
resource via the Governance API listResourceRequestSequencesV2 endpoint,
so sequence IDs can be discovered by name instead of hard-coded.

Also renames the singular data source constructor from
newRequestSequencesDataSource to newRequestSequenceDataSource to match
the okta_request_sequence type it registers, freeing the plural name.
@github-actions
github-actions Bot requested a review from aditya-okta August 5, 2026 09:10
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.

New Data Source: okta_request_sequences (list request sequences for a resource)

1 participant