medialive: CfnChannel.encoderSettings structure gets corrupted during template generation pipeline
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
The `aws-cdk-lib/aws-medialive.CfnChannel.encoderSettings` structure appears to be correctly defined in TypeScript and passes `cdk synth`, but gets corrupted during the CloudFormation template generation pipeline, resulting in deployment failures.
### Regression Issue
- [ ] Select this option if this issue appears to be a regression.
### Last Known Working CDK Library Version
_No response_
### Expected Behavior
The encoderSettings structure should be preserved correctly from CDK synthesis through to the final CloudFormation template.
### Current Behavior
The following structure is correctly defined and passes `cdk synth`:
```typescript
encoderSettings: {
outputGroups: [{
outputs: [{
outputSettings: {
hlsOutputSettings: {
hlsSettings: {
standardHlsSettings: {
m3u8Settings: { /* valid settings */ }
}
}
}
}
}]
}]
}
```
However, the final CloudFormation template appears to have structural issues that cause AWS validation to fail.
### Error Messages (on deployment)
- outputSettings.hlsSettings.m3u8Settings requires property "m3u8Settings"
- outputSettings.hlsOutputSettings.hlsSettings Object does not match "standard"
- outputSettings Object does not match "hls"
### Reproduction Steps
1. Create a MediaLive channel with properly structured encoderSettings
2. Run `cdk synth` - succeeds and generates tree.json
3. Run `cdk deploy` - fails with AWS validation error
4. Inspect the generated CloudFormation template - structure appears corrupted
### Possible Solution
1. **Template generation pipeline investigation**: Debug why the structure changes between synthesis and final template
2. **Enhanced validation**: Add validation during template generation to catch structural corruption
### Additional Information/Context
This suggests an issue in the CDK's template generation pipeline rather than TypeScript definitions. The fact that `cdk synth` succeeds but deployment fails indicates the problem occurs during the transformation from CDK constructs to CloudFormation resources.
### AWS CDK Library version (aws-cdk-lib)
aws-cdk-lib@2.213.0
### AWS CDK CLI version
10.9.3
### Node.js Version
v22.19.0
### OS
ubuntu:22.04
### Language
TypeScript
### Language Version
typescript@5.6.3
### Other information
### Workaround
Currently, we work around this by:
1. Using `addPropertyOverride()` to bypass the corrupted pipeline
2. Implementing custom validation in our application code
3. Adding unit tests to catch these issues during development
Contributor guide
Research direction
Reproduce the issue with aws-medialive.CfnChannel.encoderSettings, then compare the output from cdk synth with the final CloudFormation template used by cdk deploy. Trace where the structure changes and use the existing addPropertyOverride workaround and application unit tests as comparison points. Done means the encoderSettings structure is preserved and deployment no longer produces the listed validation errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, node.js, typescript
- Domain
- cloud, devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100