-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create ECS Service with existing task definition ARN #6240
Comments
Since CDK and Cloudformation are lagging behind in the ECS-EFS support, I created a custom resource which creates a TaskDefinition with the new EFS mounts in it. Trying to use this task definition results in above error. Perhaps there should be a separate property taskDefinitionArn to specify an external task definition, to avoid confusion with creating one on the spot. |
this is a show stopper for anyone trying to use EFS with Fargate, if someone is able to provide us with a workaround that would be appreciated. |
For anyone still trying to create a service with a task definition ARN, here's a temporary workaround. It can be done with "Raw Overrides". Documented here: https://docs.aws.amazon.com/cdk/latest/guide/cfn_layer.html You'll need to create a service with a temporary task definition (can be done easily with CDK), and then overwrite that Task Definition with a new Task Definition. Our reasons for using this is similar to @machielg, to mount an EFS volume to a Fargate task, which is not currently supported by CloudFormation. I found this technique in @michaelmoussa's example. So in this case:
Here's a gist showing how to create a Fargate + EFS service currently, adapted from @michaelmoussa's examples. Hope this can help anyone, while the main issue is being fixed. https://gist.github.com/cajames/3daec680b1101c8358e2ff30dfadd52a |
(potential fix update/request for comment) So, I've been working on how to fix this by accepting an Accepting an optional param in Given that, AFAICT we've got the following options:
Or: don't change the type of the (CC @MrArnoldPalmer , @SoManyHs , @pkandasamy91 who have discussed previously) |
@cajames hey
|
Any update on this bug. I can't see why cdk would force you to create a task definition; rather than import an existing one via the class methods available and use that. |
Because I just spent a few hours trying to figure out why using addPropertyOverride didn't work and resulted in strange error messages about invalid parameter types during deployment, maybe this is useful for someone else.
Note: Using addPropertyOverride resulted in both, the old and the new task-definition attached to the service in the cloudformation template for me. |
Closing as duplicate of #7863 |
|
Reproduction Steps
Now our customers cannot create an ECS service using an existing task definition ARN although we have
fromFargateTaskDefinitionARN()
andfromEc2TaskDefinitionARN()
.Related to aws-samples/aws-cdk-examples#112
Error Log
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: