Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::ECS::TaskDefinition-Volumes-EfsVolumeConfiguration #418

Closed
taraspos opened this issue Mar 19, 2020 · 18 comments
Closed

AWS::ECS::TaskDefinition-Volumes-EfsVolumeConfiguration #418

taraspos opened this issue Mar 19, 2020 · 18 comments
Labels
compute EC2, ECR, ECS, EKS, Lambda, Batch, Elastic Beanstalk, Serverless Application Repository
Milestone

Comments

@taraspos
Copy link

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

Feature announcement
Tutorial
Docs

Category: Compute

@autarchprinceps
Copy link

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.

@taraspos
Copy link
Author

@luiseduardocolon luiseduardocolon added the compute EC2, ECR, ECS, EKS, Lambda, Batch, Elastic Beanstalk, Serverless Application Repository label May 8, 2020
@piotrplenik
Copy link

piotrplenik commented May 12, 2020

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:

@moberwasserlechner
Copy link

moberwasserlechner commented May 18, 2020

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. aws/containers-roadmap#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.

@sureshbhusare
Copy link

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

@seb-steuer
Copy link

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

@craigataws craigataws added this to the cov milestone Jul 21, 2020
@f0o
Copy link

f0o commented Jul 23, 2020

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?

@seb-steuer
Copy link

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

@f0o
Copy link

f0o commented Jul 23, 2020

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?

@seb-steuer
Copy link

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

@f0o
Copy link

f0o commented Jul 24, 2020

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

@luiseduardocolon
Copy link
Contributor

This has been released :)

@kimegede
Copy link

kimegede commented Aug 4, 2020

Sweet!
Here is a link for it: https://aws.amazon.com/about-aws/whats-new/2020/08/amazon-ecs-announces-cloudformation-support-for-amazon-efs-volumes/

@namedgraph
Copy link

@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
Copy link

@namedgraph
Copy link

@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
Copy link

Is it aws/aws-cdk#15025 ?

@lavignes
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compute EC2, ECR, ECS, EKS, Lambda, Batch, Elastic Beanstalk, Serverless Application Repository
Projects
None yet
Development

No branches or pull requests