How to assign a physical name to the ECS fargate task definition using AWS CDK?

Viewed 535

I'm creating a fargate task definition like this:

aws_ecs.FargateTaskDefinition(self, 'sample-task',task_role=ecs-role,cpu=1024,memory_limit_mib=4096)

How do I assign this task definition a physical name instead of using the generated name? For example, when creating a S3 bucket we can using the bucket_name property, is there something similar for the fargate task definition?

1 Answers

family parameter fixed the problem for me. For example:

aws_ecs.FargateTaskDefinition(self, 'sample-task',task_role=ecs-role,cpu=1024,memory_limit_mib=4096, family="sample-task")
Related