Skip to content

Commit eafc11a

Browse files
authored
fix(ecs): get rid of EFS casing warnings (#19681)
About a year ago, ECS TaskDefinition handler changed the casing of some EFS-related properties: * `EfsVolumeConfiguration` -> `EFSVolumeConfiguration` * `FileSystemId` -> `FilesystemId` They continue to accept both casings, but emit a warning when the deprecated casing is used. When the new casing was introduced, we reverted to the old casing in order to not cause resource replacements. However: - The old casings emit warnings; when the service/task creation fails due to unrelated reasons, users see the warnings, interpret them as errors, then stop looking and come and tell us that there is a bug in CDK. - Task definition replacement isn't actually a problem. Task definitions can be replaced for something as trivial as changing CPU count or memory size. Replacing them for a change that is effectively a no-op shouldn't matter. Yes, this will restart `Service`s based on these Task Definitions, but if you are only running 1 copy of the Task you have made the decision not to care about potential downtime of your service. Maintaining the patch does not seem worth the cost/benefit ratio. Reverts #10483, closes #15025. ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent b0834fe commit eafc11a

File tree

6 files changed

+524
-32
lines changed

6 files changed

+524
-32
lines changed

packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ export class TaskDefinition extends TaskDefinitionBase {
509509
scope: spec.dockerVolumeConfiguration.scope,
510510
},
511511
efsVolumeConfiguration: spec.efsVolumeConfiguration && {
512-
fileSystemId: spec.efsVolumeConfiguration.fileSystemId,
512+
filesystemId: spec.efsVolumeConfiguration.fileSystemId,
513513
authorizationConfig: spec.efsVolumeConfiguration.authorizationConfig,
514514
rootDirectory: spec.efsVolumeConfiguration.rootDirectory,
515515
transitEncryption: spec.efsVolumeConfiguration.transitEncryption,

packages/@aws-cdk/aws-ecs/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"devDependencies": {
8282
"@aws-cdk/assertions": "0.0.0",
8383
"@aws-cdk/aws-s3-deployment": "0.0.0",
84+
"@aws-cdk/aws-efs": "0.0.0",
8485
"@aws-cdk/cdk-build-tools": "0.0.0",
8586
"@aws-cdk/cdk-integ-tools": "0.0.0",
8687
"@aws-cdk/cfn2ts": "0.0.0",

packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1154,8 +1154,8 @@ describe('ec2 task definition', () => {
11541154
Family: 'Ec2TaskDef',
11551155
Volumes: [{
11561156
Name: 'scratch',
1157-
EfsVolumeConfiguration: {
1158-
FileSystemId: 'local',
1157+
EFSVolumeConfiguration: {
1158+
FilesystemId: 'local',
11591159
},
11601160
}],
11611161
});

0 commit comments

Comments
 (0)