Skip to content

Commit

Permalink
Merge pull request #2 from noppoMan/detect-region-from-env
Browse files Browse the repository at this point in the history
detect default region from environment variable
  • Loading branch information
noppoMan authored Jul 4, 2017
2 parents b0d5e62 + 0b929dc commit 90e055a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/AWSSDKSwiftCore/AWSClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ public struct AWSClient {
if let _region = givenRegion {
region = _region
}
else if let partitionEndpoint = partitionEndpoint {
region = Region(rawValue: partitionEndpoint) ?? .useast1
else if let partitionEndpoint = partitionEndpoint, let reg = Region(rawValue: partitionEndpoint) {
region = reg
} else if let defaultRegion = ProcessInfo.processInfo.environment["AWS_DEFAULT_REGION"], let reg = Region(rawValue: defaultRegion) {
region = reg
} else {
region = .useast1
}
Expand Down

0 comments on commit 90e055a

Please sign in to comment.