Class Ec2MetadataConfigProvider
java.lang.Object
software.amazon.awssdk.imds.internal.Ec2MetadataConfigProvider
Endpoint Provider Class which contains methods for endpoint resolution.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
static Ec2MetadataConfigProvider
instance()
resolveEndpoint
(EndpointMode endpointMode) Resolve the endpoint to be used for theDefaultEc2MetadataClient
client.Resolve the service timeout value to be used for theDefaultEc2MetadataClient
.
-
Method Details
-
instance
-
resolveEndpoint
Resolve the endpoint to be used for theDefaultEc2MetadataClient
client. Users may manually provide an endpoint through theAWS_EC2_METADATA_SERVICE_ENDPOINT
environment variable or theec2_metadata_service_endpoint
key 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
-
resolveProfile
-
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
-