Class: AWSCDK::EC2::CfnInstance::MetadataOptionsProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::CfnInstance::MetadataOptionsProperty
- Defined in:
- ec2/cfn_instance.rb
Overview
Specifies the metadata options for the instance.
Instance Attribute Summary collapse
-
#http_endpoint ⇒ String?
readonly
Enables or disables the HTTP metadata endpoint on your instances.
-
#http_protocol_ipv6 ⇒ String?
readonly
Enables or disables the IPv6 endpoint for the instance metadata service.
-
#http_put_response_hop_limit ⇒ Numeric?
readonly
The maximum number of hops that the metadata token can travel.
-
#http_tokens ⇒ String?
readonly
Indicates whether IMDSv2 is required.
-
#instance_metadata_tags ⇒ String?
readonly
Set to
enabledto allow access to instance tags from the instance metadata.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(http_endpoint: nil, http_protocol_ipv6: nil, http_put_response_hop_limit: nil, http_tokens: nil, instance_metadata_tags: nil) ⇒ MetadataOptionsProperty
constructor
A new instance of MetadataOptionsProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(http_endpoint: nil, http_protocol_ipv6: nil, http_put_response_hop_limit: nil, http_tokens: nil, instance_metadata_tags: nil) ⇒ MetadataOptionsProperty
Returns a new instance of MetadataOptionsProperty.
1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 |
# File 'ec2/cfn_instance.rb', line 1884 def initialize(http_endpoint: nil, http_protocol_ipv6: nil, http_put_response_hop_limit: nil, http_tokens: nil, instance_metadata_tags: nil) @http_endpoint = http_endpoint Jsii::Type.check_type(@http_endpoint, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "httpEndpoint") unless @http_endpoint.nil? @http_protocol_ipv6 = http_protocol_ipv6 Jsii::Type.check_type(@http_protocol_ipv6, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "httpProtocolIpv6") unless @http_protocol_ipv6.nil? @http_put_response_hop_limit = http_put_response_hop_limit Jsii::Type.check_type(@http_put_response_hop_limit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "httpPutResponseHopLimit") unless @http_put_response_hop_limit.nil? @http_tokens = http_tokens Jsii::Type.check_type(@http_tokens, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "httpTokens") unless @http_tokens.nil? @instance_metadata_tags = Jsii::Type.check_type(@instance_metadata_tags, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "instanceMetadataTags") unless @instance_metadata_tags.nil? end |
Instance Attribute Details
#http_endpoint ⇒ String? (readonly)
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
1905 1906 1907 |
# File 'ec2/cfn_instance.rb', line 1905 def http_endpoint @http_endpoint end |
#http_protocol_ipv6 ⇒ String? (readonly)
Enables or disables the IPv6 endpoint for the instance metadata service.
Default: disabled
1912 1913 1914 |
# File 'ec2/cfn_instance.rb', line 1912 def http_protocol_ipv6 @http_protocol_ipv6 end |
#http_put_response_hop_limit ⇒ Numeric? (readonly)
Default: - 1
The maximum number of hops that the metadata token can travel.
Possible values: Integers from 1 to 64
1920 1921 1922 |
# File 'ec2/cfn_instance.rb', line 1920 def http_put_response_hop_limit @http_put_response_hop_limit end |
#http_tokens ⇒ String? (readonly)
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
ImdsSupportfor the Amazon Machine Image (AMI) for your instance isv2.0and the account level default is set tono-preference, the default isrequired. - If the value of
ImdsSupportfor the Amazon Machine Image (AMI) for your instance isv2.0, but the account level default is set toV1 or V2, the default isoptional.
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 .
1935 1936 1937 |
# File 'ec2/cfn_instance.rb', line 1935 def http_tokens @http_tokens end |
#instance_metadata_tags ⇒ String? (readonly)
Set to enabled to allow access to instance tags from the instance metadata.
Set to disabled to turn off access to instance tags from the instance metadata. For more information, see Work with instance tags using the instance metadata .
Default: disabled
1944 1945 1946 |
# File 'ec2/cfn_instance.rb', line 1944 def @instance_metadata_tags end |
Class Method Details
.jsii_properties ⇒ Object
1946 1947 1948 1949 1950 1951 1952 1953 1954 |
# File 'ec2/cfn_instance.rb', line 1946 def self.jsii_properties { :http_endpoint => "httpEndpoint", :http_protocol_ipv6 => "httpProtocolIpv6", :http_put_response_hop_limit => "httpPutResponseHopLimit", :http_tokens => "httpTokens", :instance_metadata_tags => "instanceMetadataTags", } end |
Instance Method Details
#to_jsii ⇒ Object
1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 |
# File 'ec2/cfn_instance.rb', line 1956 def to_jsii result = {} result.merge!({ "httpEndpoint" => @http_endpoint, "httpProtocolIpv6" => @http_protocol_ipv6, "httpPutResponseHopLimit" => @http_put_response_hop_limit, "httpTokens" => @http_tokens, "instanceMetadataTags" => @instance_metadata_tags, }) result.compact end |