|
| 1 | + |
| 2 | +# oci_audit_events |
| 3 | + |
| 4 | +## AuditEvent DataSource |
| 5 | + |
| 6 | +Gets a list of audit_events. |
| 7 | + |
| 8 | +### List Operation |
| 9 | +Returns all audit events for the specified compartment that were processed within the specified time range. |
| 10 | +The following arguments are supported: |
| 11 | + |
| 12 | +* `compartment_id` - (Required) The OCID of the compartment. |
| 13 | +* `end_time` - (Required) Returns events that were processed before this end date and time, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. For example, a start value of `2017-01-01T00:00:00Z` and an end value of `2017-01-02T00:00:00Z` will retrieve a list of all events processed on January 1, 2017. Similarly, a start value of `2017-01-01T00:00:00Z` and an end value of `2017-02-01T00:00:00Z` will result in a list of all events processed between January 1, 2017 and January 31, 2017. You can specify a value with granularity to the minute. Seconds (and milliseconds, if included) must be set to `0`. |
| 14 | +* `start_time` - (Required) Returns events that were processed at or after this start date and time, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. For example, a start value of `2017-01-15T11:30:00Z` will retrieve a list of all events processed since 30 minutes after the 11th hour of January 15, 2017, in Coordinated Universal Time (UTC). You can specify a value with granularity to the minute. Seconds (and milliseconds, if included) must be set to `0`. |
| 15 | +* `limit` - (Optional) The number of pages of events to request from the service. Default to 1. Large `start_time` and `end_time` ranges or very active tenancies may result in very large data sets that could cause performance issues running Terraform commands. This default value mitigates that risk by requiring intentionally setting a higher tolerance for slow running Terarform commands with potentially large statefiles. |
| 16 | + |
| 17 | + |
| 18 | +The following attributes are exported: |
| 19 | + |
| 20 | +* `audit_events` - The list of audit_events. |
| 21 | + |
| 22 | +### Example Usage |
| 23 | + |
| 24 | +```hcl |
| 25 | +data "oci_audit_events" "test_audit_events" { |
| 26 | + #Required |
| 27 | + compartment_id = "${var.compartment_id}" |
| 28 | + end_time = "${var.audit_event_end_time}" |
| 29 | + start_time = "${var.audit_event_start_time}" |
| 30 | +} |
| 31 | +``` |
| 32 | +### AuditEvent Reference |
| 33 | + |
| 34 | +The following attributes are exported: |
| 35 | + |
| 36 | +* `compartment_id` - The OCID of the compartment. |
| 37 | +* `credential_id` - The credential ID of the user. This value is extracted from the HTTP 'Authorization' request header. It consists of the tenantId, userId, and user fingerprint, all delimited by a slash (/). |
| 38 | +* `event_id` - The GUID of the event. |
| 39 | +* `event_name` - The name of the event. Example: `LaunchInstance` |
| 40 | +* `event_source` - The source of the event. |
| 41 | +* `event_time` - The time the event occurred, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. |
| 42 | +* `event_type` - The type of the event. |
| 43 | +* `principal_id` - The OCID of the user whose action triggered the event. |
| 44 | +* `request_action` - The HTTP method of the request. |
| 45 | +* `request_agent` - The user agent of the client that made the request. |
| 46 | +* `request_headers` - The HTTP header fields and values in the request. |
| 47 | +* `request_id` - The opc-request-id of the request. |
| 48 | +* `request_origin` - The IP address of the source of the request. |
| 49 | +* `request_parameters` - The query parameter fields and values for the request. |
| 50 | +* `request_resource` - The resource targeted by the request. |
| 51 | +* `response_headers` - The headers of the response. |
| 52 | +* `response_payload` - Metadata of interest from the response payload. For example, the OCID of a resource. |
| 53 | +* `response_status` - The status code of the response. |
| 54 | +* `response_time` - The time of the response to the audited request, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. |
| 55 | +* `tenant_id` - The OCID of the tenant. |
0 commit comments