code: def aws_get_instances_by_id(region, instance_id, raw=True):
      
      client = boto3.session.Session().client('ec2', region)
      try:
          matching_reservations = client.describe_instances(InstanceIds=[instance_id]).get('Reservations', [])
      except ClientError as exc:
          if exc.response.get('Error', {}).get('Code') != 'InvalidInstanceID.NotFound':
              raise
          return []
      instances = []
      [[instances.append(_aws_instance_from_dict(region, instance, raw))  # pylint: disable=expression-not-assigned
        for instance in reservation.get('Instances')] for reservation in matching_reservations if reservation]
      return instances
docs: Returns instances mathing an id.