Class InstanceProfileRegionProvider
- java.lang.Object
-
- software.amazon.awssdk.regions.providers.InstanceProfileRegionProvider
-
- All Implemented Interfaces:
AwsRegionProvider
@SdkProtectedApi public final class InstanceProfileRegionProvider extends Object implements AwsRegionProvider
Attempts to load region information from the EC2 Metadata service. If the application is not running on EC2 this provider will throw an exception.If
SdkSystemSetting.AWS_EC2_METADATA_DISABLEDis set to true, it will not try to load region from EC2 metadata service and will return null.If
SdkSystemSetting.AWS_EC2_METADATA_V1_DISABLEDorProfileProperty.EC2_METADATA_V1_DISABLEDis set to true, the region will only be loaded from EC2 metadata service if a token is successfully retrieved - fallback to load region without a token will be disabled.
-
-
Constructor Summary
Constructors Constructor Description InstanceProfileRegionProvider()
-
-
-
Method Detail
-
getRegion
public Region getRegion() throws SdkClientException
Description copied from interface:AwsRegionProviderReturns the region name to use. If region information is not available, throws anSdkClientException.- Specified by:
getRegionin interfaceAwsRegionProvider- Returns:
- Region name to use.
- Throws:
SdkClientException
-
-