Interface Ec2MetadataAsyncClient

  • All Superinterfaces:
    AutoCloseable, SdkAutoCloseable
    All Known Implementing Classes:
    DefaultEc2MetadataAsyncClient

    @ThreadSafe
    @Immutable
    public interface Ec2MetadataAsyncClient
    extends SdkAutoCloseable
    Interface to represent the Ec2Metadata Client Class. Used to access instance metadata from a running EC2 instance.

    Instantiate the Ec2MetadataAsyncClient

    Default configuration

    Custom configuration

    Example of a client configured for using IPV6 and a fixed delay for retry attempts :

    Use the client

    Call the get method on the client with a path to an instance metadata:

    Closing the client

    Once all operations are done, you may close the client to free any resources used by it.
    Note: A single client instance should be reused for multiple requests when possible.