aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

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

Open
#1,268 2 comments 0 reactions 0 assignees View on GitHub
bug NeedTriage
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### 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

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with an AWS::Batch::JobDefinition using a Fargate compute environment, an EFS volume, and PlatformVersion set to LATEST, then compare it with 1.4.0. Start from the Batch/EFS integration test in packages/@aws-cdk/aws-batch/test/integ.batch-with-efs.ts around line 133; done means LATEST deploys successfully without the EFS platform-version error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.