public final class AwsCurrentRegionHolder extends Object
Regions.getCurrentRegion() since accessing EC2 instance
metadata repeatedly can result in being throttled and prevent other metadata accessing operations
such as refreshing instance credentials from working normally| Modifier and Type | Method and Description |
|---|---|
static com.amazonaws.regions.Region |
getCurrentRegionFromEC2Metadata()
Attempts to resolve the current region from EC2's instance metadata through
Regions.getCurrentRegion(). |
public static com.amazonaws.regions.Region getCurrentRegionFromEC2Metadata()
throws IllegalStateException
Regions.getCurrentRegion(). If
no region is able to be resolved an exception is thrownIllegalStateExceptionCopyright © 2012–2020. All rights reserved.