question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

aws-ecs: wrong cfnspec for EFS volume configuration (casing issue)

See original GitHub issue

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: 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:closed
  • Created 2 years ago
  • Reactions:22
  • Comments:31 (5 by maintainers)

github_iconTop GitHub Comments

11reactions
desosscommented, Jul 29, 2021

Still not solved in v1.116.0 😢

7reactions
mathieubrdcommented, Jan 23, 2022

Any update on this? Bug still there with CDK v2.8

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Amazon EFS volume mount issues in Amazon ...
Verify that the mount targets are configured correctly​​ If you don't correctly create the mount targets, then the pods that are mounting the...
Read more >
@aws-cdk/aws-ecs | Yarn - Package Manager
This property was previously incorrectly configured and was returning a not-implemented message from CloudFormation every time. amplify: use the ...
Read more >
Amazon's Elastic File System (EFS) Explained - BMC Software
Use cases for EFS volumes; Creating an EFS; Mounting an EFS on an on-premises server; EFS pricing; Creating & using an EFS. (This...
Read more >
@aws-cdk/aws-codepipeline: Versions | Openbase
cli: typescript init templates fail with error in build step (#23130) (c04f158) ... ecs: get rid of EFS casing warnings (#19681) (eafc11a), closes...
Read more >
Trouble mounting EFS Access Point to ECS Volume
And because I think /var/lib/ecs/volumes/... is actually either the container or the host directory. How could I circumvent this problem? fyi: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found