fix(provisioning): convert ECS TaskDefinition volume sub-configurations PascalCase to camelCase - #825
Merged
Merged
Conversation
…ons PascalCase to camelCase ECSProvider.convertVolumes had sub-property gaps below the handled Volumes property (one level down, so the property-coverage gate could not catch them): DockerVolumeConfiguration and FSxWindowsFileServerVolumeConfiguration were not mapped at all (silently dropped from RegisterTaskDefinition), and Host / EFSVolumeConfiguration were cast through raw so their nested PascalCase keys reached the ECS SDK in the wrong case. This is the same PascalCase-to-camelCase trap already fixed for the ContainerDefinitions sub-arrays. convertVolumes now runs each volume sub-block through a dedicated explicit converter (convertVolumeHost, convertDockerVolumeConfiguration, convertEFSVolumeConfiguration + convertEFSAuthorizationConfig, convertFSxWindowsVolumeConfiguration + convertFSxWindowsAuthorizationConfig), matching the provider's existing per-type converter style. The case mapping is not a simple first-letter flip in two spots (verified against the CDK L1 ToCloudFormation mappings): EFS uses FilesystemId (lowercase s) while FSx uses FileSystemId (capital S), and EFS AuthorizationConfig uses IAM (all caps), not Iam. Autoprovision and TransitEncryptionPort are coerced at the wire boundary since CFn can carry them stringly-typed. readCurrentStateTaskDefinition now normalizes the camelCase SDK volumes shape back to PascalCase via the new volumesToCfn converter so the drift snapshot matches the deploy-time template form (forward-looking; TaskDefinitions are immutable replace-only today). Tests: 8 new unit tests for the RegisterTaskDefinition wire shape of each volume config type (present forwarded camelCase, absent omitted) plus a readCurrentState normalization test; the two pre-existing #806 volume tests were updated for the new omit-when-absent key set and the corrected PascalCase Host.SourcePath input. The ecs-fargate integ fixture gains an EFS FileSystem + AccessPoint and an efsVolumeConfiguration volume on the task definition; verify.sh asserts describe-task-definition shows the efsVolumeConfiguration reached AWS with camelCase fields. EFS is the integ-verified path; DockerVolumeConfiguration / FSx are Windows/Docker-daemon specific and hard to integ on Fargate, so they are unit-tested only. Closes #815
go-to-k
force-pushed
the
fix/815-ecs-volume-subprops
branch
from
June 13, 2026 06:27
a1c51a5 to
8f625d5
Compare
github-actions Bot
pushed a commit
that referenced
this pull request
Jun 13, 2026
## [0.220.5](v0.220.4...v0.220.5) (2026-06-13) ### Bug Fixes * **provisioning:** convert ECS TaskDefinition volume sub-configurations PascalCase to camelCase ([#825](#825)) ([2d54d40](2d54d40))
|
🎉 This PR is included in version 0.220.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ECSProvider.convertVolumeshad sub-property gaps below the handledVolumesproperty (the property-coverage gate can't catch these — they're one level down):DockerVolumeConfiguration/FSxWindowsFileServerVolumeConfigurationwere dropped entirely, andHost/EFSVolumeConfigurationwere cast through WITHOUT PascalCase→camelCase conversion, so their nested keys could reach the SDK in the wrong case (silently dropping the value — the exact class fixed earlier for ContainerDefinitions sub-arrays). Follow-up to #806/#815.Fix
Added per-type converters following the provider's existing explicit-converter style:
convertVolumeHost,convertDockerVolumeConfiguration,convertEFSVolumeConfiguration(+convertEFSAuthorizationConfig),convertFSxWindowsVolumeConfiguration(+auth), and avolumesToCfnSDK→CFn converter forreadCurrentStateTaskDefinition. Load-bearing detail verified against the CDK L1*ToCloudFormationmappings + a real synth: the CFn casings are NOT a uniform first-letter flip — EFS usesFilesystemId(lowercase s) while FSx usesFileSystemId(capital S), and EFSAuthorizationConfigusesIAM(all caps). Stringly-typedAutoprovision(Docker) /TransitEncryptionPort(EFS) are coerced at the wire boundary.Test plan
tests/unit/provisioning/ecs-provider.test.ts+ readback test): assert the exact camelCaseRegisterTaskDefinitionwire shape for each volume-config type (present→forwarded, absent→undefined) + the PascalCase readback round-trip (no drift false-positive); dedicated string-coercion tests forAutoprovision/TransitEncryptionPort.ecs-fargate, extended with anefs.FileSystem+AccessPoint+efsVolumeConfigurationtask-definition volume): deploy + destroy clean — 23 deleted, 0 errors, 0 orphans —verify.shassertsdescribe-task-definitionshowsefs-data'sefsVolumeConfigurationreached AWS with camelCasefileSystemId/transitEncryption: ENABLED/authorizationConfig.{accessPointId, iam: ENABLED}.Scope note
EFS is the integ-verified path.
DockerVolumeConfiguration/FSxWindowsFileServerVolumeConfigurationare Windows/Docker-daemon specific and can't run on Fargate — they are thoroughly unit-tested (wire shape asserted), an accepted scope limit noted in the changelog.Independent review
Code review clean — every converter's output key names verified against the
@aws-sdk/client-ecsVolumeshape (a wrong key would silently re-drop the value, the bug being fixed); 2 harmless nits (Host:{} → {sourcePath:undefined}; required-field casts trust the template).Closes #815