aws / aws/aws-cdk

aws-iot: CfnJobTemplate types mismatched cases

Open
#32,258 7 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-iot bug effort/medium p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

Several types are incorrectly cased in CfnJobTemplate under aws-iot version 2.166.0

```
const timeoutConfig: CfnJobTemplate.TimeoutConfigProperty = {
inProgressTimeoutInMinutes: 100
};

...
Properties validation failed for resource ********* with message:
[#/TimeoutConfig: extraneous key [inProgressTimeoutInMinutes] is not permitted]
```

It seems like multiple properties are affected.

### Regression Issue

- [X] Select this option if this issue appears to be a regression.

### Last Known Working CDK Version

_No response_

### Expected Behavior

Type should be:

(Note the capital *I* / Pascal case vs camel case)

```
/**
* Specifies the amount of time each device has to finish its execution of the job.
*
* A timer is started when the job execution status is set to `IN_PROGRESS` . If the job execution status is not set to another terminal state before the timer expires, it will be automatically set to `TIMED_OUT` .
*
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot-jobtemplate-timeoutconfig.html
*/
interface TimeoutConfigProperty {
/**
* Specifies the amount of time, in minutes, this device has to finish execution of this job.
*
* The timeout interval can be anywhere between 1 minute and 7 days (1 to 10080 minutes). The in progress timer can't be updated and will apply to all job executions for the job. Whenever a job execution remains in the IN_PROGRESS status for longer than this interval, the job execution will fail and switch to the terminal `TIMED_OUT` status.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot-jobtemplate-timeoutconfig.html#cfn-iot-jobtemplate-timeoutconfig-inprogresstimeoutinminutes
*/
readonly InProgressTimeoutInMinutes: number;
}
```

### Current Behavior

Several properties have this issue in CfnJobTemplate.

```
[#/TimeoutConfig: extraneous key [inProgressTimeoutInMinutes] is not permitted, #/JobExecutionsRolloutConfig: extraneous key [maximu
mPerMinute] is not permitted, #/JobExecutionsRolloutConfig: extraneous key [exponentialRate] is not permitted]
```

### Reproduction Steps

```
const timeoutConfig: CfnJobTemplate.TimeoutConfigProperty = {
inProgressTimeoutInMinutes: 100
};

const jobTemplate = new CfnJobTemplate(this, `jobTemplate1`, {
jobTemplateId: 'SOME_ID',
description: 'Description',
document: '',
timeoutConfig
}

```
Build & deploy

results in:

```
[#/TimeoutConfig: extraneous key [inProgressTimeoutInMinutes] is not permitted
```

### Possible Solution

Types need to be corrected

### Additional Information/Context

_No response_

### CDK CLI Version

2.166.0

### Framework Version

2.166.0

### Node.js Version

v20.18.0

### OS

MacOS

### Language

TypeScript

### Language Version

5.6.3

### Other information

The documentation is conflicted on what it should be, but Pascal case does work if done if forced by using CfnJobTemplate without the property types because they're all 'any'.

Pascal
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot-jobtemplate-timeoutconfig.html#cfn-iot-jobtemplate-timeoutconfig-inprogresstimeoutinminutes

Camel
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iot/create-job-template.html

Camel
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnJobTemplate.TimeoutConfigProperty.html

Contributor guide

Open the contributing guide

Research direction

Start with CfnJobTemplate.TimeoutConfigProperty and the JobExecutionsRolloutConfig properties described in the issue, then compare their TypeScript names with the linked CloudFormation and CDK documentation. Correct the mismatched casing so the documented PascalCase properties are accepted and the reproduced deployment validation errors no longer occur.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.