Class Ec2MetadataEndpointProvider

java.lang.Object
software.amazon.awssdk.imds.internal.Ec2MetadataEndpointProvider

public final class Ec2MetadataEndpointProvider extends Object
Endpoint Provider Class which contains methods for endpoint resolution.
  • Method Details

    • instance

      public static Ec2MetadataEndpointProvider instance()
    • resolveEndpoint

      public String resolveEndpoint(EndpointMode endpointMode)
      Resolve the endpoint to be used for the DefaultEc2MetadataClient client. Users may manually provide an endpoint through the AWS_EC2_METADATA_SERVICE_ENDPOINT environment variable or the ec2_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:
      1. If endpoint mode is set to IPv4: "http://169.254.169.254"
      2. If endpoint mode is set to IPv6: "http://[fd00:ec2::254]"
      (the default endpoint mode is IPV4).
      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,
    • resolveEndpointMode

      public EndpointMode resolveEndpointMode()
    • resolveProfile

      public Optional<Profile> resolveProfile()
    • builder

      public static Ec2MetadataEndpointProvider.Builder builder()