function attrMiddleware(shim, config, next, context) {
  return async function wrappedMiddleware(args) {
    let region
    try {
      region = await config.region()
    } catch (err) {
      shim.logger.debug(err, 'Failed to get the AWS region')
    }
    const result = await next(args)
    addAwsAttributes({ result, config, region, shim, context })
    return result
  }
}
Wraps the deserialize middleware step to add the
appropriate segment attributes for the AWS command

@param {Shim} shim
@param {Object} config AWS command configuration
@param {function} next next function in middleware chain
@param {Object} context AWS command context
@returns {function}