Repository navigation
Commit 855dfeb
authored
fix(ecs): allow ephemeralStorageGiB for Windows Fargate platform version 1.0.0 (#37589)
### Issue # (if applicable)
Closes #37510.
### Reason for this change
`FargateService` currently throws `EphemeralStorageGibFeatureRequires` when `ephemeralStorageGiB` is set and the Fargate platform version is < 1.4.0.
This validation is correct for Linux tasks, but incorrect for Windows tasks: according to the ECS documentation, Windows Fargate supports task ephemeral storage starting with platform version 1.0.0.
### Description of changes
- Added a public getter for `TaskDefinition.runtimePlatform` so `FargateService` can determine the task operating system family.
- Updated `FargateService` validation to only require platform version >= 1.4.0 for `ephemeralStorageGiB` on non-Windows (Linux) tasks.
- Updated the `ephemeralStorageGiB` documentation to reflect the different minimum platform versions for Linux vs. Windows tasks.
- Added a unit test verifying that setting `ephemeralStorageGiB` on a Windows Fargate task definition with platform version 1.0.0 does not fail during synth.
Alternatives considered:
- Removing the validation entirely (rejected: Linux requires 1.4.0+).
- Introducing a separate public API just for the OS family (rejected: `runtimePlatform` already models the required information).
### Describe any new or updated permissions being added
None.
### Description of how you validated changes
- Added a unit test in `packages/aws-cdk-lib/aws-ecs/test/fargate/fargate-service.test.ts` that synthesizes a Windows Fargate service using `platformVersion: VERSION1_0` and `ephemeralStorageGiB`.
- Existing unit test coverage for the Linux restriction (platform version < 1.4.0) remains unchanged.
### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*1 parent 1083ba5 commit 855dfeb
18 files changed
Lines changed: 2185 additions & 10 deletions
File tree
- packages
- @aws-cdk-testing/framework-integ/test/aws-ecs/test/fargate
- integ.fargate-windows-ephemeral-storage.js.snapshot
- asset.bea78ce725e22a5e0d82378f6b49028c09ba86499286d6945a0506e820854e92
- aws-cdk-lib/aws-ecs
- lib
- base
- fargate
- test/fargate
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments