简体   繁体   English

ECS集群如何与Terraform中的ECS实例关联?

[英]How to link a ECS Cluster with an ECS instance in Terraform?

I have created a task definition, an ECS Service and an ECS Cluster but I'm facing trouble registering an ECS Instance in Terraform with the ECS Cluster.How to link an ECS Cluster with an ECS Instance using Terraform?我已经创建了一个任务定义、一个 ECS 服务和一个 ECS 集群,但我在向 ECS 集群注册 Terraform 中的 ECS 实例时遇到了问题。如何使用 Terraform 将 ECS 集群与 ECS 实例链接起来?

If you use an ECS Capacity Provider it would manage this for you.如果您使用 ECS Capacity Provider,它将为您管理。

If you are creating the EC2 instances yourself, you need to provide the cluster ID to the ECS agent running on the instance.如果您自己创建 EC2 实例,则需要将集群 ID 提供给实例上运行的 ECS 代理。 When the ECS agent stars up it will then register itself with the cluster.当 ECS 代理启动时,它会在集群中注册自己。 See this answer for the details of configuring the ECS agent on instance launch.有关在实例启动时配置 ECS 代理的详细信息,请参阅此答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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