Skip to content

Commit fab100e

Browse files
authored
Merge branch 'main' into merge-back/2.214.0
2 parents 9676968 + 6d64bda commit fab100e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/@aws-cdk/aws-iot-alpha/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ new iot.AccountAuditConfiguration(this, 'AuditConfiguration', {
150150
checkConfiguration: {
151151
deviceCertificateAgeCheck: true,
152152
// The default value is 365 days
153-
// Valid values range from 30 days (minimum) to 3652 days (10 years, maximum)
153+
// Valid values range from 30 days (minimum) to 3650 days (10 years, maximum)
154154
deviceCertificateAgeCheckDuration: Duration.days(365),
155155
},
156156
});

packages/@aws-cdk/aws-iot-alpha/lib/audit-configuration.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export interface CheckConfiguration {
7171
* The duration used to check if a device certificate has been active
7272
* for a number of days greater than or equal to the number you specify.
7373
*
74-
* Valid values range from 30 days (minimum) to 3652 days (10 years, maximum).
74+
* Valid values range from 30 days (minimum) to 3650 days (10 years, maximum).
7575
*
7676
* You cannot specify a value for this check if `deviceCertificateAgeCheck` is set to `false`.
7777
*
@@ -231,8 +231,8 @@ export class AccountAuditConfiguration extends Resource implements IAccountAudit
231231
if (props?.checkConfiguration?.deviceCertificateAgeCheck === false) {
232232
throw new Error('You cannot specify a value for `deviceCertificateAgeCheckDuration` if `deviceCertificateAgeCheck` is set to `false`.');
233233
}
234-
if (!deviceAgeCheckThreshold.isUnresolved() && deviceAgeCheckThreshold.toDays() < 30 || deviceAgeCheckThreshold.toDays() > 3652) {
235-
throw new Error(`The device certificate age check threshold must be between 30 and 3652 days. got: ${deviceAgeCheckThreshold.toDays()} days.`);
234+
if (!deviceAgeCheckThreshold.isUnresolved() && deviceAgeCheckThreshold.toDays() < 30 || deviceAgeCheckThreshold.toDays() > 3650) {
235+
throw new Error(`The device certificate age check threshold must be between 30 and 3650 days. got: ${deviceAgeCheckThreshold.toDays()} days.`);
236236
}
237237
}
238238

packages/@aws-cdk/aws-iot-alpha/test/audit-configuration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ test('throw error for configuring duration without enabling deviceCertificateAge
147147

148148
test.each([
149149
cdk.Duration.days(29),
150-
cdk.Duration.days(3653),
150+
cdk.Duration.days(3651),
151151
])('throw error for invalid duration %s', (duration) => {
152152
const stack = new cdk.Stack();
153153
expect(() => new iot.AccountAuditConfiguration(stack, 'AccountAuditConfiguration', {
154154
checkConfiguration: {
155155
deviceCertificateAgeCheck: true,
156156
deviceCertificateAgeCheckDuration: duration,
157157
},
158-
})).toThrow(`The device certificate age check threshold must be between 30 and 3652 days. got: ${duration.toDays()} days.`);
158+
})).toThrow(`The device certificate age check threshold must be between 30 and 3650 days. got: ${duration.toDays()} days.`);
159159
});
160160

161161
test('import by Account ID', () => {

0 commit comments

Comments
 (0)