如何获得 AWS ECS First 运行 Experience 的 "Scale ECS Instances" 按钮?

How to get AWS ECS First Run Experience's "Scale ECS Instances" button?

我能够启动 ECS 集群和将 EC2 附加到集群的自动扩展组。

我可以使用启动模板和自动缩放组的 Web 界面启动可以连接到集群的新 EC2。

我无法通过此处提到的 Scale ECS Instances 按钮使用 ECS Web 界面启动新的 EC2 以连接到集群: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scale_cluster.html

当我通过 web 控制台创建 ECS 集群时,Scale ECS Instances 按钮出现了。但是,当我通过 Terraform 创建 ECS 集群时,无法显示 Scale ECS Instances 按钮。

我假设 Web 控制台经历了我无法使用 Terraform 模拟的 first run experiencehttps://aws.amazon.com/blogs/compute/amazon-ecs-console-first-run-troubleshoot-docker-errors/

但我找不到任何文件来证明或反驳我的假设。

是否可以使用 Terraform(或 CloudFormation 或 AWS CLI)让 Scale ESC Instances 按钮显示在 ECS 网络控制台上?

感谢您的宝贵时间:)

该控制台体验正在使用 CloudFormation under the covers,因此当您单击该按钮时,它会修改 CloudFormation 堆栈以向您的 ASG 添加更多所需的实例:

If your cluster was created with the console first-run experience after November 24, 2015, then the Auto Scaling group associated with the AWS CloudFormation stack created for your cluster can be scaled up or down to add or remove container instances. You can perform this scaling operation from within the Amazon ECS console.

要在 Terraform 中进行相同的更改,您应该修改自动缩放组的 min_size or desired_capacity(取决于您是否实际使用缩放策略)并允许其适当缩放。

无论如何,这也是一种更好的方法(即使您使用 CloudFormation 创建 ECS 集群,我也会推荐这种方法)因为这意味着您的所有更改都直接在代码中定义,而不是组合代码和人们在 AWS 控制台中点击。