Last active
February 11, 2024 02:39
-
-
Save cyhsutw/97a97da04cd1bb1a458331bf2c5c018d to your computer and use it in GitHub Desktop.
Stop Sidekiq and complete Lifecycle hooks using AWS Systems Manager Automation - https://grass-fed.engineer/2021/10/24/tracing-down-lost-sidekiq-jobs/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description: Gracefully stop sidekiq and complete lifecycle hook action | |
schemaVersion: "0.3" | |
assumeRole: "{{ role }}" | |
parameters: | |
role: | |
description: ARN of the role for execution | |
type: String | |
autoscalingGroupName: | |
type: String | |
instanceId: | |
type: String | |
lifecycleHookName: | |
type: String | |
mainSteps: | |
- inputs: | |
Parameters: | |
executionTimeout: "120" | |
commands: | |
- sudo systemctl stop sidekiq | |
InstanceIds: | |
- "{{ instanceId }}" | |
DocumentName: AWS-RunShellScript | |
name: StopSidekiq | |
action: aws:runCommand | |
- inputs: | |
LifecycleHookName: "{{ lifecycleHookName }}" | |
InstanceId: "{{ instanceId }}" | |
AutoScalingGroupName: "{{ autoscalingGroupName }}" | |
Service: autoscaling | |
Api: CompleteLifecycleAction | |
LifecycleActionResult: CONTINUE | |
name: CompleteTerminationProcess | |
action: aws:executeAwsApi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment