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

通过CloudFormation模板用AWS EventBridge调度DMS任务启动报错求解决

解决EventBridge Scheduler调用DMS任务的CloudFormation报错问题

你在CloudFormation中创建EventBridge Scheduler触发DMS任务时遇到报错:

Invalid request provided: dms is not a supported service for a target. (Service: Scheduler, Status Code: 400,

这是因为直接将DMS任务ARN作为Target的Arn参数不符合EventBridge Scheduler的服务集成要求——控制台会自动转换格式,但CloudFormation需要手动指定AWS服务集成的标准ARN格式。

修正方案:

  1. 修改Target的Arn为服务集成格式:使用arn:aws:scheduler:::aws-sdk:dms:startReplicationTask,这是调用DMSStartReplicationTask API的标准集成ARN。
  2. 添加Input参数:在Target中通过Input指定要启动的DMS任务ARN和启动类型(如start-replication)。
  3. 确保IAM角色权限:确认EventBridge使用的IAM角色拥有dms:StartReplicationTask权限。

修正后的CloudFormation代码:

DMSStartTaskScheduler:
  Type: AWS::Scheduler::Schedule
  Properties: 
    FlexibleTimeWindow: 
      MaximumWindowInMinutes: 300
      Mode: FLEXIBLE
    Name: DMSStartTaskRule-dev
    ScheduleExpression: cron(30 17 * * ? *)
    State: ENABLED
    Target: 
      Arn: "arn:aws:scheduler:::aws-sdk:dms:startReplicationTask"
      RoleArn: !GetAtt EventBridgeIAMrole.Arn
      Input: !Sub |
        {
          "ReplicationTaskArn": "${YourDMSTaskArn}",
          "StartReplicationTaskType": "start-replication"
        }

补充说明:

  • 将YourDMSTaskArn替换为实际的DMS任务ARN(可以用!Ref或!Sub引用栈内的DMS任务资源)。
  • 启动类型可选值包括start-replication、resume-processing、reload-target,根据你的需求选择。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.16 23:27:11