A simple package for retrieving a list of AWS regions.
Project description
Overview
This module provides a simple method for retrieving and processing AWS region information. This is a core component for all of the tools in our AWS Toolbox.
Features
-
Fetching AWS Regions:
- Retrieve a list of all AWS regions, optionally including/excluding regions based on account opt-in status.
- Supports fetching detailed information about each region.
-
Region Details:
- Fetch geographical location descriptions for specific AWS regions from the AWS Systems Manager (SSM) Parameter Store.
- Utilizes concurrent threading for enhanced performance when fetching multiple region details.
-
Filtering:
- Apply include and exclude filters to customize the list of AWS regions returned.
Functions
Public Functions
- get_region_list
- Retrieves a list of AWS regions.
- Parameters:
include_list
: Optional list of regions to include.exclude_list
: Optional list of regions to exclude.all_regions
: Boolean flag to include all regions (default: True).details
: Boolean flag to return detailed information about each region (default: False).profile_name
: String to specify the name of the profile to use.
- Returns:
- If
details=True
: Sorted list of dictionaries containing detailed region information. - If
details=False
: Sorted list of region names as strings.
- If
- Raises:
RegionListingError
: If an error occurs during region retrieval or processing.
Usage
This module is designed to be used as part of the wolfsoftware.get-aws-regions
package. The primary function, get_region_list
, allows flexible retrieval and customization of AWS region information based on user-defined criteria.
Example
from wolfsoftware.get_aws_regions import get_region_list
# Example usage: Retrieve all regions and print their names
regions = get_region_list(details=False)
print("AWS Regions:", regions)
# Example usage: Retrieve detailed information for selected regions
detailed_regions = get_region_list(include_list=['us-west-1', 'us-east-1'], details=True)
for region in detailed_regions:
print(f"Region: {region['RegionName']}, Location: {region['GeographicalLocation']}")
Notes
- Ensure AWS credentials are properly configured for API access.
- Error handling is integrated to manage exceptions during AWS operations.
- Threading is utilized for efficient concurrent operations when fetching region details.
For further details and customization options, refer to the function docstrings and the module's implementation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file wolfsoftware_get_aws_regions-0.1.2.tar.gz
.
File metadata
- Download URL: wolfsoftware_get_aws_regions-0.1.2.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e274f9a6d8b31c2c89d8ca0f830ad587412f825e9e7930de3911ce492c32e97 |
|
MD5 | 5011a273dbe7b0dec0892cb7609e4c40 |
|
BLAKE2b-256 | 4f7d7ad002f4853b642facb2e042516811a2ad96f12fefd96f0c1a6de8250f78 |
File details
Details for the file wolfsoftware.get_aws_regions-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: wolfsoftware.get_aws_regions-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd9ad950fa8fd29953f4123f8e4d16d689cba0a5622eafa9062ca101838625d5 |
|
MD5 | f5014b5cc0f1235cddae6b95062c1b58 |
|
BLAKE2b-256 | cbf4666d8af74f3d4fa194a3592990c9e450a6c42a927c6e2f12370e4a858de9 |