1
votes

I'm trying to leverage a recently released feature of AWS which allows users to mount EFS file systems to ECS containers. Step 4 in this tutorial demonstrates the JSON CloudFormation code to do so, and I would think what I have below would be the correct YAML equivalent of it. However, it returns the following error when applying it:

"Resource creation cancelled" "Encountered unsupported property EFSVolumeConfiguration"]

I would appreciate any help in understanding how to fix this error, below is a simplified version of my CloudFormation code:

TaskDefinition:
    Type: AWS::ECS::TaskDefinition
    Properties:
      Cpu: ...
      Memory: ...
      ContainerDefinitions:
        - Name: ...
          Cpu: ...
          Memory: ...
          Image: ...
          MountPoints:
            - ContainerPath: /var/www/html/img
              SourceVolume: ImgEFS
          PortMappings:
            - ContainerPort: ...
          Environment:
            ...
      Volumes:
        - Name : ImgEFS
          EFSVolumeConfiguration:
            FileSystemId: ...
4
This is a preview, not yet available for cloudformation.franklinsijo

4 Answers

2
votes

I was facing the same problem when found out through AWS support that CloudFormation does not yet support the property "efsVolumeConfiguration". Currently, the only way to mount EFS volumes on Fargate tasks is via the ECS Console, SDK or CLI.

2
votes

AWS::ECS::TaskDefinition.Volume documentation

Recommend trying the CloudFormation Linter in VSCode to see some of these errors inline while authoring templates:

[cfn-lint] E3002 Invalid Property Resources/TaskDefinition/Properties/Volumes/0/EFSVolumeConfiguration

0
votes

While it does seem to be documented for implementation within a TaskDefinition in the latest documentation, it is not clear that this is available in the Cloud Formations TaskDefinition, yet. As Pat, above, seems to be pointing out.