grove.connectors.tfc package¶
Terraform Cloud connectors for Grove.
Submodules¶
grove.connectors.tfc.api module¶
Terraform Cloud audit trail API client.
The official TFC SDK does not currently support the Audit API, so interactions need to be handled manually.
- class grove.connectors.tfc.api.Client(token: str | None = None, retry: bool | None = True)[source]¶
Bases:
object
- get_trails(since: str | None = None, cursor: int | None = 1, page_size: str | None = None) AuditLogEntries [source]¶
Fetches a list of audit logs which match the provided filters.
- Parameters:
since – The ISO8601 date of the most recent event to include (inclusive).
cursor – The page to fetch. If omitted, endpoint returns first page.
page_size – Number of audit events per page. Defaults to 1000.
- Returns:
AuditLogEntries object containing a pagination cursor, and log entries.
grove.connectors.tfc.audit_trails module¶
Terraform Cloud audit trails connector for Grove.
- class grove.connectors.tfc.audit_trails.Connector(config: ConnectorConfig, context: Dict[str, str])[source]¶
Bases:
BaseConnector
- LOG_ORDER = 'REVERSE_CHRONOLOGICAL'¶
- NAME = 'tfc_audit_trails'¶
- POINTER_PATH = 'timestamp'¶
- collect()[source]¶
Collects TFC audit trail from the TFC audit-trails API.
https://www.terraform.io/docs/cloud/api/audit-trails.html
This will first check whether there are any pointers cached to indicate previous collections. If not, the last week of data will be collected.