Class CfnInstance.MetadataOptionsProperty.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.CfnInstance.MetadataOptionsProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnInstance.MetadataOptionsProperty>
- Enclosing interface:
CfnInstance.MetadataOptionsProperty
@Stability(Stable)
public static final class CfnInstance.MetadataOptionsProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnInstance.MetadataOptionsProperty>
A builder for
CfnInstance.MetadataOptionsProperty
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.httpEndpoint
(String httpEndpoint) Sets the value ofCfnInstance.MetadataOptionsProperty.getHttpEndpoint()
httpProtocolIpv6
(String httpProtocolIpv6) Sets the value ofCfnInstance.MetadataOptionsProperty.getHttpProtocolIpv6()
httpPutResponseHopLimit
(Number httpPutResponseHopLimit) Sets the value ofCfnInstance.MetadataOptionsProperty.getHttpPutResponseHopLimit()
httpTokens
(String httpTokens) Sets the value ofCfnInstance.MetadataOptionsProperty.getHttpTokens()
instanceMetadataTags
(String instanceMetadataTags) Sets the value ofCfnInstance.MetadataOptionsProperty.getInstanceMetadataTags()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
httpEndpoint
@Stability(Stable) public CfnInstance.MetadataOptionsProperty.Builder httpEndpoint(String httpEndpoint) Sets the value ofCfnInstance.MetadataOptionsProperty.getHttpEndpoint()
- Parameters:
httpEndpoint
- Enables or disables the HTTP metadata endpoint on your instances. If you specify a value ofdisabled
, you cannot access your instance metadata.Default:
enabled
- Returns:
this
-
httpProtocolIpv6
@Stability(Stable) public CfnInstance.MetadataOptionsProperty.Builder httpProtocolIpv6(String httpProtocolIpv6) Sets the value ofCfnInstance.MetadataOptionsProperty.getHttpProtocolIpv6()
- Parameters:
httpProtocolIpv6
- Enables or disables the IPv6 endpoint for the instance metadata service. Default:disabled
- Returns:
this
-
httpPutResponseHopLimit
@Stability(Stable) public CfnInstance.MetadataOptionsProperty.Builder httpPutResponseHopLimit(Number httpPutResponseHopLimit) Sets the value ofCfnInstance.MetadataOptionsProperty.getHttpPutResponseHopLimit()
- Parameters:
httpPutResponseHopLimit
- The maximum number of hops that the metadata token can travel. Possible values: Integers from 1 to 64- Returns:
this
-
httpTokens
Sets the value ofCfnInstance.MetadataOptionsProperty.getHttpTokens()
- Parameters:
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 isv2.0
and the account level default is set tono-preference
, the default isrequired
. - If the value of
ImdsSupport
for 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 .
- Returns:
this
-
instanceMetadataTags
@Stability(Stable) public CfnInstance.MetadataOptionsProperty.Builder instanceMetadataTags(String instanceMetadataTags) Sets the value ofCfnInstance.MetadataOptionsProperty.getInstanceMetadataTags()
- Parameters:
instanceMetadataTags
- Set toenabled
to allow access to instance tags from the instance metadata. Set todisabled
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
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnInstance.MetadataOptionsProperty>
- Returns:
- a new instance of
CfnInstance.MetadataOptionsProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-