Class Ec2MetadataConfigProvider
- java.lang.Object
-
- software.amazon.awssdk.imds.internal.Ec2MetadataConfigProvider
-
public final class Ec2MetadataConfigProvider extends Object
Endpoint Provider Class which contains methods for endpoint resolution.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEc2MetadataConfigProvider.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Ec2MetadataConfigProvider.Builderbuilder()static Ec2MetadataConfigProviderinstance()StringresolveEndpoint(EndpointMode endpointMode)Resolve the endpoint to be used for theDefaultEc2MetadataClientclient.EndpointModeresolveEndpointMode()Optional<Profile>resolveProfile()DurationresolveServiceTimeout()Resolve the service timeout value to be used for theDefaultEc2MetadataClient.
-
-
-
Method Detail
-
instance
public static Ec2MetadataConfigProvider instance()
-
resolveEndpoint
public String resolveEndpoint(EndpointMode endpointMode)
Resolve the endpoint to be used for theDefaultEc2MetadataClientclient. Users may manually provide an endpoint through theAWS_EC2_METADATA_SERVICE_ENDPOINTenvironment variable or theec2_metadata_service_endpointkey in their aws config file. If an endpoint is specified is this manner, use it. If no values are provided, the defaults to:- If endpoint mode is set to IPv4:
"http://169.254.169.254" - If endpoint mode is set to IPv6:
"http://[fd00:ec2::254]"
- Parameters:
endpointMode- Used only if an endpoint value is not specified. If so, this method will use the endpointMode to choose the default value to return.- Returns:
- the String representing the endpoint to be used,
- If endpoint mode is set to IPv4:
-
resolveEndpointMode
public EndpointMode resolveEndpointMode()
-
resolveServiceTimeout
public Duration resolveServiceTimeout()
Resolve the service timeout value to be used for theDefaultEc2MetadataClient. Users may provide the timeout value through the `AWS_METADATA_SERVICE_TIMEOUT` environment variable or the `metadata_service_timeout` key in their AWS config file.- Returns:
- the resolved service timeout as a
Duration.
-
builder
public static Ec2MetadataConfigProvider.Builder builder()
-
-