aws / aws/aws-cdk

[ecs] EFS Volume configuration is not abstracted

Open
#10,683 9 comments 13 reactions 0 assignees View on GitHub
@aws-cdk/aws-ecs effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

There's kind of a few related points on this bug, but I figured one issue was the way to go instead of multiple. Happy to split it out though if that's better for the team.

The theme here is that EFS volume configuration is *very* raw and not abstracted at all in the L2 constructs for task definitions, and some things are just outright incorrect.

1. Specifying `transitEncryption` requires the string `ENABLED` or `DISABLED` - this should be true/false
2. If you enable an access point it tells you that you must enable `transitEncryption` - if this is a requirement of using an access point then it should be enabled automatically in this case
3. `transitEncryption` is disabled by default - I could be wrong on this, but I do not see any downside to enabling this by default, and it is a more secure option which would be more in-line with the CDK's mission to implement best practices by default
4. `If an access point is specified, the root directory value will be relative to the directory set for the access point. If specified, transit encryption must be enabled in the EFSVolumeConfiguration.` -> If you try to deploy with both an access point and a root directory specified you get an error `Invalid request provided: Create TaskDefinition: When using an EFS access point, the root directory must either be set to "/" or be omitted.`. So at the very least the documentation is wrong, but we should catch this on the CDK side and error during creation if these are mutually exclusive options. I'd also note that the docs for cloudformation state pretty much the exact error that I get back; which is much clearer.
5. Enabling `iam` auth in the `authorizationConfig` block also advises that `transitEncryption` is required - Again, this should make it turn on automatically
6. When specifying an EFS filesystem and access point, you must pass in the IDs themselves, instead of the filesystem/access point objects themselves (e.g. `filesystemId: fs.filesystemId` instead of `filesystem: fs` as you'd expect)

### Reproduction Steps

### What did you expect to happen?

### What actually happened?

### Environment

- **CLI Version :** 1.66
- **Framework Version:** 1.66
- **Node.js Version:**
- **OS :**
- **Language (Version):**

### Other

---

This is :bug: Bug Report

Contributor guide

Open the contributing guide

Research direction

Start at the ECS task-definition L2 constructs and their EFSVolumeConfiguration and authorizationConfig entry points; the payload names no specific files or tests. Compare the exposed configuration with the reported CloudFormation behavior and determine the validation and abstraction boundaries. Done means the listed EFS options are represented, validated, and documented consistently, with coverage for the reported invalid combinations.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.