terraform-provider-stackgen

sg_audit_events (Data Source)

⚠️ Experimental — Reads exactly one cursor-paginated page of Guild audit events, in native or OCSF format. To consume subsequent pages, run another query externally with cursor = next_cursor until has_more is false; Terraform does not loop through pages. There is no offset input. OCSF requires RFC 3339 from and to within 31 days. items are sensitive JSON strings because even slim native or OCSF event shapes can reveal private data; sensitive values are still stored in Terraform state, so secure your state backend. include_payload and include_raw are false by default. Respects provider workspace_id for workspace scoping.

Example Usage

# Reads exactly one native audit page (limit 1-100; OCSF supports 1-1000).
# For OCSF, set format = "ocsf" and both RFC3339 from/to within 31 days.
# Supply the previous page's next_cursor in a *subsequent* query/run;
# Terraform does not follow pages automatically and has no offset input.
# WARNING: items are sensitive JSON strings still stored in Terraform state.
# Even with include_payload/include_raw omitted (false), protect state access.
data "sg_audit_events" "page" {
  format = "native"
  limit  = 50
  cursor = var.audit_cursor
}

variable "audit_cursor" {
  description = "Opaque next_cursor from a previous audit page; null for the first page."
  type        = string
  default     = null
}

output "audit_has_more" {
  value = data.sg_audit_events.page.has_more
}

output "audit_next_cursor" {
  value     = data.sg_audit_events.page.next_cursor
  sensitive = true
}

Schema

Optional

Read-Only