cloudformation-coverage-roadmap icon indicating copy to clipboard operation
cloudformation-coverage-roadmap copied to clipboard

Deployment of Fargate Batch tasks with EFS volumes incorrectly fails when FargatePlatform set to LATEST

Open tcutts opened this issue 3 years ago • 2 comments

Name of the resource

AWS::Batch::JobDefinition

Resource Name

No response

Issue Description

If a job needs to run on a Fargate compute environment, using an EFS volume, support for this was added with Fargate 1.4.0.

This does not work if you specify LATEST as the PlatformVersion, which it should. It does work if you specify 1.4.0

Expected Behavior

The resource should deploy correctly whether the PlatformVersion is set to LATEST or 1.4.0.

Observed Behavior

If you specify 1.4.0, all works well. If you specify LATEST, you get the following error:

Failed to register job definition
Error: Error executing request, Exception : EFS is supported for Fargate platform version 1.4.0.

Test Cases

Create a Fargate ComputeEnvironment, EFS filesystem, and a job definition which attaches an EFS volume. An example can be see in the Batch/EFS integration test for CDK, starting from line 133: https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-batch/test/integ.batch-with-efs.ts

Other Details

While I discovered it there, I do not think this is not a CDK problem; other users have reported it in other contexts: https://repost.aws/questions/QUNxKFSBgPQQOybinQWYSNdQ/efs-volume-in-batch-job-running-on-fargate

tcutts avatar Aug 08 '22 17:08 tcutts

I confirmed this issue also occurs in the AWS Batch console which is outside of Cloudformation handlers which this project represents.

luisantonioa avatar Aug 18 '22 20:08 luisantonioa

Will track the fix internally since it is not caused by the AWS Batch cloud formation handlers.

luisantonioa avatar Aug 18 '22 21:08 luisantonioa