Interface Ec2MetadataClientBuilder<B,T>

Type Parameters:
B - the Builder Type
T - the Ec2MetadataClient Type
All Superinterfaces:
Buildable, SdkBuilder<Ec2MetadataClientBuilder<B,T>,T>
All Known Subinterfaces:
Ec2MetadataAsyncClient.Builder, Ec2MetadataClient.Builder

public interface Ec2MetadataClientBuilder<B,T> extends SdkBuilder<Ec2MetadataClientBuilder<B,T>,T>
Base shared builder interface for Ec2MetadataClients, sync and async.
  • Method Details

    • retryPolicy

      B retryPolicy(Ec2MetadataRetryPolicy retryPolicy)
      Define the retry policy which includes the number of retry attempts for any failed request.

      If not specified, defaults to 3 retry attempts and a BackoffStrategy.defaultStrategy() backoff strategy} that uses RetryMode.STANDARD. Can be also specified by using the retryPolicy(Consumer) method. if any of the retryPolicy methods are called multiple times, only the last invocation will be considered.

      Parameters:
      retryPolicy - The retry policy which includes the number of retry attempts for any failed request.
      Returns:
      a reference to this builder
    • retryPolicy

      B retryPolicy(Consumer<Ec2MetadataRetryPolicy.Builder> builderConsumer)
      Define the retry policy which includes the number of retry attempts for any failed request. Can be used instead of retryPolicy(Ec2MetadataRetryPolicy) to use a "fluent consumer" syntax. User should not manually build the builder in the consumer.

      If not specified, defaults to 3 retry attempts and a BackoffStrategy.defaultStrategy() backoff strategy} that uses RetryMode.STANDARD. Can be also specified by using the retryPolicy(Ec2MetadataRetryPolicy) method. if any of the retryPolicy methods are called multiple times, only the last invocation will be considered.

      Parameters:
      builderConsumer - the consumer
      Returns:
      a reference to this builder
    • endpoint

      B endpoint(URI endpoint)
      Define the endpoint of IMDS.

      If not specified, the IMDS client will attempt to automatically resolve the endpoint value based on the logic of Ec2MetadataEndpointProvider.

      Parameters:
      endpoint - The endpoint of IMDS.
      Returns:
      a reference to this builder
    • tokenTtl

      B tokenTtl(Duration tokenTtl)
      Define the Time to live (TTL) of the token. The token represents a logical session. The TTL specifies the length of time that the token is valid and, therefore, the duration of the session. Defaults to 21,600 seconds (6 hours) if not specified.
      Parameters:
      tokenTtl - The Time to live (TTL) of the token.
      Returns:
      a reference to this builder
    • endpointMode

      B endpointMode(EndpointMode endpointMode)
      Define the endpoint mode of IMDS. Supported values include IPv4 and IPv6. Used to determine the endpoint of the IMDS Client only if endpoint(URI) is not specified. Only one of both endpoint or endpoint mode but not both. If both are specified in the Builder, a IllegalArgumentException will be thrown.

      If not specified, the IMDS client will attempt to automatically resolve the endpoint mode value based on the logic of Ec2MetadataEndpointProvider.

      Parameters:
      endpointMode - The endpoint mode of IMDS. Supported values include IPv4 and IPv6.
      Returns:
      a reference to this builder