  def __init__(self,
               default_availability_zone: str,
               aws_profile: Optional[str] = None,
               aws_access_key_id: Optional[str] = None,
               aws_secret_access_key: Optional[str] = None,
               aws_session_token: Optional[str] = None) -> None:
    """Initialize the AWS account.

    Args:
      default_availability_zone (str): Default zone within the region to create
          new resources in.
      aws_profile (str): Optional. The AWS profile defined in the AWS
          credentials file to use.
      aws_access_key_id (str): Optional. If provided together with
          aws_secret_access_key and aws_session_token, authenticate to AWS
          using these parameters instead of the credential file.
      aws_secret_access_key (str): Optional. If provided together with
          aws_access_key_id and aws_session_token, authenticate to AWS
          using these parameters instead of the credential file.
      aws_session_token (str): Optional. If provided together with
          aws_access_key_id and aws_secret_access_key, authenticate to AWS
          using these parameters instead of the credential file.
    """

    self.default_availability_zone = default_availability_zone
    # The region is given by the zone minus the last letter
    # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#using-regions-availability-zones-describe # pylint: disable=line-too-long
    self.default_region = self.default_availability_zone[:-1]

    if aws_access_key_id and aws_secret_access_key and aws_session_token:
      self.session = boto3.session.Session(
          aws_access_key_id=aws_access_key_id,
          aws_secret_access_key=aws_secret_access_key,
          aws_session_token=aws_session_token)
    elif aws_profile:
      self.aws_profile = aws_profile
      self.session = boto3.session.Session(profile_name=self.aws_profile)
    else:
      self.session = boto3.session.Session()

    self._ec2 = None  # type: Optional[ec2.EC2]
    self._ebs = None  # type: Optional[ebs.EBS]
    self._kms = None  # type: Optional[kms.KMS]
    self._s3 = None  # type: Optional[s3.S3]
    self._iam = None # type: Optional[iam.IAM]
Initialize the AWS account.

Args:
default_availability_zone (str): Default zone within the region to create
new resources in.
aws_profile (str): Optional. The AWS profile defined in the AWS
credentials file to use.
aws_access_key_id (str): Optional. If provided together with
aws_secret_access_key and aws_session_token, authenticate to AWS
using these parameters instead of the credential file.
aws_secret_access_key (str): Optional. If provided together with
aws_access_key_id and aws_session_token, authenticate to AWS
using these parameters instead of the credential file.
aws_session_token (str): Optional. If provided together with
aws_access_key_id and aws_secret_access_key, authenticate to AWS
using these parameters instead of the credential file.
libcloudforensics/providers/aws/internal/account.py