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

EventBridge Scheduler调用Fargate类型ECS RunTask触发平台版本错误求助

问题解决:EventBridge Scheduler调用ECS RunTask时Fargate启动类型未正确传递

问题背景

调用ECS RunTask时已配置启动类型为FARGATE、平台版本1.4.0,但CloudTrail显示仅platformVersion被传入requestParameters,触发错误:

"The platform version must be null when specifying an EC2 launch type."

这说明请求实际默认使用了EC2启动类型,Fargate的配置参数未被正确传递。

解决步骤

  1. 绕过可视化配置,手动编写请求JSON
    EventBridge Scheduler的可视化计算选项界面可能存在参数传递异常,改用常量输入模式配置完整的RunTask参数:
    • 在Scheduler的目标配置中,选择「输入常量」
    • 传入包含launchType和platformVersion的完整JSON请求(需替换为你的集群、任务定义和网络配置):
      {
        "cluster": "your-cluster-name",
        "taskDefinition": "arn:aws:ecs:region:account-id:task-definition/your-task-def:revision",
        "launchType": "FARGATE",
        "platformVersion": "1.4.0",
        "networkConfiguration": {
          "awsvpcConfiguration": {
            "subnets": ["subnet-xxxxxx", "subnet-yyyyyy"],
            "assignPublicIp": "ENABLED"
          }
        }
      }
      
  2. 确认任务定义兼容性
    确保你的ECS任务定义使用awsvpc网络模式(Fargate强制要求),且任务资源配置符合Fargate的规格限制。
  3. 验证请求参数
    执行任务后查看CloudTrail日志,确认requestParameters中同时包含launchType: "FARGATE"和platformVersion: "1.4.0",即可排除错误。

内容的提问来源于stack exchange,提问作者omer-bental

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.12 07:40:31