Skip to content

Commit 7ebe561

Browse files
committed
refactor: remove redundant fallback to all regions
- Remove else branch that queries all AWS regions when RegionsInScope is empty - Function now processes empty list when no regions specified - Simplifies logic and prevents unintended region scanning
1 parent 05a3f46 commit 7ebe561

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

data-collection/deploy/module-rds-multitenant.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,7 @@ Resources:
177177
178178
# Get regions in scope from environment variable
179179
regions_in_scope = os.environ.get('REGIONS_IN_SCOPE', '')
180-
if regions_in_scope:
181-
regions = [region.strip() for region in regions_in_scope.split(',') if region.strip()]
182-
else:
183-
# Fallback to all regions if none specified
184-
ec2_client = boto3.client('ec2')
185-
regions = [region['RegionName'] for region in ec2_client.describe_regions()['Regions']]
180+
regions = [region.strip() for region in regions_in_scope.split(',') if region.strip()]
186181
187182
# Create S3 client
188183
s3_client = boto3.client('s3')

0 commit comments

Comments
 (0)