You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在ECS新UI中编辑自动扩缩容配置?

ECS服务自动扩缩容配置编辑方案(新版UI无入口、旧版切换按钮消失时)
  • 手动跳转旧版控制台页面
    直接修改浏览器地址栏路径:把新版ECS服务页面URL里的 /v2/ 替换成 /,比如原地址是 https://console.aws.amazon.com/ecs/v2/clusters/xxx/services/xxx,修改后为 https://console.aws.amazon.com/ecs/clusters/xxx/services/xxx,回车就能进入旧版UI,找到自动扩缩容的编辑选项。

  • 用AWS CLI命令直接修改
    如果控制台操作走不通,可通过CLI完成配置:
    先更新服务基础配置(示例):

    aws ecs update-service --cluster <你的集群名称> --service <你的服务名称> --desired-count <目标实例数> --capacity-provider-strategy capacityProvider=FARGATE,weight=1,base=0
    

    配置基于指标的自动扩缩容,需结合Application Auto Scaling:
    先注册可扩缩目标:

    aws application-autoscaling register-scalable-target --service-namespace ecs --scalable-dimension ecs:service:DesiredCount --resource-id service/<集群名称>/<服务名称> --min-capacity 1 --max-capacity 10
    

    再添加扩缩容策略(需提前准备scaling-policy.json文件):

    aws application-autoscaling put-scaling-policy --policy-name <自定义策略名> --service-namespace ecs --scalable-dimension ecs:service:DesiredCount --resource-id service/<集群名称>/<服务名称> --policy-type TargetTrackingScaling --target-tracking-scaling-policy-configuration file://scaling-policy.json
    

    scaling-policy.json示例内容(以CPU利用率为指标):

    {
      "TargetValue": 70.0,
      "PredefinedMetricSpecification": {
        "PredefinedMetricType": "ECSServiceAverageCPUUtilization"
      },
      "ScaleOutCooldown": 60,
      "ScaleInCooldown": 60
    }
    
  • 通过Application Auto Scaling页面配置
    直接打开AWS控制台的「Application Auto Scaling」服务,找到对应的ECS服务,在这里可以直接编辑自动扩缩容的目标容量、扩缩容策略等配置,不用依赖ECS旧版UI。

内容的提问来源于stack exchange,提问作者Anh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 23:17:36