Skip to main content

scheduled_audits

Creates, updates, deletes or gets a scheduled_audit resource or lists scheduled_audits in a region

Overview

Namescheduled_audits
TypeResource
DescriptionScheduled audits can be used to specify the checks you want to perform during an audit and how often the audit should be run.
Idaws.iot.scheduled_audits

Fields

NameDatatypeDescription
scheduled_audit_namestringThe name you want to give to the scheduled audit.
frequencystringHow often the scheduled audit takes place. Can be one of DAILY, WEEKLY, BIWEEKLY, or MONTHLY.
day_of_monthstringThe day of the month on which the scheduled audit takes place. Can be 1 through 31 or LAST. This field is required if the frequency parameter is set to MONTHLY.
day_of_weekstringThe day of the week on which the scheduled audit takes place. Can be one of SUN, MON, TUE,WED, THU, FRI, or SAT. This field is required if the frequency parameter is set to WEEKLY or BIWEEKLY.
target_check_namesarrayWhich checks are performed during the scheduled audit. Checks must be enabled for your account.
scheduled_audit_arnstringThe ARN (Amazon resource name) of the scheduled audit.
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTFrequency, TargetCheckNames, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all scheduled_audits in a region.

SELECT
region,
scheduled_audit_name,
frequency,
day_of_month,
day_of_week,
target_check_names,
scheduled_audit_arn,
tags
FROM aws.iot.scheduled_audits
WHERE region = 'us-east-1';

Gets all properties from an individual scheduled_audit.

SELECT
region,
scheduled_audit_name,
frequency,
day_of_month,
day_of_week,
target_check_names,
scheduled_audit_arn,
tags
FROM aws.iot.scheduled_audits
WHERE region = 'us-east-1' AND data__Identifier = '<ScheduledAuditName>';

INSERT example

Use the following StackQL query and manifest file to create a new scheduled_audit resource, using stack-deploy.

/*+ create */
INSERT INTO aws.iot.scheduled_audits (
Frequency,
TargetCheckNames,
region
)
SELECT
'{{ Frequency }}',
'{{ TargetCheckNames }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.iot.scheduled_audits
WHERE data__Identifier = '<ScheduledAuditName>'
AND region = 'us-east-1';

Permissions

To operate on the scheduled_audits resource, the following permissions are required:

Create

iot:CreateScheduledAudit,
iot:DescribeScheduledAudit,
iot:TagResource

Read

iot:DescribeScheduledAudit,
iot:ListTagsForResource

Update

iot:UpdateScheduledAudit,
iot:ListTagsForResource,
iot:UntagResource,
iot:TagResource

Delete

iot:DescribeScheduledAudit,
iot:DeleteScheduledAudit

List

iot:ListScheduledAudits