  def ResourceApi(self,
                  service: str,
                  # The return type doesn't exist until Runtime, therefore we
                  # need to ignore the type hint
                  # pylint: disable=line-too-long
                  region: Optional[str] = None) -> 'boto3.resources.factory.ec2.ServiceResource':  # type: ignore
                  # pylint: enable=line-too-long
    """Create an AWS resource object.

    Args:
      service (str): The AWS service to use.
      region (str): Optional. The region in which to create new resources. If
          none provided, the default_region associated to the AWSAccount
          object will be used.

    Returns:
      boto3.resources.factory.ec2.ServiceResource: An AWS EC2 resource object.
    """

    if region:
      return self.session.resource(service_name=service, region_name=region)
    return self.session.resource(
        service_name=service, region_name=self.default_region)
Create an AWS resource object.

Args:
service (str): The AWS service to use.
region (str): Optional. The region in which to create new resources. If
none provided, the default_region associated to the AWSAccount
object will be used.

Returns:
boto3.resources.factory.ec2.ServiceResource: An AWS EC2 resource object.
libcloudforensics/providers/aws/internal/account.py