/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.autoscaling.model; import java.io.Serializable; import javax.annotation.Generated; /** *
* The metadata options for the instances. For more information, see Configuring the Instance Metadata Options in the Amazon EC2 Auto Scaling User Guide. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class InstanceMetadataOptions implements Serializable, Cloneable { /** *
* The state of token usage for your instance metadata requests. If the parameter is not specified in the request,
* the default state is optional
.
*
* If the state is optional
, you can choose to retrieve instance metadata with or without a signed
* token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role
* credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0
* role credentials are returned.
*
* If the state is required
, you must send a signed token header with any instance metadata retrieval
* requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the
* version 1.0 credentials are not available.
*
* The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further * instance metadata requests can travel. *
** Default: 1 *
*/ private Integer httpPutResponseHopLimit; /** *
* This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not
* specified, the default state is enabled
.
*
* If you specify a value of disabled
, you will not be able to access your instance metadata.
*
* The state of token usage for your instance metadata requests. If the parameter is not specified in the request,
* the default state is optional
.
*
* If the state is optional
, you can choose to retrieve instance metadata with or without a signed
* token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role
* credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0
* role credentials are returned.
*
* If the state is required
, you must send a signed token header with any instance metadata retrieval
* requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the
* version 1.0 credentials are not available.
*
optional
.
*
* If the state is optional
, you can choose to retrieve instance metadata with or without a
* signed token header on your request. If you retrieve the IAM role credentials without a token, the version
* 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token,
* the version 2.0 role credentials are returned.
*
* If the state is required
, you must send a signed token header with any instance metadata
* retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0
* credentials; the version 1.0 credentials are not available.
* @see InstanceMetadataHttpTokensState
*/
public void setHttpTokens(String httpTokens) {
this.httpTokens = httpTokens;
}
/**
*
* The state of token usage for your instance metadata requests. If the parameter is not specified in the request,
* the default state is optional
.
*
* If the state is optional
, you can choose to retrieve instance metadata with or without a signed
* token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role
* credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0
* role credentials are returned.
*
* If the state is required
, you must send a signed token header with any instance metadata retrieval
* requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the
* version 1.0 credentials are not available.
*
optional
.
*
* If the state is optional
, you can choose to retrieve instance metadata with or without a
* signed token header on your request. If you retrieve the IAM role credentials without a token, the
* version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed
* token, the version 2.0 role credentials are returned.
*
* If the state is required
, you must send a signed token header with any instance metadata
* retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0
* credentials; the version 1.0 credentials are not available.
* @see InstanceMetadataHttpTokensState
*/
public String getHttpTokens() {
return this.httpTokens;
}
/**
*
* The state of token usage for your instance metadata requests. If the parameter is not specified in the request,
* the default state is optional
.
*
* If the state is optional
, you can choose to retrieve instance metadata with or without a signed
* token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role
* credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0
* role credentials are returned.
*
* If the state is required
, you must send a signed token header with any instance metadata retrieval
* requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the
* version 1.0 credentials are not available.
*
optional
.
*
* If the state is optional
, you can choose to retrieve instance metadata with or without a
* signed token header on your request. If you retrieve the IAM role credentials without a token, the version
* 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token,
* the version 2.0 role credentials are returned.
*
* If the state is required
, you must send a signed token header with any instance metadata
* retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0
* credentials; the version 1.0 credentials are not available.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceMetadataHttpTokensState
*/
public InstanceMetadataOptions withHttpTokens(String httpTokens) {
setHttpTokens(httpTokens);
return this;
}
/**
*
* The state of token usage for your instance metadata requests. If the parameter is not specified in the request,
* the default state is optional
.
*
* If the state is optional
, you can choose to retrieve instance metadata with or without a signed
* token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role
* credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0
* role credentials are returned.
*
* If the state is required
, you must send a signed token header with any instance metadata retrieval
* requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the
* version 1.0 credentials are not available.
*
optional
.
*
* If the state is optional
, you can choose to retrieve instance metadata with or without a
* signed token header on your request. If you retrieve the IAM role credentials without a token, the version
* 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token,
* the version 2.0 role credentials are returned.
*
* If the state is required
, you must send a signed token header with any instance metadata
* retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0
* credentials; the version 1.0 credentials are not available.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceMetadataHttpTokensState
*/
public InstanceMetadataOptions withHttpTokens(InstanceMetadataHttpTokensState httpTokens) {
this.httpTokens = httpTokens.toString();
return this;
}
/**
*
* The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further * instance metadata requests can travel. *
** Default: 1 *
* * @param httpPutResponseHopLimit * The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further * instance metadata requests can travel. ** Default: 1 */ public void setHttpPutResponseHopLimit(Integer httpPutResponseHopLimit) { this.httpPutResponseHopLimit = httpPutResponseHopLimit; } /** *
* The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further * instance metadata requests can travel. *
** Default: 1 *
* * @return The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the * further instance metadata requests can travel. ** Default: 1 */ public Integer getHttpPutResponseHopLimit() { return this.httpPutResponseHopLimit; } /** *
* The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further * instance metadata requests can travel. *
** Default: 1 *
* * @param httpPutResponseHopLimit * The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further * instance metadata requests can travel. ** Default: 1 * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceMetadataOptions withHttpPutResponseHopLimit(Integer httpPutResponseHopLimit) { setHttpPutResponseHopLimit(httpPutResponseHopLimit); return this; } /** *
* This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not
* specified, the default state is enabled
.
*
* If you specify a value of disabled
, you will not be able to access your instance metadata.
*
enabled
.
* If you specify a value of disabled
, you will not be able to access your instance metadata.
*
* This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not
* specified, the default state is enabled
.
*
* If you specify a value of disabled
, you will not be able to access your instance metadata.
*
enabled
.
* If you specify a value of disabled
, you will not be able to access your instance metadata.
*
* This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not
* specified, the default state is enabled
.
*
* If you specify a value of disabled
, you will not be able to access your instance metadata.
*
enabled
.
* If you specify a value of disabled
, you will not be able to access your instance metadata.
*
* This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not
* specified, the default state is enabled
.
*
* If you specify a value of disabled
, you will not be able to access your instance metadata.
*
enabled
.
* If you specify a value of disabled
, you will not be able to access your instance metadata.
*