Muntazir Fadhel
Muntazir Fadhel

Reputation: 51

Cloudformation Error - Encountered unsupported property EFSVolumeConfiguration

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: ...

Upvotes: 1

Views: 2256

Answers (4)

Pat Myron
Pat Myron

Reputation: 4638

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

Upvotes: 2

amanpal
amanpal

Reputation: 21

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.

Upvotes: 2

Magnus
Magnus

Reputation: 198

https://aws.amazon.com/about-aws/whats-new/2020/04/amazon-ecs-aws-fargate-support-amazon-efs-filesystems-generally-available/

Announced April 8, just after the question and before you found the documentation :)

Upvotes: 0

ir0h
ir0h

Reputation: 361

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.

Upvotes: 0

Related Questions