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
, 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
Scheduled
Audit 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. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that 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.
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. |
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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
).
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
ScheduledAuditArn(scope, id, scheduledAuditArn)
static frompublic 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.
ScheduledAuditAttributes(scope, id, attrs)
static frompublic 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.