@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.193Z") @Stability(value=Stable) public class CfnInstance extends CfnResource implements IInspectable
Specifies an EC2 instance.
If an Elastic IP address is attached to your instance, AWS CloudFormation reattaches the Elastic IP address after it updates the instance. For more information about updating stacks, see AWS CloudFormation Stacks Updates .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;
CfnInstance cfnInstance = CfnInstance.Builder.create(this, "MyCfnInstance")
.additionalInfo("additionalInfo")
.affinity("affinity")
.availabilityZone("availabilityZone")
.blockDeviceMappings(List.of(BlockDeviceMappingProperty.builder()
.deviceName("deviceName")
// the properties below are optional
.ebs(EbsProperty.builder()
.deleteOnTermination(false)
.encrypted(false)
.iops(123)
.kmsKeyId("kmsKeyId")
.snapshotId("snapshotId")
.volumeSize(123)
.volumeType("volumeType")
.build())
.noDevice(NoDeviceProperty.builder().build())
.virtualName("virtualName")
.build()))
.cpuOptions(CpuOptionsProperty.builder()
.coreCount(123)
.threadsPerCore(123)
.build())
.creditSpecification(CreditSpecificationProperty.builder()
.cpuCredits("cpuCredits")
.build())
.disableApiTermination(false)
.ebsOptimized(false)
.elasticGpuSpecifications(List.of(ElasticGpuSpecificationProperty.builder()
.type("type")
.build()))
.elasticInferenceAccelerators(List.of(ElasticInferenceAcceleratorProperty.builder()
.type("type")
// the properties below are optional
.count(123)
.build()))
.enclaveOptions(EnclaveOptionsProperty.builder()
.enabled(false)
.build())
.hibernationOptions(HibernationOptionsProperty.builder()
.configured(false)
.build())
.hostId("hostId")
.hostResourceGroupArn("hostResourceGroupArn")
.iamInstanceProfile("iamInstanceProfile")
.imageId("imageId")
.instanceInitiatedShutdownBehavior("instanceInitiatedShutdownBehavior")
.instanceType("instanceType")
.ipv6AddressCount(123)
.ipv6Addresses(List.of(InstanceIpv6AddressProperty.builder()
.ipv6Address("ipv6Address")
.build()))
.kernelId("kernelId")
.keyName("keyName")
.launchTemplate(LaunchTemplateSpecificationProperty.builder()
.version("version")
// the properties below are optional
.launchTemplateId("launchTemplateId")
.launchTemplateName("launchTemplateName")
.build())
.licenseSpecifications(List.of(LicenseSpecificationProperty.builder()
.licenseConfigurationArn("licenseConfigurationArn")
.build()))
.monitoring(false)
.networkInterfaces(List.of(NetworkInterfaceProperty.builder()
.deviceIndex("deviceIndex")
// the properties below are optional
.associateCarrierIpAddress(false)
.associatePublicIpAddress(false)
.deleteOnTermination(false)
.description("description")
.groupSet(List.of("groupSet"))
.ipv6AddressCount(123)
.ipv6Addresses(List.of(InstanceIpv6AddressProperty.builder()
.ipv6Address("ipv6Address")
.build()))
.networkInterfaceId("networkInterfaceId")
.privateIpAddress("privateIpAddress")
.privateIpAddresses(List.of(PrivateIpAddressSpecificationProperty.builder()
.primary(false)
.privateIpAddress("privateIpAddress")
.build()))
.secondaryPrivateIpAddressCount(123)
.subnetId("subnetId")
.build()))
.placementGroupName("placementGroupName")
.privateDnsNameOptions(PrivateDnsNameOptionsProperty.builder()
.enableResourceNameDnsAaaaRecord(false)
.enableResourceNameDnsARecord(false)
.hostnameType("hostnameType")
.build())
.privateIpAddress("privateIpAddress")
.propagateTagsToVolumeOnCreation(false)
.ramdiskId("ramdiskId")
.securityGroupIds(List.of("securityGroupIds"))
.securityGroups(List.of("securityGroups"))
.sourceDestCheck(false)
.ssmAssociations(List.of(SsmAssociationProperty.builder()
.documentName("documentName")
// the properties below are optional
.associationParameters(List.of(AssociationParameterProperty.builder()
.key("key")
.value(List.of("value"))
.build()))
.build()))
.subnetId("subnetId")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.tenancy("tenancy")
.userData("userData")
.volumes(List.of(VolumeProperty.builder()
.device("device")
.volumeId("volumeId")
.build()))
.build();
| Modifier and Type | Class and Description |
|---|---|
static interface |
CfnInstance.AssociationParameterProperty
Specifies input parameter values for an SSM document in AWS Systems Manager .
|
static interface |
CfnInstance.BlockDeviceMappingProperty
Specifies a block device mapping for an instance.
|
static class |
CfnInstance.Builder
A fluent builder for
CfnInstance. |
static interface |
CfnInstance.CpuOptionsProperty
Specifies the CPU options for the instance.
|
static interface |
CfnInstance.CreditSpecificationProperty
Specifies the credit option for CPU usage of a T2, T3, or T3a instance.
|
static interface |
CfnInstance.EbsProperty
Specifies a block device for an EBS volume.
|
static interface |
CfnInstance.ElasticGpuSpecificationProperty
Specifies the type of Elastic GPU.
|
static interface |
CfnInstance.ElasticInferenceAcceleratorProperty
Specifies the Elastic Inference Accelerator for the instance.
|
static interface |
CfnInstance.EnclaveOptionsProperty
Indicates whether the instance is enabled for AWS Nitro Enclaves.
|
static interface |
CfnInstance.HibernationOptionsProperty
Specifies the hibernation options for the instance.
|
static interface |
CfnInstance.InstanceIpv6AddressProperty
Specifies the IPv6 address for the instance.
|
static interface |
CfnInstance.LaunchTemplateSpecificationProperty
Specifies a launch template.
|
static interface |
CfnInstance.LicenseSpecificationProperty
Specifies the license configuration to use.
|
static interface |
CfnInstance.NetworkInterfaceProperty
Specifies a network interface that is to be attached to an instance.
|
static interface |
CfnInstance.NoDeviceProperty
Suppresses the specified device included in the block device mapping of the AMI.
|
static interface |
CfnInstance.PrivateDnsNameOptionsProperty
The type of hostnames to assign to instances in the subnet at launch.
|
static interface |
CfnInstance.PrivateIpAddressSpecificationProperty
Specifies a secondary private IPv4 address for a network interface.
|
static interface |
CfnInstance.SsmAssociationProperty
Specifies the SSM document and parameter values in AWS Systems Manager to associate with an instance.
|
static interface |
CfnInstance.VolumeProperty
Specifies a volume to attach to an instance.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnInstance(software.constructs.Construct scope,
String id)
Create a new `AWS::EC2::Instance`.
|
|
CfnInstance(software.constructs.Construct scope,
String id,
CfnInstanceProps props)
Create a new `AWS::EC2::Instance`.
|
protected |
CfnInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnInstance(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAdditionalInfo()
This property is reserved for internal use.
|
String |
getAffinity()
Indicates whether the instance is associated with a dedicated host.
|
String |
getAttrAvailabilityZone()
The Availability Zone where the specified instance is launched.
|
String |
getAttrPrivateDnsName()
The private DNS name of the specified instance.
|
String |
getAttrPrivateIp()
The private IP address of the specified instance.
|
String |
getAttrPublicDnsName()
The public DNS name of the specified instance.
|
String |
getAttrPublicIp()
The public IP address of the specified instance.
|
String |
getAvailabilityZone()
The Availability Zone of the instance.
|
Object |
getBlockDeviceMappings()
The block device mapping entries that defines the block devices to attach to the instance at launch.
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getCpuOptions()
The CPU options for the instance.
|
Object |
getCreditSpecification()
The credit option for CPU usage of the burstable performance instance.
|
Object |
getDisableApiTermination()
If you set this parameter to `true` , you can't terminate the instance using the Amazon EC2 console, CLI, or API;
|
Object |
getEbsOptimized()
Indicates whether the instance is optimized for Amazon EBS I/O.
|
Object |
getElasticGpuSpecifications()
An elastic GPU to associate with the instance.
|
Object |
getElasticInferenceAccelerators()
An elastic inference accelerator to associate with the instance.
|
Object |
getEnclaveOptions()
Indicates whether the instance is enabled for AWS Nitro Enclaves.
|
Object |
getHibernationOptions()
Indicates whether an instance is enabled for hibernation.
|
String |
getHostId()
If you specify host for the `Affinity` property, the ID of a dedicated host that the instance is associated with.
|
String |
getHostResourceGroupArn()
The ARN of the host resource group in which to launch the instances.
|
String |
getIamInstanceProfile()
The name of an IAM instance profile.
|
String |
getImageId()
The ID of the AMI.
|
String |
getInstanceInitiatedShutdownBehavior()
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
|
String |
getInstanceType()
The instance type.
|
Number |
getIpv6AddressCount()
[EC2-VPC] The number of IPv6 addresses to associate with the primary network interface.
|
Object |
getIpv6Addresses()
[EC2-VPC] The IPv6 addresses from the range of the subnet to associate with the primary network interface.
|
String |
getKernelId()
The ID of the kernel.
|
String |
getKeyName()
The name of the key pair.
|
Object |
getLaunchTemplate()
The launch template to use to launch the instances.
|
Object |
getLicenseSpecifications()
The license configurations.
|
Object |
getMonitoring()
Specifies whether detailed monitoring is enabled for the instance.
|
Object |
getNetworkInterfaces()
The network interfaces to associate with the instance.
|
String |
getPlacementGroupName()
The name of an existing placement group that you want to launch the instance into (cluster | partition | spread).
|
Object |
getPrivateDnsNameOptions()
The options for the instance hostname.
|
String |
getPrivateIpAddress()
[EC2-VPC] The primary IPv4 address.
|
Object |
getPropagateTagsToVolumeOnCreation()
Indicates whether to assign the tags from the instance to all of the volumes attached to the instance at launch.
|
String |
getRamdiskId()
The ID of the RAM disk to select.
|
List<String> |
getSecurityGroupIds()
The IDs of the security groups.
|
List<String> |
getSecurityGroups()
[EC2-Classic, default VPC] The names of the security groups.
|
Object |
getSourceDestCheck()
Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives.
|
Object |
getSsmAssociations()
The SSM [document](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-document.html) and parameter values in AWS Systems Manager to associate with this instance.
|
String |
getSubnetId()
[EC2-VPC] The ID of the subnet to launch the instance into.
|
TagManager |
getTags()
The tags to add to the instance.
|
String |
getTenancy()
The tenancy of the instance (if the instance is running in a VPC).
|
String |
getUserData()
The user data script to make available to the instance.
|
Object |
getVolumes()
The volumes to attach to the instance.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAdditionalInfo(String value)
This property is reserved for internal use.
|
void |
setAffinity(String value)
Indicates whether the instance is associated with a dedicated host.
|
void |
setAvailabilityZone(String value)
The Availability Zone of the instance.
|
void |
setBlockDeviceMappings(IResolvable value)
The block device mapping entries that defines the block devices to attach to the instance at launch.
|
void |
setBlockDeviceMappings(List<Object> value)
The block device mapping entries that defines the block devices to attach to the instance at launch.
|
void |
setCpuOptions(CfnInstance.CpuOptionsProperty value)
The CPU options for the instance.
|
void |
setCpuOptions(IResolvable value)
The CPU options for the instance.
|
void |
setCreditSpecification(CfnInstance.CreditSpecificationProperty value)
The credit option for CPU usage of the burstable performance instance.
|
void |
setCreditSpecification(IResolvable value)
The credit option for CPU usage of the burstable performance instance.
|
void |
setDisableApiTermination(Boolean value)
If you set this parameter to `true` , you can't terminate the instance using the Amazon EC2 console, CLI, or API;
|
void |
setDisableApiTermination(IResolvable value)
If you set this parameter to `true` , you can't terminate the instance using the Amazon EC2 console, CLI, or API;
|
void |
setEbsOptimized(Boolean value)
Indicates whether the instance is optimized for Amazon EBS I/O.
|
void |
setEbsOptimized(IResolvable value)
Indicates whether the instance is optimized for Amazon EBS I/O.
|
void |
setElasticGpuSpecifications(IResolvable value)
An elastic GPU to associate with the instance.
|
void |
setElasticGpuSpecifications(List<Object> value)
An elastic GPU to associate with the instance.
|
void |
setElasticInferenceAccelerators(IResolvable value)
An elastic inference accelerator to associate with the instance.
|
void |
setElasticInferenceAccelerators(List<Object> value)
An elastic inference accelerator to associate with the instance.
|
void |
setEnclaveOptions(CfnInstance.EnclaveOptionsProperty value)
Indicates whether the instance is enabled for AWS Nitro Enclaves.
|
void |
setEnclaveOptions(IResolvable value)
Indicates whether the instance is enabled for AWS Nitro Enclaves.
|
void |
setHibernationOptions(CfnInstance.HibernationOptionsProperty value)
Indicates whether an instance is enabled for hibernation.
|
void |
setHibernationOptions(IResolvable value)
Indicates whether an instance is enabled for hibernation.
|
void |
setHostId(String value)
If you specify host for the `Affinity` property, the ID of a dedicated host that the instance is associated with.
|
void |
setHostResourceGroupArn(String value)
The ARN of the host resource group in which to launch the instances.
|
void |
setIamInstanceProfile(String value)
The name of an IAM instance profile.
|
void |
setImageId(String value)
The ID of the AMI.
|
void |
setInstanceInitiatedShutdownBehavior(String value)
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
|
void |
setInstanceType(String value)
The instance type.
|
void |
setIpv6AddressCount(Number value)
[EC2-VPC] The number of IPv6 addresses to associate with the primary network interface.
|
void |
setIpv6Addresses(IResolvable value)
[EC2-VPC] The IPv6 addresses from the range of the subnet to associate with the primary network interface.
|
void |
setIpv6Addresses(List<Object> value)
[EC2-VPC] The IPv6 addresses from the range of the subnet to associate with the primary network interface.
|
void |
setKernelId(String value)
The ID of the kernel.
|
void |
setKeyName(String value)
The name of the key pair.
|
void |
setLaunchTemplate(CfnInstance.LaunchTemplateSpecificationProperty value)
The launch template to use to launch the instances.
|
void |
setLaunchTemplate(IResolvable value)
The launch template to use to launch the instances.
|
void |
setLicenseSpecifications(IResolvable value)
The license configurations.
|
void |
setLicenseSpecifications(List<Object> value)
The license configurations.
|
void |
setMonitoring(Boolean value)
Specifies whether detailed monitoring is enabled for the instance.
|
void |
setMonitoring(IResolvable value)
Specifies whether detailed monitoring is enabled for the instance.
|
void |
setNetworkInterfaces(IResolvable value)
The network interfaces to associate with the instance.
|
void |
setNetworkInterfaces(List<Object> value)
The network interfaces to associate with the instance.
|
void |
setPlacementGroupName(String value)
The name of an existing placement group that you want to launch the instance into (cluster | partition | spread).
|
void |
setPrivateDnsNameOptions(CfnInstance.PrivateDnsNameOptionsProperty value)
The options for the instance hostname.
|
void |
setPrivateDnsNameOptions(IResolvable value)
The options for the instance hostname.
|
void |
setPrivateIpAddress(String value)
[EC2-VPC] The primary IPv4 address.
|
void |
setPropagateTagsToVolumeOnCreation(Boolean value)
Indicates whether to assign the tags from the instance to all of the volumes attached to the instance at launch.
|
void |
setPropagateTagsToVolumeOnCreation(IResolvable value)
Indicates whether to assign the tags from the instance to all of the volumes attached to the instance at launch.
|
void |
setRamdiskId(String value)
The ID of the RAM disk to select.
|
void |
setSecurityGroupIds(List<String> value)
The IDs of the security groups.
|
void |
setSecurityGroups(List<String> value)
[EC2-Classic, default VPC] The names of the security groups.
|
void |
setSourceDestCheck(Boolean value)
Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives.
|
void |
setSourceDestCheck(IResolvable value)
Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives.
|
void |
setSsmAssociations(IResolvable value)
The SSM [document](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-document.html) and parameter values in AWS Systems Manager to associate with this instance.
|
void |
setSsmAssociations(List<Object> value)
The SSM [document](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-document.html) and parameter values in AWS Systems Manager to associate with this instance.
|
void |
setSubnetId(String value)
[EC2-VPC] The ID of the subnet to launch the instance into.
|
void |
setTenancy(String value)
The tenancy of the instance (if the instance is running in a VPC).
|
void |
setUserData(String value)
The user data script to make available to the instance.
|
void |
setVolumes(IResolvable value)
The volumes to attach to the instance.
|
void |
setVolumes(List<Object> value)
The volumes to attach to the instance.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnInstance(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnInstance(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
CfnInstanceProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties.@Stability(value=Stable)
public CfnInstance(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrAvailabilityZone()
You can retrieve a list of all Availability Zones for a Region by using the Fn::GetAZs intrinsic function.
@Stability(value=Stable) @NotNull public String getAttrPrivateDnsName()
For example: ip-10-24-34-0.ec2.internal .
@Stability(value=Stable) @NotNull public String getAttrPrivateIp()
For example: 10.24.34.0 .
@Stability(value=Stable) @NotNull public String getAttrPublicDnsName()
For example: ec2-107-20-50-45.compute-1.amazonaws.com .
@Stability(value=Stable) @NotNull public String getAttrPublicIp()
For example: 192.0.2.0 .
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
These tags are not applied to the EBS volumes, such as the root volume.
@Stability(value=Stable) @Nullable public String getAdditionalInfo()
If you use it, the stack fails with this error: Bad property set: [Testing this property] (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: 0XXXXXX-49c7-4b40-8bcc-76885dcXXXXX) .
@Stability(value=Stable)
public void setAdditionalInfo(@Nullable
String value)
If you use it, the stack fails with this error: Bad property set: [Testing this property] (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: 0XXXXXX-49c7-4b40-8bcc-76885dcXXXXX) .
@Stability(value=Stable) @Nullable public String getAffinity()
If you want the instance to always restart on the same host on which it was launched, specify host . If you want the instance to restart on any available host, but try to launch onto the last host it ran on (on a best-effort basis), specify default .
@Stability(value=Stable)
public void setAffinity(@Nullable
String value)
If you want the instance to always restart on the same host on which it was launched, specify host . If you want the instance to restart on any available host, but try to launch onto the last host it ran on (on a best-effort basis), specify default .
@Stability(value=Stable) @Nullable public String getAvailabilityZone()
If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.
This parameter is not supported by DescribeImageAttribute .
@Stability(value=Stable)
public void setAvailabilityZone(@Nullable
String value)
If not specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the Region.
This parameter is not supported by DescribeImageAttribute .
@Stability(value=Stable) @Nullable public Object getBlockDeviceMappings()
By default, the block devices specified in the block device mapping for the AMI are used. You can override the AMI block device mapping using the instance block device mapping. For the root volume, you can override only the volume size, volume type, volume encryption settings, and the DeleteOnTermination setting.
After the instance is running, you can modify only the
DeleteOnTerminationparameter for the attached volumes without interrupting the instance. Modifying any other parameter results in instance replacement .
@Stability(value=Stable)
public void setBlockDeviceMappings(@Nullable
IResolvable value)
By default, the block devices specified in the block device mapping for the AMI are used. You can override the AMI block device mapping using the instance block device mapping. For the root volume, you can override only the volume size, volume type, volume encryption settings, and the DeleteOnTermination setting.
After the instance is running, you can modify only the
DeleteOnTerminationparameter for the attached volumes without interrupting the instance. Modifying any other parameter results in instance replacement .
@Stability(value=Stable)
public void setBlockDeviceMappings(@Nullable
List<Object> value)
By default, the block devices specified in the block device mapping for the AMI are used. You can override the AMI block device mapping using the instance block device mapping. For the root volume, you can override only the volume size, volume type, volume encryption settings, and the DeleteOnTermination setting.
After the instance is running, you can modify only the
DeleteOnTerminationparameter for the attached volumes without interrupting the instance. Modifying any other parameter results in instance replacement .
@Stability(value=Stable) @Nullable public Object getCpuOptions()
For more information, see Optimize CPU options in the Amazon Elastic Compute Cloud User Guide .
@Stability(value=Stable)
public void setCpuOptions(@Nullable
CfnInstance.CpuOptionsProperty value)
For more information, see Optimize CPU options in the Amazon Elastic Compute Cloud User Guide .
@Stability(value=Stable)
public void setCpuOptions(@Nullable
IResolvable value)
For more information, see Optimize CPU options in the Amazon Elastic Compute Cloud User Guide .
@Stability(value=Stable) @Nullable public Object getCreditSpecification()
Valid values are standard and unlimited . To change this attribute after launch, use ModifyInstanceCreditSpecification . For more information, see Burstable performance instances in the Amazon EC2 User Guide .
Default: standard (T2 instances) or unlimited (T3/T3a instances)
For T3 instances with host tenancy, only standard is supported.
@Stability(value=Stable)
public void setCreditSpecification(@Nullable
CfnInstance.CreditSpecificationProperty value)
Valid values are standard and unlimited . To change this attribute after launch, use ModifyInstanceCreditSpecification . For more information, see Burstable performance instances in the Amazon EC2 User Guide .
Default: standard (T2 instances) or unlimited (T3/T3a instances)
For T3 instances with host tenancy, only standard is supported.
@Stability(value=Stable)
public void setCreditSpecification(@Nullable
IResolvable value)
Valid values are standard and unlimited . To change this attribute after launch, use ModifyInstanceCreditSpecification . For more information, see Burstable performance instances in the Amazon EC2 User Guide .
Default: standard (T2 instances) or unlimited (T3/T3a instances)
For T3 instances with host tenancy, only standard is supported.
@Stability(value=Stable) @Nullable public Object getDisableApiTermination()
otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.
Default: false
@Stability(value=Stable)
public void setDisableApiTermination(@Nullable
Boolean value)
otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.
Default: false
@Stability(value=Stable)
public void setDisableApiTermination(@Nullable
IResolvable value)
otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate , you can terminate the instance by running the shutdown command from the instance.
Default: false
@Stability(value=Stable) @Nullable public Object getEbsOptimized()
This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.
Default: false
@Stability(value=Stable)
public void setEbsOptimized(@Nullable
Boolean value)
This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.
Default: false
@Stability(value=Stable)
public void setEbsOptimized(@Nullable
IResolvable value)
This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.
Default: false
@Stability(value=Stable) @Nullable public Object getElasticGpuSpecifications()
An Elastic GPU is a GPU resource that you can attach to your Windows instance to accelerate the graphics performance of your applications. For more information, see Amazon EC2 Elastic GPUs in the Amazon EC2 User Guide .
@Stability(value=Stable)
public void setElasticGpuSpecifications(@Nullable
IResolvable value)
An Elastic GPU is a GPU resource that you can attach to your Windows instance to accelerate the graphics performance of your applications. For more information, see Amazon EC2 Elastic GPUs in the Amazon EC2 User Guide .
@Stability(value=Stable)
public void setElasticGpuSpecifications(@Nullable
List<Object> value)
An Elastic GPU is a GPU resource that you can attach to your Windows instance to accelerate the graphics performance of your applications. For more information, see Amazon EC2 Elastic GPUs in the Amazon EC2 User Guide .
@Stability(value=Stable) @Nullable public Object getElasticInferenceAccelerators()
Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.
You cannot specify accelerators from different generations in the same request.
@Stability(value=Stable)
public void setElasticInferenceAccelerators(@Nullable
IResolvable value)
Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.
You cannot specify accelerators from different generations in the same request.
@Stability(value=Stable)
public void setElasticInferenceAccelerators(@Nullable
List<Object> value)
Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.
You cannot specify accelerators from different generations in the same request.
@Stability(value=Stable) @Nullable public Object getEnclaveOptions()
@Stability(value=Stable)
public void setEnclaveOptions(@Nullable
CfnInstance.EnclaveOptionsProperty value)
@Stability(value=Stable)
public void setEnclaveOptions(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Object getHibernationOptions()
For more information, see Hibernate your instance in the Amazon EC2 User Guide .
You can't enable hibernation and AWS Nitro Enclaves on the same instance.
@Stability(value=Stable)
public void setHibernationOptions(@Nullable
CfnInstance.HibernationOptionsProperty value)
For more information, see Hibernate your instance in the Amazon EC2 User Guide .
You can't enable hibernation and AWS Nitro Enclaves on the same instance.
@Stability(value=Stable)
public void setHibernationOptions(@Nullable
IResolvable value)
For more information, see Hibernate your instance in the Amazon EC2 User Guide .
You can't enable hibernation and AWS Nitro Enclaves on the same instance.
@Stability(value=Stable) @Nullable public String getHostId()
If you don't specify an ID, Amazon EC2 launches the instance onto any available, compatible dedicated host in your account. This type of launch is called an untargeted launch. Note that for untargeted launches, you must have a compatible, dedicated host available to successfully launch instances.
@Stability(value=Stable)
public void setHostId(@Nullable
String value)
If you don't specify an ID, Amazon EC2 launches the instance onto any available, compatible dedicated host in your account. This type of launch is called an untargeted launch. Note that for untargeted launches, you must have a compatible, dedicated host available to successfully launch instances.
@Stability(value=Stable) @Nullable public String getHostResourceGroupArn()
If you specify a host resource group ARN, omit the Tenancy parameter or set it to host .
@Stability(value=Stable)
public void setHostResourceGroupArn(@Nullable
String value)
If you specify a host resource group ARN, omit the Tenancy parameter or set it to host .
@Stability(value=Stable) @Nullable public String getIamInstanceProfile()
To create a new IAM instance profile, use the AWS::IAM::InstanceProfile resource.
@Stability(value=Stable)
public void setIamInstanceProfile(@Nullable
String value)
To create a new IAM instance profile, use the AWS::IAM::InstanceProfile resource.
@Stability(value=Stable) @Nullable public String getImageId()
An AMI ID is required to launch an instance and must be specified here or in a launch template.
@Stability(value=Stable)
public void setImageId(@Nullable
String value)
An AMI ID is required to launch an instance and must be specified here or in a launch template.
@Stability(value=Stable) @Nullable public String getInstanceInitiatedShutdownBehavior()
Default: stop
@Stability(value=Stable)
public void setInstanceInitiatedShutdownBehavior(@Nullable
String value)
Default: stop
@Stability(value=Stable) @Nullable public String getInstanceType()
Default: m1.small
@Stability(value=Stable)
public void setInstanceType(@Nullable
String value)
Default: m1.small
@Stability(value=Stable) @Nullable public Number getIpv6AddressCount()
Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
You cannot specify this option and the network interfaces option in the same request.
@Stability(value=Stable)
public void setIpv6AddressCount(@Nullable
Number value)
Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
You cannot specify this option and the network interfaces option in the same request.
@Stability(value=Stable) @Nullable public Object getIpv6Addresses()
You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
You cannot specify this option and the network interfaces option in the same request.
@Stability(value=Stable)
public void setIpv6Addresses(@Nullable
IResolvable value)
You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
You cannot specify this option and the network interfaces option in the same request.
@Stability(value=Stable)
public void setIpv6Addresses(@Nullable
List<Object> value)
You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
You cannot specify this option and the network interfaces option in the same request.
@Stability(value=Stable) @Nullable public String getKernelId()
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon EC2 User Guide .
@Stability(value=Stable)
public void setKernelId(@Nullable
String value)
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon EC2 User Guide .
@Stability(value=Stable) @Nullable public String getKeyName()
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
@Stability(value=Stable)
public void setKeyName(@Nullable
String value)
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
@Stability(value=Stable) @Nullable public Object getLaunchTemplate()
Any parameters that you specify in the AWS CloudFormation template override the same parameters in the launch template. You can specify either the name or ID of a launch template, but not both.
@Stability(value=Stable)
public void setLaunchTemplate(@Nullable
CfnInstance.LaunchTemplateSpecificationProperty value)
Any parameters that you specify in the AWS CloudFormation template override the same parameters in the launch template. You can specify either the name or ID of a launch template, but not both.
@Stability(value=Stable)
public void setLaunchTemplate(@Nullable
IResolvable value)
Any parameters that you specify in the AWS CloudFormation template override the same parameters in the launch template. You can specify either the name or ID of a launch template, but not both.
@Stability(value=Stable) @Nullable public Object getLicenseSpecifications()
@Stability(value=Stable)
public void setLicenseSpecifications(@Nullable
IResolvable value)
@Stability(value=Stable)
public void setLicenseSpecifications(@Nullable
List<Object> value)
@Stability(value=Stable) @Nullable public Object getMonitoring()
Specify true to enable detailed monitoring. Otherwise, basic monitoring is enabled. For more information about detailed monitoring, see Enable or turn off detailed monitoring for your instances in the Amazon EC2 User Guide .
@Stability(value=Stable)
public void setMonitoring(@Nullable
Boolean value)
Specify true to enable detailed monitoring. Otherwise, basic monitoring is enabled. For more information about detailed monitoring, see Enable or turn off detailed monitoring for your instances in the Amazon EC2 User Guide .
@Stability(value=Stable)
public void setMonitoring(@Nullable
IResolvable value)
Specify true to enable detailed monitoring. Otherwise, basic monitoring is enabled. For more information about detailed monitoring, see Enable or turn off detailed monitoring for your instances in the Amazon EC2 User Guide .
@Stability(value=Stable) @Nullable public Object getNetworkInterfaces()
If you use this property to point to a network interface, you must terminate the original interface before attaching a new one to allow the update of the instance to succeed.
If this resource has a public IP address and is also in a VPC that is defined in the same template, you must use the DependsOn Attribute to declare a dependency on the VPC-gateway attachment.
@Stability(value=Stable)
public void setNetworkInterfaces(@Nullable
IResolvable value)
If you use this property to point to a network interface, you must terminate the original interface before attaching a new one to allow the update of the instance to succeed.
If this resource has a public IP address and is also in a VPC that is defined in the same template, you must use the DependsOn Attribute to declare a dependency on the VPC-gateway attachment.
@Stability(value=Stable)
public void setNetworkInterfaces(@Nullable
List<Object> value)
If you use this property to point to a network interface, you must terminate the original interface before attaching a new one to allow the update of the instance to succeed.
If this resource has a public IP address and is also in a VPC that is defined in the same template, you must use the DependsOn Attribute to declare a dependency on the VPC-gateway attachment.
@Stability(value=Stable) @Nullable public String getPlacementGroupName()
@Stability(value=Stable)
public void setPlacementGroupName(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getPrivateDnsNameOptions()
@Stability(value=Stable)
public void setPrivateDnsNameOptions(@Nullable
CfnInstance.PrivateDnsNameOptionsProperty value)
@Stability(value=Stable)
public void setPrivateDnsNameOptions(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public String getPrivateIpAddress()
Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.
You cannot specify this option and the network interfaces option in the same request.
If you make an update to an instance that requires replacement, you must assign a new private IP address. During a replacement, AWS CloudFormation creates a new instance but doesn't delete the old instance until the stack has successfully updated. If the stack update fails, AWS CloudFormation uses the old instance to roll back the stack to the previous working state. The old and new instances cannot have the same private IP address.
@Stability(value=Stable)
public void setPrivateIpAddress(@Nullable
String value)
Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.
You cannot specify this option and the network interfaces option in the same request.
If you make an update to an instance that requires replacement, you must assign a new private IP address. During a replacement, AWS CloudFormation creates a new instance but doesn't delete the old instance until the stack has successfully updated. If the stack update fails, AWS CloudFormation uses the old instance to roll back the stack to the previous working state. The old and new instances cannot have the same private IP address.
@Stability(value=Stable) @Nullable public Object getPropagateTagsToVolumeOnCreation()
If you specify true and you assign tags to the instance, those tags are automatically assigned to all of the volumes that you attach to the instance at launch. If you specify false , those tags are not assigned to the attached volumes.
@Stability(value=Stable)
public void setPropagateTagsToVolumeOnCreation(@Nullable
Boolean value)
If you specify true and you assign tags to the instance, those tags are automatically assigned to all of the volumes that you attach to the instance at launch. If you specify false , those tags are not assigned to the attached volumes.
@Stability(value=Stable)
public void setPropagateTagsToVolumeOnCreation(@Nullable
IResolvable value)
If you specify true and you assign tags to the instance, those tags are automatically assigned to all of the volumes that you attach to the instance at launch. If you specify false , those tags are not assigned to the attached volumes.
@Stability(value=Stable) @Nullable public String getRamdiskId()
Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the AWS Resource Center and search for the kernel ID.
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon EC2 User Guide .
@Stability(value=Stable)
public void setRamdiskId(@Nullable
String value)
Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the AWS Resource Center and search for the kernel ID.
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon EC2 User Guide .
@Stability(value=Stable) @Nullable public List<String> getSecurityGroupIds()
If you specify a network interface, you must specify any security groups as part of the network interface.
@Stability(value=Stable)
public void setSecurityGroupIds(@Nullable
List<String> value)
If you specify a network interface, you must specify any security groups as part of the network interface.
@Stability(value=Stable) @Nullable public List<String> getSecurityGroups()
For a nondefault VPC, you must use security group IDs instead.
You cannot specify this option and the network interfaces option in the same request. The list can contain both the name of existing Amazon EC2 security groups or references to AWS::EC2::SecurityGroup resources created in the template.
Default: Amazon EC2 uses the default security group.
@Stability(value=Stable)
public void setSecurityGroups(@Nullable
List<String> value)
For a nondefault VPC, you must use security group IDs instead.
You cannot specify this option and the network interfaces option in the same request. The list can contain both the name of existing Amazon EC2 security groups or references to AWS::EC2::SecurityGroup resources created in the template.
Default: Amazon EC2 uses the default security group.
@Stability(value=Stable) @Nullable public Object getSourceDestCheck()
If the value is true , source/destination checks are enabled; otherwise, they are disabled. The default value is true . You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.
@Stability(value=Stable)
public void setSourceDestCheck(@Nullable
Boolean value)
If the value is true , source/destination checks are enabled; otherwise, they are disabled. The default value is true . You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.
@Stability(value=Stable)
public void setSourceDestCheck(@Nullable
IResolvable value)
If the value is true , source/destination checks are enabled; otherwise, they are disabled. The default value is true . You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.
@Stability(value=Stable) @Nullable public Object getSsmAssociations()
You can currently associate only one document with an instance.
@Stability(value=Stable)
public void setSsmAssociations(@Nullable
IResolvable value)
You can currently associate only one document with an instance.
@Stability(value=Stable)
public void setSsmAssociations(@Nullable
List<Object> value)
You can currently associate only one document with an instance.
@Stability(value=Stable) @Nullable public String getSubnetId()
If you specify a network interface, you must specify any subnets as part of the network interface.
@Stability(value=Stable)
public void setSubnetId(@Nullable
String value)
If you specify a network interface, you must specify any subnets as part of the network interface.
@Stability(value=Stable) @Nullable public String getTenancy()
An instance with a tenancy of dedicated runs on single-tenant hardware.
@Stability(value=Stable)
public void setTenancy(@Nullable
String value)
An instance with a tenancy of dedicated runs on single-tenant hardware.
@Stability(value=Stable) @Nullable public String getUserData()
For more information, see Run commands on your Linux instance at launch and Run commands on your Windows instance at launch . If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.
@Stability(value=Stable)
public void setUserData(@Nullable
String value)
For more information, see Run commands on your Linux instance at launch and Run commands on your Windows instance at launch . If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.
@Stability(value=Stable) @Nullable public Object getVolumes()
@Stability(value=Stable)
public void setVolumes(@Nullable
IResolvable value)
Copyright © 2022. All rights reserved.