class ScheduledAudit (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.IoT.Alpha.ScheduledAudit |
Go | github.com/aws/aws-cdk-go/awscdkiotalpha/v2#ScheduledAudit |
Java | software.amazon.awscdk.services.iot.alpha.ScheduledAudit |
Python | aws_cdk.aws_iot_alpha.ScheduledAudit |
TypeScript (source) | @aws-cdk/aws-iot-alpha ยป ScheduledAudit |
Implements
IConstruct, IDependable, IResource, IEnvironment, IScheduled
Defines AWS IoT Scheduled Audit.
Example
declare const config: iot.AccountAuditConfiguration;
// Daily audit
const dailyAudit = new iot.ScheduledAudit(this, 'DailyAudit', {
accountAuditConfiguration: config,
frequency: iot.Frequency.DAILY,
auditChecks: [
iot.AuditCheck.AUTHENTICATED_COGNITO_ROLE_OVERLY_PERMISSIVE_CHECK,
],
})
// Weekly audit
const weeklyAudit = new iot.ScheduledAudit(this, 'WeeklyAudit', {
accountAuditConfiguration: config,
frequency: iot.Frequency.WEEKLY,
dayOfWeek: iot.DayOfWeek.SUNDAY,
auditChecks: [
iot.AuditCheck.CA_CERTIFICATE_EXPIRING_CHECK,
],
});
// Monthly audit
const monthlyAudit = new iot.ScheduledAudit(this, 'MonthlyAudit', {
accountAuditConfiguration: config,
frequency: iot.Frequency.MONTHLY,
dayOfMonth: iot.DayOfMonth.of(1),
auditChecks: [
iot.AuditCheck.CA_CERTIFICATE_KEY_QUALITY_CHECK,
],
});
Initializer
new ScheduledAudit(scope: Construct, id: string, props: ScheduledAuditProps)
Parameters
- scope
Construct - id
string - props
ScheduledAudit Props
Construct Props
| Name | Type | Description |
|---|---|---|
| account | IAccount | Account audit configuration. |
| audit | Audit[] | Which checks are performed during the scheduled audit. |
| frequency | Frequency | How often the scheduled audit occurs. |
| day | Day | The day of the month on which the scheduled audit is run (if the frequency is "MONTHLY"). |
| day | Day | The day of the week on which the scheduled audit is run (if the frequency is "WEEKLY" or "BIWEEKLY"). |
| scheduled | string | The name of the scheduled audit. |
accountAuditConfiguration
Type:
IAccount
Account audit configuration.
The audit checks specified in auditChecks must be enabled in this configuration.
auditChecks
Type:
Audit[]
Which checks are performed during the scheduled audit.
Checks must be enabled for your account.
frequency
Type:
Frequency
How often the scheduled audit occurs.
dayOfMonth?
Type:
Day
(optional, default: required if frequency is "MONTHLY", not allowed otherwise)
The day of the month on which the scheduled audit is run (if the frequency is "MONTHLY").
If days 29-31 are specified, and the month does not have that many days, the audit takes place on the "LAST" day of the month.
dayOfWeek?
Type:
Day
(optional, default: required if frequency is "WEEKLY" or "BIWEEKLY", not allowed otherwise)
The day of the week on which the scheduled audit is run (if the frequency is "WEEKLY" or "BIWEEKLY").
scheduledAuditName?
Type:
string
(optional, default: auto generated name)
The name of the scheduled audit.
Properties
| Name | Type | Description |
|---|---|---|
| env | Resource | The environment this resource belongs to. |
| node | Node | The tree node. |
| scheduled | string | The ARN of the scheduled audit. |
| scheduled | string | The scheduled audit name. |
| stack | Stack | The stack in which this resource is defined. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
node
Type:
Node
The tree node.
scheduledAuditArn
Type:
string
The ARN of the scheduled audit.
scheduledAuditName
Type:
string
The scheduled audit name.
stack
Type:
Stack
The stack in which this resource is defined.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| to | Returns a string representation of this construct. |
| static from | Import an existing AWS IoT Scheduled Audit from its ARN. |
| static from | Import an existing AWS IoT Scheduled Audit from its attributes. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
static fromScheduledAuditArn(scope, id, scheduledAuditArn)
public static fromScheduledAuditArn(scope: Construct, id: string, scheduledAuditArn: string): IScheduledAudit
Parameters
- scope
Constructโ The parent creating construct (usuallythis). - id
stringโ The construct's name. - scheduledAuditArn
stringโ The ARN of the scheduled audit.
Returns
Import an existing AWS IoT Scheduled Audit from its ARN.
static fromScheduledAuditAttributes(scope, id, attrs)
public static fromScheduledAuditAttributes(scope: Construct, id: string, attrs: ScheduledAuditAttributes): IScheduledAudit
Parameters
- scope
Constructโ The parent creating construct (usuallythis). - id
stringโ The construct's name. - attrs
Scheduledโ The scheduled audit attributes.Audit Attributes
Returns
Import an existing AWS IoT Scheduled Audit from its attributes.

.NET
Go
Java
Python
TypeScript (