[英]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.我正在使用带有 typescript 的 CDK 版本 2,我有一个场景,我希望 ECS Fargate Container 中的 TaskID 的值成为另一个命令的一部分。 I am using new ecs.Cluster
and new ecs.FargateTaskDefinition
to create the stack.我正在使用new ecs.Cluster
和new ecs.FargateTaskDefinition
来创建堆栈。 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.这是不可能的,因为任务 ID 不是静态值。 Tasks are launched (often more than one) and stopped, restarted, etc. The task ID changes all the time.任务被启动(通常不止一个)并停止、重新启动等。任务 ID 一直在变化。 You will not be able to get a single task ID from an ECS service in a reasonable way.您将无法以合理的方式从 ECS 服务获取单个任务 ID。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.