aws-ecs: EFSVolumeConfiguration is an extraneous key
See original GitHub issue❓ General Issue
The Question
When creating a FargateTaskDefinition and adding an EFS Volume, the CloudFormation template warns that the “EfsVolumeConfiguration” is an extraneous key - is this a known issue?
Given the following Typescript FargateTaskDefinition
const myAppFargateTaskDefinition = new FargateTaskDefinition(this, 'MyAppFargateTaskDefinition', {
memoryLimitMiB: 512,
cpu: 256,
executionRole: myAppFargateTaskExecutionRole,
taskRole: myAppFargateTaskRole,
});
myAppFargateTaskDefinition.addVolume({
name: 'MyAppEfsVolume',
efsVolumeConfiguration: {
fileSystemId: fileSystem.fileSystemId,
transitEncryption: 'ENABLED',
authorizationConfig: {
accessPointId: fileSystemAccessPoint.accessPointId
}
}
});
The output Cloudformation template generates the following:
"MyAppFargateTaskDefinitionEB5C71CC": {
"Type": "AWS::ECS::TaskDefinition",
"Properties": {
...,
Volumes": [ {
"Name": "MyAppEfsVolume",
"EfsVolumeConfiguration": {
"AuthorizationConfig": {
"AccessPointId": {
"Ref": "FileSystemAccessPointF8178182"
}
},
"TransitEncryption": "ENABLED",
"FileSystemId": {
"Ref": "FileSystem8A8E25C0"
}
}
}]
}
}
However when creating the stack there is the following validation message:
Resource template validation failed for resource MyAppFargateTaskDefinitionEB5C71CC as the template has invalid properties. Please refer to the resource documentation to fix the template. Properties validation failed for resource MyAppFargateTaskDefinitionEB5C71CC with message: #/Volumes/0: extraneous key [EfsVolumeConfiguration] is not permitted
Environment
- CDK CLI Version: 1.97.0
- Module Version: 1.97.1
- Node.js Version: v13.14.0
- OS: macOs Mojave
- Language (Version): Typescript (4.2.4)
Other information
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:27 (17 by maintainers)
Top Results From Across the Web
Properties validation failed with message extraneous key is ...
The fix is to capitalize the first letter, ie use LinuxParameters instead. Note that this applies to nested properties as well, eg ...
Read more >extraneous key [Key] is not permitted)" error in CloudFormation
I receive the "Model validation failed (#: extraneous key [Key] is not permitted)" error in my stack events. This error occurs when I...
Read more >AWS::ECS::TaskDefinition - Amazon CloudFormation
The metadata that you apply to the task definition to help you categorize and organize them. Each tag consists of a key and...
Read more >AWS Fargate with EFS | Chris A James
About a month ago, AWS announced that AWS ECS and Fargate support for AWS EFS File Systems is now generally available. This is...
Read more >AWS CloudFormation Custom Resource | by Giuseppe Borgese
efsVolumeConfiguration : { fileSystemId: <put your fily system id like this one fs-xxxxxx> } }, ] } CustomResourceFunction: Type: 'AWS::Lambda::Function'
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If it helps I’m running
1.102.0
and am still seeing the warning in CDK console out:Synth template:
Stack does go on to deploy with the volume mounted correctly.
Thanks
Thanks, that did indeed fix this instance however, there is a subsequent casing issue for FileSystemId
with message: #/Volumes/0/EFSVolumeConfiguration: required key [FilesystemId] not found #/Volumes/0/EFSVolumeConfiguration: extraneous key [FileSystemId] is not permitted
Will manually change this too, will try and find the offending code later and PR a fix!