CDK 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:
|
EfsVolumeConfiguration: { |
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
CDK currently generates two resources with casing mistakes when
EFSVolumeConfigurationis specified for task definitions.EfsVolumeConfigurationshould beEFSVolumeConfigurationFileSystemIdshould beFilesystemIdThe corresponding test is also wrong:
aws-cdk/packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts
Line 1192 in 23986d7
Reproduction Steps
The following (incomplete) snippet recreates the issue:
This is based on the
ApplicationLoadBalancedFargateServicepattern.The above generates this CFN JSON:
Which then yields CFN errors:
message: #/Volumes/0: extraneous key [EfsVolumeConfiguration] is not permittedAnd if I fix the above to use the correct case manually, then later it uncovers the 2nd problem:
Fixing both manually causes the template to be deployed successfully.
Environment
This is 🐛 Bug Report