Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
fix(aws): 解决aws国际区账号有代理的时候获取不到区域的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
maguohao2017 committed Aug 13, 2021
1 parent 26bc6d2 commit a727dca
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ public static final JSONArray _getRegions(AccountWithBLOBs account, Proxy proxy,
}
switch (account.getPluginId()) {
case aws:
AWSCredential awsCredential = new Gson().fromJson(account.getCredential(), AWSCredential.class);
AmazonEC2Client client = new AmazonEC2Client(new BasicAWSCredentials(awsCredential.getAccessKey(), awsCredential.getSecretKey()));
AWSRequest awsReq = new AWSRequest();
awsReq.setCredential(account.getCredential());
AmazonEC2Client client = awsReq.getAmazonEC2Client(proxy);
DescribeRegionsResult result;
try {
client.setRegion(RegionUtils.getRegion("cn-north-1"));
Expand Down

0 comments on commit a727dca

Please sign in to comment.