[{"data":1,"prerenderedAt":31},["ShallowReactive",2],{"snippet-eventbridge-retry-policy":3},{"id":4,"title":5,"contributors":6,"description":8,"extension":9,"gitHub":10,"introBox":13,"languages":17,"meta":19,"resources":20,"services":21,"snippets":24,"stem":28,"tags":29,"type":18,"__hash__":30},"snippets\u002Fsnippets\u002Feventbridge-retry-policy.json","Create EventBridge Rule with Retry Policy Using AWS CLI",[7],"content\u002Fcontributors\u002Farchana-v.json","Use AWS CLI to create Amazon EventBridge Rules with schedule expressions and configure retry policies (MaximumRetryAttempts & MaximumEventAgeInSeconds) targeting AWS Lambda","json",{"template":11},{"repoURL":12},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-snippets\u002Ftree\u002Fmain\u002Feventbridge-retry-policy",{"headline":14,"text":15},"How it works",[16],"This snippet demonstrates how to create Amazon EventBridge scheduled rules with retry policies using the AWS CLI, leveraging `aws events put-rule` to create a scheduled rule and `aws events put-targets` to attach a Lambda target with a configured retry policy that controls MaximumRetryAttempts (0-185) and MaximumEventAgeInSeconds (60-86400) to handle failed invocations.",[18],"AWS CLI",{},null,[22,23],"eventbridge","lambda-event-functions",[25],{"title":26,"language":18,"code":27},"Copy the commands on your CLI and replace the LAMBDA_ARN. Modidy the schedule expressions and retry policy values as desired","aws events put-rule \\\n  --name \"retry-rule-test\" \\\n  --schedule-expression \"rate(5 minutes)\" \\\n  --state ENABLED \\\n  --description \"Runs every 5 minutes with retry policy\" \\\n&& \\\naws events put-targets \\\n  --rule \"retry-rule-test\" \\\n  --event-bus-name \"default\" \\\n  --targets \"$(cat &#60;&#60;EOF\n[\n  {\n    \"Id\": \"my-target-id\",\n    \"Arn\": \"&#60;LAMBDA_ARN&#62;\",\n    \"RetryPolicy\": {\n      \"MaximumRetryAttempts\": 3,\n      \"MaximumEventAgeInSeconds\": 3600\n    }\n  }\n]\nEOF\n)\"","snippets\u002Feventbridge-retry-policy",[],"0OEdjq4DxqaYhyhFa7nXiw0Pjo2RzsrohPVIFw0D4po",1792578864281]