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

CloudFormation中EventBridge Scheduler重试策略部署报错求助

解决CloudFormation中EventBridge Scheduler重试策略配置报错问题

问题原因

你遇到的报错是因为RetryPolicy并不是AWS::Scheduler::Schedule顶层Properties的直接属性,它属于Target配置块的子属性,直接放在顶层会被CloudFormation判定为非法键。

正确配置方式

需要将RetryPolicy嵌套到Target的配置内部,示例模板如下:

SchedulerSchedule:
  Type: AWS::Scheduler::Schedule
  Properties:
    ScheduleExpression: 'cron(0 1 * * ? *)' # 示例调度表达式
    Target:
      Arn: 'arn:aws:lambda:us-east-1:123456789012:function:YourLambdaFunction' # 替换为你的目标ARN
      RoleArn: 'arn:aws:iam::123456789012:role/YourSchedulerExecutionRole' # 替换为你的执行角色ARN
      RetryPolicy:
        MaximumEventAgeInSeconds: 3600
        MaximumRetryAttempts: 3
    # 其他顶层配置属性...

验证要点

  • 确认RetryPolicy严格位于Target块内部,而非Schedule的Properties根层级
  • 检查参数取值是否符合要求:
    • MaximumEventAgeInSeconds取值范围为1-86400(24小时)
    • MaximumRetryAttempts取值范围为0-185

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.27 07:02:01