HomePhabricator
Diffusion Comm a84aa5c62bc3

[services] Tunnelbroker - Change in `getAwsRegion()` function to use `.

Description

[services] Tunnelbroker - Change in getAwsRegion() function to use .aws/credentials

Summary:
This diff introduces changes to the getAWSRegion() function to parse ~/.aws/credentials for a region parameter to omit using second config ~/.aws/config. The function uses a same approach as a ConfigManager.

The full context is available in ENG-742 task.

Test Plan:
The function returns the region parameter if it's available in the ~/.aws/credentials in the following format:

[default]
...
region = some_region

Or returns an empty string.

Reviewers: karol, varun

Reviewed By: karol, varun

Subscribers: varun, ashoat, tomek, adrian, atul, karol, abosh

Differential Revision: https://phab.comm.dev/D4513

Details