When receiving a status message to shut down, there is a chance that the server already went away. Handle this error so the SQS message doesn't get orphaned in the queue
{
"errorType": "InvalidInstanceID.NotFound",
"errorMessage": "The instance ID 'i-02efaf72701c6fdc0' does not exist",
"code": "InvalidInstanceID.NotFound",
"message": "The instance ID 'i-02efaf72701c6fdc0' does not exist",
"time": "2020-06-24T18:04:37.659Z",
"requestId": "6ce58048-4cdf-4920-9c3b-c4e0bfe95630",
"statusCode": 400,
"retryable": false,
"retryDelay": 14.920836456888553,
"stack": [
"InvalidInstanceID.NotFound: The instance ID 'i-02efaf72701c6fdc0' does not exist",
" at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/services/ec2.js:50:35)",
" at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)",
" at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)",
" at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:683:14)",
" at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)",
" at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)",
" at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10",
" at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)",
" at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:685:12)",
" at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:116:18)"
]
}
When receiving a status message to shut down, there is a chance that the server already went away. Handle this error so the SQS message doesn't get orphaned in the queue