Skip to main content

audit_tasks

Creates, updates, deletes, gets or lists an audit_tasks resource.

Overview

Nameaudit_tasks
TypeResource
Idaws.iot.audit_tasks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
task_idstringThe ID of this audit. (pattern: <code>[a-zA-Z0-9-]+</code>)
task_statusstringThe status of this audit. One of "IN_PROGRESS", "COMPLETED", "FAILED", or "CANCELED". (IN_PROGRESS, COMPLETED, FAILED, CANCELED)
task_typestringThe type of this audit. One of "ON_DEMAND_AUDIT_TASK" or "SCHEDULED_AUDIT_TASK". (ON_DEMAND_AUDIT_TASK, SCHEDULED_AUDIT_TASK)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_audit_tasksselectstartTime, endTime, regiontaskType, taskStatus, nextToken, maxResultsLists the Device Defender audits that have been performed during a given time period. Requires permission to access the ListAuditTasks action.
describe_audit_taskselecttask_id, regionGets information about a Device Defender audit. Requires permission to access the DescribeAuditTask action.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endTimestring (date-time)The end of the time period.
regionstringAWS region (default: us-east-1)
startTimestring (date-time)The beginning of the time period. Audit information is retained for a limited time (90 days). Requesting a start time prior to what is retained results in an "InvalidRequestException".
task_idstringThe ID of the audit whose information you want to get.
maxResultsintegerThe maximum number of results to return at one time. The default is 25.
nextTokenstringThe token for the next set of results.
taskStatusstringA filter to limit the output to audits with the specified completion status: can be one of "IN_PROGRESS", "COMPLETED", "FAILED", or "CANCELED".
taskTypestringA filter to limit the output to the specified type of audit: can be one of "ON_DEMAND_AUDIT_TASK" or "SCHEDULED__AUDIT_TASK".

SELECT examples

Lists the Device Defender audits that have been performed during a given time period. Requires permission to access the ListAuditTasks action.

SELECT
task_id,
task_status,
task_type
FROM aws.iot.audit_tasks
WHERE startTime = '{{ startTime }}' -- required
AND endTime = '{{ endTime }}' -- required
AND region = '{{ region }}' -- required
AND taskType = '{{ taskType }}'
AND taskStatus = '{{ taskStatus }}'
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;