#NEWLINE# def aws_from_configuration( region , zone , access_key_id , secret_access_key , cluster_id , session_token = None , validate_region = True ) : #NEWLINE# #INDENT# '\n    Build an ``EBSBlockDeviceAPI`` instance using configuration and\n    credentials.\n\n    :param str region: The EC2 region slug.  Volumes will be manipulated in\n        this region.\n    :param str zone: The EC2 availability zone.  Volumes will be manipulated in\n        this zone.\n    :param str access_key_id: The EC2 API key identifier to use to make AWS API\n        calls.\n    :param str secret_access_key: The EC2 API key to use to make AWS API calls.\n    :param UUID cluster_id: The unique identifier of the cluster with which to\n        associate the resulting object.  It will only manipulate volumes\n        belonging to this cluster.\n    :param str session_token: The EC2 session token.\n    :param bool validate_region: If False, do not attempt to validate the\n        region and zone by calling out to AWS. Useful for testing.\n\n    :return: A ``EBSBlockDeviceAPI`` instance using the given parameters.\n    ' #NEWLINE# try : #NEWLINE# #INDENT# return EBSBlockDeviceAPI ( ec2_client = ec2_client ( region = region , zone = zone , access_key_id = access_key_id , secret_access_key = secret_access_key , session_token = session_token , validate_region = validate_region ) , cluster_id = cluster_id ) #NEWLINE# #UNINDENT# except ( InvalidRegionError , InvalidZoneError ) as e : #NEWLINE# #INDENT# raise StorageInitializationError ( StorageInitializationError . CONFIGURATION_ERROR , * e . args )