Skip to content

Commit

Permalink
fix: Use env AWS_REGION in sqs_client or default to us-west-2 (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolastomeo committed Jul 11, 2024
1 parent c0cea60 commit b5e4daf
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def excluded_namespaces():

autoscaler_broker = os.environ.get("BROKER_NAME", SQS_BROKER)
aws_profile = os.environ.get("AWS_PROFILE")
aws_region = os.environ.get("AWS_REGION", "us-west-2")


@dataclasses.dataclass
Expand Down Expand Up @@ -403,7 +404,7 @@ async def get_broker_metrics(
class SQSBroker(AutoscalerBroker):
@staticmethod
def _get_sqs_queue_size(queue_name: str):
sqs_client = session(aws_profile).client("sqs", region_name="us-west-2")
sqs_client = session(aws_profile).client("sqs", region_name=aws_region)
try:
total_start_time = time.time()
queue_size_hist = []
Expand Down

0 comments on commit b5e4daf

Please sign in to comment.