aws-ecs: wrong cfnspec for EFS volume configuration (casing issue)
See original GitHub issueCDK currently generates two resources with casing mistakes when EFSVolumeConfiguration
is specified for task definitions.
EfsVolumeConfiguration
should be
EFSVolumeConfiguration
FileSystemId
should be
FilesystemId
The corresponding test is also wrong: https://github.com/aws/aws-cdk/blob/23986d70c5cd69ce212b5ffdc1bcf059f438f15b/packages/%40aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts#L1192
Reproduction Steps
The following (incomplete) snippet recreates the issue:
const efs = new FileSystem(this, 'etcdata', {
vpc: service.cluster.vpc,
});
taskDefinition.addVolume({
name: 'etcdata',
efsVolumeConfiguration: {
fileSystemId: efs.fileSystemId
},
});
This is based on the ApplicationLoadBalancedFargateService
pattern.
The above generates this CFN JSON:
"Volumes": [
{
"Name": "etcdata",
"EfsVolumeConfiguration": {
"FileSystemId": {
"Ref": "etcdata80702D7D"
}
}
}
]
Which then yields CFN errors:
message: #/Volumes/0: extraneous key [EfsVolumeConfiguration] is not permitted
And if I fix the above to use the correct case manually, then later it uncovers the 2nd problem:
#/Volumes/0/EFSVolumeConfiguration: required key [FilesystemId] not found
Fixing both manually causes the template to be deployed successfully.
Environment
- CDK CLI Version : 1.107.0 (build 52c4434)
- Framework Version: ??
- Node.js Version: v16.2.0
- OS : OSX
- **Language (Version): typescript 4.3.2 -->
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 2 years ago
- Reactions:22
- Comments:31 (5 by maintainers)
Top GitHub Comments
Still not solved in v1.116.0 😢
Any update on this? Bug still there with CDK v2.8