Aws-cdk: allow to create FargateService with imported TaskDefinition

Created on 8 May 2020  路  2Comments  路  Source: aws/aws-cdk

FargateService requires the TaskDefinition type and using existing task definition is not allowed.

https://github.com/aws/aws-cdk/blob/c304d24d313ef61d8cc6b110df9ba4f3f441d133/packages/%40aws-cdk/aws-ecs/lib/fargate/fargate-service.ts#L17

Use Case

Becasue cloudformation is missing some features such as TaskDefinition with EFS support, we may create our own task definition with CLI or console and allow CDK to create Fargate service by importing the existing task definition.

Proposed Solution

Maybe we can simply use ITaskDefinition instead?

The drawback is we will not be able to check the defaultContainer here.

https://github.com/aws/aws-cdk/blob/c304d24d313ef61d8cc6b110df9ba4f3f441d133/packages/%40aws-cdk/aws-ecs/lib/fargate/fargate-service.ts#L167-L169

Other

  • [ ] :wave: I may be able to implement this feature request
  • [ ] :warning: This feature might incur a breaking change

This is a :rocket: Feature Request

@aws-cdaws-ecs feature-request p1

Most helpful comment

I also need this feature, to be able to define the TaskDefinition externally to support EFS volumes for Fargate.

All 2 comments

I also need this feature, to be able to define the TaskDefinition externally to support EFS volumes for Fargate.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PaulMaddox picture PaulMaddox  路  3Comments

mirazmamun picture mirazmamun  路  3Comments

kawamoto picture kawamoto  路  3Comments

peterdeme picture peterdeme  路  3Comments

artyom-melnikov picture artyom-melnikov  路  3Comments