Use Jira Ticket to Reboot Instance Process

.

Before starting with this guide, follow all steps given here

.

  1. Open a filter node, and select the input as data from the Resource Node. We will filter out only the EC2 instances that we've received from the Jira Ticket.
    1. Select Tags as the filter type
    2. Select condition as Has.
    3. Enter $.<CustomNodeID>.data.InstanceTagKey as the Key and $.<CustomNodeID>.data.InstanceTagValue as Value
      1. Eg. Key: $.node-38d67602-custom.data.InstanceTagKey; Value: $.node-38d67602-custom.data.InstanceTagValue
    4. Click Add Condition, and select Param as filter type
      1. Set Key as '$.State..Name', Operator as '==' and Value as 'running'
    5. Click Save

.

  1. Add an Action Node. We will use this to perform the reboot instance action on the filtered nodes.
    1. Choose the output of the filter node from the drop-down
    2. Choose SSM as service, and Send Command as action
    3. In the params editor, paste the following code:
{

/*---------- required params ----------*/

"DocumentName": "AWS-RunShellScript",

/*---------- optional params ----------*/


"InstanceIds": [
"obj.InstanceId"
],
"Targets": [
{
"Key": "VALUE",
"Values": [
"VALUE",
"VALUE"
]
}
],
"DocumentVersion": "VALUE",
"DocumentHash": "VALUE",
"DocumentHashType": "VALUE",
"TimeoutSeconds": [
"VALUE",
"VALUE"
],
"Comment": "<AUTO_GEN_DESC> e.g: Created By TC for sendCommand On DATE", /* Comment can be autogenerated with timestamp */
"Parameters": {
"commands": [
"sudo service httpd restart"
]
},
"OutputS3Region": "VALUE",
"OutputS3BucketName": "VALUE",
"OutputS3KeyPrefix": "VALUE",
"MaxConcurrency": "VALUE",
"MaxErrors": [
"VALUE",
"VALUE"
],
"ServiceRoleArn": "VALUE",
"NotificationConfig": {
"NotificationArn": "VALUE",
"NotificationEvents": [
"VALUE",
"VALUE"
],
"NotificationType": "VALUE"
},
"CloudWatchOutputConfig": {
"CloudWatchLogGroupName": "VALUE",
"CloudWatchOutputEnabled": "VALUE"
}
}

.

Ensure that you have attached the SSM role to the instance on which you want to reboot the process
The Apache Server should be already installed in the instance
Instances that have the tag mentioned in the Jira Ticket will have their process rebooted

Did You Find This Article Helpful?

Use Jira Ticket to Reboot Instance

Use Jira Ticket to Upgrade Instance

Powered by HelpDocs