简体   繁体   中英

Exporting TaskID of ECS Fargate container and use it later point in AWS CDK code

I am using CDK version 2 with typescript, I have a scenario where I want the value of TaskID from ECS Fargate Container to be part of another command. I am using new ecs.Cluster and new ecs.FargateTaskDefinition to create the stack. Can someone tell me how I can export the value to use it later in code.

This is not possible, because a task ID is not a static value. Tasks are launched (often more than one) and stopped, restarted, etc. The task ID changes all the time. You will not be able to get a single task ID from an ECS service in a reasonable way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM