toil.lib.aws¶
Submodules¶
Attributes¶
Functions¶
Return the AWS region that the currently configured AWS zone (see |
|
Get the AWS zone from TOIL_AWS_ZONE if set. |
|
Get the AWS zone from instance metadata, if on EC2 and the boto module is |
|
Get the AWS zone from the Boto3 config file or from AWS_DEFAULT_REGION, if it is configured and the |
|
Pick an AWS zone in the region defined by TOIL_AWS_REGION, if it is set. |
|
Get the currently configured or occupied AWS zone to use. |
|
|
Get a region (e.g. us-west-2) from a zone (e.g. us-west-1c). |
Return True if we are currently running on EC2, and false otherwise. |
|
Return True if we are currently running on Amazon ECS, and false otherwise. |
|
|
Package Contents¶
- toil.lib.aws.AWSRegionName¶
- toil.lib.aws.AWSServerErrors¶
- toil.lib.aws.logger¶
- toil.lib.aws.get_current_aws_region()¶
Return the AWS region that the currently configured AWS zone (see get_current_aws_zone()) is in.
- Return type:
Optional[str]
- toil.lib.aws.get_aws_zone_from_environment()¶
Get the AWS zone from TOIL_AWS_ZONE if set.
- Return type:
Optional[str]
- toil.lib.aws.get_aws_zone_from_metadata()¶
Get the AWS zone from instance metadata, if on EC2 and the boto module is available. Otherwise, gets the AWS zone from ECS task metadata, if on ECS.
- Return type:
Optional[str]
- toil.lib.aws.get_aws_zone_from_boto()¶
Get the AWS zone from the Boto3 config file or from AWS_DEFAULT_REGION, if it is configured and the boto3 module is available.
- Return type:
Optional[str]
- toil.lib.aws.get_aws_zone_from_environment_region()¶
Pick an AWS zone in the region defined by TOIL_AWS_REGION, if it is set.
- Return type:
Optional[str]
- toil.lib.aws.get_current_aws_zone()¶
Get the currently configured or occupied AWS zone to use.
Reports the TOIL_AWS_ZONE environment variable if set.
Otherwise, if we have boto and are running on EC2, or if we are on ECS, reports the zone we are running in.
Otherwise, if we have the TOIL_AWS_REGION variable set, chooses a zone in that region.
Finally, if we have boto2, and a default region is configured in Boto 2, chooses a zone in that region.
Returns ‘us-east-1a’ if no method can produce a zone to use.
- Return type:
Optional[str]
- toil.lib.aws.zone_to_region(zone)¶
Get a region (e.g. us-west-2) from a zone (e.g. us-west-1c).
- Parameters:
zone (str)
- Return type:
AWSRegionName
- toil.lib.aws.running_on_ec2()¶
Return True if we are currently running on EC2, and false otherwise.
- Return type:
- toil.lib.aws.running_on_ecs()¶
Return True if we are currently running on Amazon ECS, and false otherwise.
- Return type: