scheduled_audits
Creates, updates, deletes or gets a scheduled_audit resource or lists scheduled_audits in a region
Overview
| Name | scheduled_audits |
| Type | Resource |
| Description | Scheduled audits can be used to specify the checks you want to perform during an audit and how often the audit should be run. |
| Id | awscc.iot.scheduled_audits |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
scheduled_audit_name | string | The name you want to give to the scheduled audit. |
frequency | string | How often the scheduled audit takes place. Can be one of DAILY, WEEKLY, BIWEEKLY, or MONTHLY. |
day_of_month | string | The 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_week | string | The 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_names | array | Which checks are performed during the scheduled audit. Checks must be enabled for your account. |
scheduled_audit_arn | string | The ARN (Amazon resource name) of the scheduled audit. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
scheduled_audit_name | string | The name you want to give to the scheduled audit. |
region | string | AWS region. |
For more information, see AWS::IoT::ScheduledAudit.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | scheduled_audits | INSERT | Frequency, TargetCheckNames, region |
delete_resource | scheduled_audits | DELETE | Identifier, region |
update_resource | scheduled_audits | UPDATE | Identifier, PatchDocument, region |
list_resources | scheduled_audits_list_only | SELECT | region |
get_resource | scheduled_audits | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 awscc.iot.scheduled_audits
WHERE
region = 'us-east-1' AND
Identifier = '{{ scheduled_audit_name }}';
Lists all scheduled_audits in a region.
SELECT
region,
scheduled_audit_name
FROM awscc.iot.scheduled_audits_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new scheduled_audit resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.iot.scheduled_audits (
Frequency,
TargetCheckNames,
region
)
SELECT
'{{ frequency }}',
'{{ target_check_names }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.iot.scheduled_audits (
ScheduledAuditName,
Frequency,
DayOfMonth,
DayOfWeek,
TargetCheckNames,
Tags,
region
)
SELECT
'{{ scheduled_audit_name }}',
'{{ frequency }}',
'{{ day_of_month }}',
'{{ day_of_week }}',
'{{ target_check_names }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: scheduled_audit
props:
- name: scheduled_audit_name
value: '{{ scheduled_audit_name }}'
- name: frequency
value: '{{ frequency }}'
- name: day_of_month
value: '{{ day_of_month }}'
- name: day_of_week
value: '{{ day_of_week }}'
- name: target_check_names
value:
- '{{ target_check_names[0] }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a scheduled_audit resource, using stack-deploy.
/*+ update */
UPDATE awscc.iot.scheduled_audits
SET PatchDocument = string('{{ {
"Frequency": frequency,
"DayOfMonth": day_of_month,
"DayOfWeek": day_of_week,
"TargetCheckNames": target_check_names,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ scheduled_audit_name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.iot.scheduled_audits
WHERE
Identifier = '{{ scheduled_audit_name }}' AND
region = 'us-east-1';
Permissions
To operate on the scheduled_audits resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iot:CreateScheduledAudit,
iot:DescribeScheduledAudit,
iot:TagResource
iot:DescribeScheduledAudit,
iot:ListTagsForResource
iot:UpdateScheduledAudit,
iot:ListTagsForResource,
iot:UntagResource,
iot:TagResource
iot:DescribeScheduledAudit,
iot:DeleteScheduledAudit
iot:ListScheduledAudits