Class InstanceMetadataOptionsRequest

    • Method Detail

      • httpTokens

        public final HttpTokensState httpTokens()

        Indicates whether IMDSv2 is required.

        • optional - IMDSv2 is optional, which means that you can use either IMDSv2 or IMDSv1.

        • required - IMDSv2 is required, which means that IMDSv1 is disabled, and you must use IMDSv2.

        Default:

        • If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0 and the account level default is set to no-preference, the default is required.

        • If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0, but the account level default is set to V1 or V2, the default is optional.

        The default value can also be affected by other combinations of parameters. For more information, see Order of precedence for instance metadata options in the Amazon EC2 User Guide.

        If the service returns an enum value that is not available in the current SDK version, httpTokens will return HttpTokensState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from httpTokensAsString().

        Returns:
        Indicates whether IMDSv2 is required.

        • optional - IMDSv2 is optional, which means that you can use either IMDSv2 or IMDSv1.

        • required - IMDSv2 is required, which means that IMDSv1 is disabled, and you must use IMDSv2.

        Default:

        • If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0 and the account level default is set to no-preference, the default is required.

        • If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0, but the account level default is set to V1 or V2, the default is optional.

        The default value can also be affected by other combinations of parameters. For more information, see Order of precedence for instance metadata options in the Amazon EC2 User Guide.

        See Also:
        HttpTokensState
      • httpTokensAsString

        public final String httpTokensAsString()

        Indicates whether IMDSv2 is required.

        • optional - IMDSv2 is optional, which means that you can use either IMDSv2 or IMDSv1.

        • required - IMDSv2 is required, which means that IMDSv1 is disabled, and you must use IMDSv2.

        Default:

        • If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0 and the account level default is set to no-preference, the default is required.

        • If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0, but the account level default is set to V1 or V2, the default is optional.

        The default value can also be affected by other combinations of parameters. For more information, see Order of precedence for instance metadata options in the Amazon EC2 User Guide.

        If the service returns an enum value that is not available in the current SDK version, httpTokens will return HttpTokensState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from httpTokensAsString().

        Returns:
        Indicates whether IMDSv2 is required.

        • optional - IMDSv2 is optional, which means that you can use either IMDSv2 or IMDSv1.

        • required - IMDSv2 is required, which means that IMDSv1 is disabled, and you must use IMDSv2.

        Default:

        • If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0 and the account level default is set to no-preference, the default is required.

        • If the value of ImdsSupport for the Amazon Machine Image (AMI) for your instance is v2.0, but the account level default is set to V1 or V2, the default is optional.

        The default value can also be affected by other combinations of parameters. For more information, see Order of precedence for instance metadata options in the Amazon EC2 User Guide.

        See Also:
        HttpTokensState
      • httpPutResponseHopLimit

        public final Integer httpPutResponseHopLimit()

        The maximum number of hops that the metadata token can travel.

        Possible values: Integers from 1 to 64

        Returns:
        The maximum number of hops that the metadata token can travel.

        Possible values: Integers from 1 to 64

      • httpEndpointAsString

        public final String httpEndpointAsString()

        Enables or disables the HTTP metadata endpoint on your instances.

        If you specify a value of disabled, you cannot access your instance metadata.

        Default: enabled

        If the service returns an enum value that is not available in the current SDK version, httpEndpoint will return InstanceMetadataEndpointState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from httpEndpointAsString().

        Returns:
        Enables or disables the HTTP metadata endpoint on your instances.

        If you specify a value of disabled, you cannot access your instance metadata.

        Default: enabled

        See Also:
        InstanceMetadataEndpointState
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public final String toString()
        Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
        Overrides:
        toString in class Object
      • getValueForField

        public final <T> Optional<T> getValueForField​(String fieldName,
                                                      Class<T> clazz)