Cloudformation-coverage-roadmap: AWS::ECS::TaskDefinition-Volumes-EfsVolumeConfiguration

Created on 19 Mar 2020  路  18Comments  路  Source: aws-cloudformation/cloudformation-coverage-roadmap

AWS::ECS::TaskDefinition-Volumes currently supports dockerVolumeConfiguration but not the EfsVolumeConfiguration

Feature announcement
Tutorial
Docs

Category: Compute

compute

Most helpful comment

Now also supported for Fargate: https://aws.amazon.com/about-aws/whats-new/2020/04/amazon-ecs-aws-fargate-support-amazon-efs-filesystems-generally-available/ so having this in CloudFormation would be really important.

All 18 comments

Now also supported for Fargate: https://aws.amazon.com/about-aws/whats-new/2020/04/amazon-ecs-aws-fargate-support-amazon-efs-filesystems-generally-available/ so having this in CloudFormation would be really important.

Confirm, EfsVolumeConfiguration is not supported by CloudFormation.

Error on Stack update:

Encountered unsupported property EfsVolumeConfiguration

Sample configuration:

  TaskDefinition:
    Type: "AWS::ECS::TaskDefinition"
    Properties:
      ContainerDefinitions:
# ...
      Volumes:
        - Name: data
          EfsVolumeConfiguration:
            FileSystemId: !Ref EfsResource

Additionally this function need to be documented here:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volumes.html

Just for the record, EfsVolumeConfiguration is already supported by TaskDefinition API and Console:

It's a bit difficult to keep track because there are so many open tasks concerning this issue and I have found another one, that is already in progress. https://github.com/aws/containers-roadmap/issues/825

As it's not clear when the feature lands I will most probably use a Custom Resource (see that comment) to do the EFS config because as said before the API already supports this.

If CloudFormation is not supporting then We need to go and add mount commands in UserData of EC2 instance.

I was wondering if we could get any update on that?
I don't even see it being placed on the roadmap after all that time as it still has not been labeled

Bump since I'm stuck on the same issue...

Nice to see that https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html provides a cfn snippet but at the time of writing here it's not valid and throws error:

Encountered unsupported property efsVolumeConfiguration

So what's the proper way of using EFS in Fargate with Cloudformation?

...
So what's the proper way of using EFS in Fargate with Cloudformation?

I think it would be writing your own custom resource for TaskDefinition which honestly is a pain in the butt
I'm not happy on how we are being ignored here in this ticket and this issue is still not on the roadmap

I hope its not gonna end up like Cognito with some of the features being implemented more than a year after their release (or was that actually around 2y don't remember now)

I hope its not gonna end up like Cognito with some of the features being implemented more than a year after their release (or was that actually around 2y don't remember now)

what bothers me the most is that they clearly post a cloudformation snippet in their docs but when you actually try to use it, cfn will refuse it. I mean isn't this tested in any way before being posted and claimed to be working?

what bothers me the most is that they clearly post a cloudformation snippet in their docs but when you actually try to use it, cfn will refuse it. I mean isn't this tested in any way before being posted and claimed to be working?

@f0o
I don't think that is correct, you are linking to ECS documenation where you have volumes defined for the CLI. Its not cloudformation. CFormation documentation does not mention EfsVolumeConfiguration
It can be confusing because sometimes CFormation documentation points to some links outside of CFormation
See that CFormation documenatation only mentions DockerVolumeConfiguration
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volumes.html

Perhaps, the task definition and the cfn taskdefinition look almost identical

This has been released :)

@luiseduardocolon why am I getting this error then?

Resource template validation failed for resource LDHTaskDefinitionDF5ADF89 as the template has invalid properties. Please refer to the resource documentation to fix the template.
Properties validation failed for resource LDHTaskDefinitionDF5ADF89 with message: #/Volumes/2: extraneous key [EfsVolumeConfiguration] is not permitted #/Volumes/5: extraneous key [EfsVolumeConfiguration] is not permitted

@lavignes I'm using CDK 1.102.0 to generate the following:

    - Name: FusekiEndUserDataVolume
      EfsVolumeConfiguration:
        RootDirectory: /var/fuseki/data/end-user
        FileSystemId:
          Ref: LDHFileSystem0D5F0D0E

Code:

taskDefinition.addVolume(Volume.builder().
    name("FusekiEndUserDataVolume").
    efsVolumeConfiguration(EfsVolumeConfiguration.builder().
        fileSystemId(fileSystem.getFileSystemId()).
        rootDirectory(fusekiEndUserDataSourcePath).
        build()).
    build());

I get the extraneous key [EfsVolumeConfiguration] is not permitted error when deploying the stack. What is the issue here?

@namedgraph oh wow. Yeah looks like a CDK bug.

Was this page helpful?
0 / 5 - 0 ratings