Skip to content

Commit e37062f

Browse files
authored
[AWS] Add regions requested by the user (skypilot-org#1498)
* enable regions requested by user * fix * fix * Fix comment * Use inner join
1 parent 37f5473 commit e37062f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

sky/clouds/service_catalog/aws_catalog.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ def _apply_az_mapping(df: 'pd.DataFrame') -> 'pd.DataFrame':
5252
az_mappings.to_csv(az_mapping_path, index=False)
5353
else:
5454
az_mappings = pd.read_csv(az_mapping_path)
55-
df = df.merge(az_mappings, on=['AvailabilityZone'], how='left')
55+
# Use inner join to drop rows with unknown AZ IDs, which are likely
56+
# because the user does not have access to that Region. Otherwise,
57+
# there will be rows with NaN in the AvailabilityZone column.
58+
df = df.merge(az_mappings, on=['AvailabilityZone'], how='inner')
5659
df = df.drop(columns=['AvailabilityZone']).rename(
5760
columns={'AvailabilityZoneName': 'AvailabilityZone'})
5861
return df

sky/clouds/service_catalog/data_fetchers/fetch_aws.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
# 'me-south-1',
3232
# 'me-central-1',
3333
# 'af-south-1',
34-
# 'af-south-2',
35-
# 'ap-east-1',
34+
'ap-east-1', # enable this non-default region due to user request
3635
# 'ap-southeast-3',
3736
'ap-south-1',
37+
# 'ap-south-2',
3838
'ap-northeast-3',
3939
'ap-northeast-2',
4040
'ap-southeast-1',

0 commit comments

Comments
 (0)