CreateScheduledAuditCommand

Creates a scheduled audit that is run at a specified time interval.

Requires permission to access the CreateScheduledAudit  action.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { IoTClient, CreateScheduledAuditCommand } from "@aws-sdk/client-iot"; // ES Modules import
// const { IoTClient, CreateScheduledAuditCommand } = require("@aws-sdk/client-iot"); // CommonJS import
const client = new IoTClient(config);
const input = { // CreateScheduledAuditRequest
  frequency: "DAILY" || "WEEKLY" || "BIWEEKLY" || "MONTHLY", // required
  dayOfMonth: "STRING_VALUE",
  dayOfWeek: "SUN" || "MON" || "TUE" || "WED" || "THU" || "FRI" || "SAT",
  targetCheckNames: [ // TargetAuditCheckNames // required
    "STRING_VALUE",
  ],
  scheduledAuditName: "STRING_VALUE", // required
  tags: [ // TagList
    { // Tag
      Key: "STRING_VALUE", // required
      Value: "STRING_VALUE",
    },
  ],
};
const command = new CreateScheduledAuditCommand(input);
const response = await client.send(command);
// { // CreateScheduledAuditResponse
//   scheduledAuditArn: "STRING_VALUE",
// };

CreateScheduledAuditCommand Input

Parameter
Type
Description
frequency
Required
AuditFrequency | undefined

How often the scheduled audit takes place, either DAILY, WEEKLY, BIWEEKLY or MONTHLY. The start time of each audit is determined by the system.

scheduledAuditName
Required
string | undefined

The name you want to give to the scheduled audit. (Max. 128 chars)

targetCheckNames
Required
string[] | undefined

Which checks are performed during the scheduled audit. Checks must be enabled for your account. (Use DescribeAccountAuditConfiguration to see the list of all checks, including those that are enabled or use UpdateAccountAuditConfiguration to select which checks are enabled.)

dayOfMonth
string | undefined

The day of the month on which the scheduled audit takes place. This can be "1" through "31" or "LAST". This field is required if the "frequency" parameter is set to MONTHLY. If days 29 to 31 are specified, and the month doesn't have that many days, the audit takes place on the LAST day of the month.

dayOfWeek
DayOfWeek | undefined

The day of the week on which the scheduled audit takes place, either SUN, MON, TUE, WED, THU, FRI, or SAT. This field is required if the frequency parameter is set to WEEKLY or BIWEEKLY.

tags
Tag[] | undefined

Metadata that can be used to manage the scheduled audit.

CreateScheduledAuditCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
scheduledAuditArn
string | undefined

The ARN of the scheduled audit.

Throws

Name
Fault
Details
InternalFailureException
server

An unexpected error has occurred.

InvalidRequestException
client

The request is not valid.

LimitExceededException
client

A limit has been exceeded.

ResourceAlreadyExistsException
client

The resource already exists.

ThrottlingException
client

The rate exceeds the limit.

IoTServiceException
Base exception class for all service exceptions from IoT service.