Skip to content

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

@lavie

Description

@lavie

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-ecsRelated to Amazon Elastic Containerbreaking-changeThis issue requires a breaking change to remediate.bugThis issue is a bug.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions