From 491d25a7b5d8e9a1b865e190440aaca9ecb166d1 Mon Sep 17 00:00:00 2001 From: Tim Reichard Date: Thu, 16 Nov 2023 08:49:30 -0600 Subject: [PATCH] Hard-code 'us-east-1' and 'us-east-2' as regions in SQS AwsServiceManager --- HISTORY.rst | 5 +++++ aioradio/aws/sqs.py | 12 +----------- aioradio/long_running_jobs.py | 1 - setup.py | 2 +- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index c8dbe71..6fbdca7 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,11 @@ History ======= +v0.20.2 (2023-11-16) + +* Hard-code 'us-east-1' and 'us-east-2' as regions in SQS AwsServiceManager. + + v0.20.1 (2023-11-16) * Add sqs.sync_add_regions for setting region besides us-east-1 during instantiation of LongRunningJobs. diff --git a/aioradio/aws/sqs.py b/aioradio/aws/sqs.py index 5446159..92dc4d4 100644 --- a/aioradio/aws/sqs.py +++ b/aioradio/aws/sqs.py @@ -11,7 +11,7 @@ from aioradio.aws.utils import AwsServiceManager LOG = logging.getLogger(__name__) -AWS_SERVICE = AwsServiceManager(service='sqs', regions=['us-east-1']) +AWS_SERVICE = AwsServiceManager(service='sqs', regions=['us-east-1', 'us-east-2']) SQS = AWS_SERVICE.service_dict @@ -25,16 +25,6 @@ async def add_regions(regions: List[str]): AWS_SERVICE.add_regions(regions) -def sync_add_regions(regions: List[str]): - """Add regions to SQS AWS service. - - Args: - regions (List[str]): List of AWS regions - """ - - AWS_SERVICE.add_regions(regions) - - @AWS_SERVICE.active async def create_queue(queue: str, region: str, attributes: Dict[str, str], account_id: str='') -> Dict[str, Any]: """Create SQS queue in region defined. diff --git a/aioradio/long_running_jobs.py b/aioradio/long_running_jobs.py index 185b5c1..6258b9d 100644 --- a/aioradio/long_running_jobs.py +++ b/aioradio/long_running_jobs.py @@ -51,7 +51,6 @@ class LongRunningJobs: # define the queue name and aws region sqs_queue: str = None sqs_region: str = None - sqs.sync_add_regions([sqs_region]) # If running test cases use fakeredis fakeredis: bool = False diff --git a/setup.py b/setup.py index f441d25..9e2f062 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ long_description = fileobj.read() setup(name='aioradio', - version='0.20.1', + version='0.20.2', description='Generic asynchronous i/o python utilities for AWS services (SQS, S3, DynamoDB, Secrets Manager), Redis, MSSQL (pyodbc), JIRA and more', long_description=long_description, long_description_content_type="text/markdown",