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
相关产品推荐
相关产品推荐

