Class CfnInstanceProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnInstanceProps>
- Enclosing interface:
CfnInstanceProps
CfnInstanceProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadditionalInfo
(String additionalInfo) Sets the value ofCfnInstanceProps.getAdditionalInfo()
Sets the value ofCfnInstanceProps.getAffinity()
availabilityZone
(String availabilityZone) Sets the value ofCfnInstanceProps.getAvailabilityZone()
blockDeviceMappings
(List<? extends Object> blockDeviceMappings) Sets the value ofCfnInstanceProps.getBlockDeviceMappings()
blockDeviceMappings
(IResolvable blockDeviceMappings) Sets the value ofCfnInstanceProps.getBlockDeviceMappings()
build()
Builds the configured instance.cpuOptions
(IResolvable cpuOptions) Sets the value ofCfnInstanceProps.getCpuOptions()
cpuOptions
(CfnInstance.CpuOptionsProperty cpuOptions) Sets the value ofCfnInstanceProps.getCpuOptions()
creditSpecification
(IResolvable creditSpecification) Sets the value ofCfnInstanceProps.getCreditSpecification()
creditSpecification
(CfnInstance.CreditSpecificationProperty creditSpecification) Sets the value ofCfnInstanceProps.getCreditSpecification()
disableApiTermination
(Boolean disableApiTermination) Sets the value ofCfnInstanceProps.getDisableApiTermination()
disableApiTermination
(IResolvable disableApiTermination) Sets the value ofCfnInstanceProps.getDisableApiTermination()
ebsOptimized
(Boolean ebsOptimized) Sets the value ofCfnInstanceProps.getEbsOptimized()
ebsOptimized
(IResolvable ebsOptimized) Sets the value ofCfnInstanceProps.getEbsOptimized()
elasticGpuSpecifications
(List<? extends Object> elasticGpuSpecifications) Sets the value ofCfnInstanceProps.getElasticGpuSpecifications()
elasticGpuSpecifications
(IResolvable elasticGpuSpecifications) Sets the value ofCfnInstanceProps.getElasticGpuSpecifications()
elasticInferenceAccelerators
(List<? extends Object> elasticInferenceAccelerators) Sets the value ofCfnInstanceProps.getElasticInferenceAccelerators()
elasticInferenceAccelerators
(IResolvable elasticInferenceAccelerators) Sets the value ofCfnInstanceProps.getElasticInferenceAccelerators()
enclaveOptions
(IResolvable enclaveOptions) Sets the value ofCfnInstanceProps.getEnclaveOptions()
enclaveOptions
(CfnInstance.EnclaveOptionsProperty enclaveOptions) Sets the value ofCfnInstanceProps.getEnclaveOptions()
hibernationOptions
(IResolvable hibernationOptions) Sets the value ofCfnInstanceProps.getHibernationOptions()
hibernationOptions
(CfnInstance.HibernationOptionsProperty hibernationOptions) Sets the value ofCfnInstanceProps.getHibernationOptions()
Sets the value ofCfnInstanceProps.getHostId()
hostResourceGroupArn
(String hostResourceGroupArn) Sets the value ofCfnInstanceProps.getHostResourceGroupArn()
iamInstanceProfile
(String iamInstanceProfile) Sets the value ofCfnInstanceProps.getIamInstanceProfile()
Sets the value ofCfnInstanceProps.getImageId()
instanceInitiatedShutdownBehavior
(String instanceInitiatedShutdownBehavior) Sets the value ofCfnInstanceProps.getInstanceInitiatedShutdownBehavior()
instanceType
(String instanceType) Sets the value ofCfnInstanceProps.getInstanceType()
ipv6AddressCount
(Number ipv6AddressCount) Sets the value ofCfnInstanceProps.getIpv6AddressCount()
ipv6Addresses
(List<? extends Object> ipv6Addresses) Sets the value ofCfnInstanceProps.getIpv6Addresses()
ipv6Addresses
(IResolvable ipv6Addresses) Sets the value ofCfnInstanceProps.getIpv6Addresses()
Sets the value ofCfnInstanceProps.getKernelId()
Sets the value ofCfnInstanceProps.getKeyName()
launchTemplate
(IResolvable launchTemplate) Sets the value ofCfnInstanceProps.getLaunchTemplate()
launchTemplate
(CfnInstance.LaunchTemplateSpecificationProperty launchTemplate) Sets the value ofCfnInstanceProps.getLaunchTemplate()
licenseSpecifications
(List<? extends Object> licenseSpecifications) Sets the value ofCfnInstanceProps.getLicenseSpecifications()
licenseSpecifications
(IResolvable licenseSpecifications) Sets the value ofCfnInstanceProps.getLicenseSpecifications()
monitoring
(Boolean monitoring) Sets the value ofCfnInstanceProps.getMonitoring()
monitoring
(IResolvable monitoring) Sets the value ofCfnInstanceProps.getMonitoring()
networkInterfaces
(List<? extends Object> networkInterfaces) Sets the value ofCfnInstanceProps.getNetworkInterfaces()
networkInterfaces
(IResolvable networkInterfaces) Sets the value ofCfnInstanceProps.getNetworkInterfaces()
placementGroupName
(String placementGroupName) Sets the value ofCfnInstanceProps.getPlacementGroupName()
privateDnsNameOptions
(IResolvable privateDnsNameOptions) Sets the value ofCfnInstanceProps.getPrivateDnsNameOptions()
privateDnsNameOptions
(CfnInstance.PrivateDnsNameOptionsProperty privateDnsNameOptions) Sets the value ofCfnInstanceProps.getPrivateDnsNameOptions()
privateIpAddress
(String privateIpAddress) Sets the value ofCfnInstanceProps.getPrivateIpAddress()
propagateTagsToVolumeOnCreation
(Boolean propagateTagsToVolumeOnCreation) Sets the value ofCfnInstanceProps.getPropagateTagsToVolumeOnCreation()
propagateTagsToVolumeOnCreation
(IResolvable propagateTagsToVolumeOnCreation) Sets the value ofCfnInstanceProps.getPropagateTagsToVolumeOnCreation()
Sets the value ofCfnInstanceProps.getRamdiskId()
securityGroupIds
(List<String> securityGroupIds) Sets the value ofCfnInstanceProps.getSecurityGroupIds()
securityGroups
(List<String> securityGroups) Sets the value ofCfnInstanceProps.getSecurityGroups()
sourceDestCheck
(Boolean sourceDestCheck) Sets the value ofCfnInstanceProps.getSourceDestCheck()
sourceDestCheck
(IResolvable sourceDestCheck) Sets the value ofCfnInstanceProps.getSourceDestCheck()
ssmAssociations
(List<? extends Object> ssmAssociations) Sets the value ofCfnInstanceProps.getSsmAssociations()
ssmAssociations
(IResolvable ssmAssociations) Sets the value ofCfnInstanceProps.getSsmAssociations()
Sets the value ofCfnInstanceProps.getSubnetId()
Sets the value ofCfnInstanceProps.getTags()
Sets the value ofCfnInstanceProps.getTenancy()
Sets the value ofCfnInstanceProps.getUserData()
Sets the value ofCfnInstanceProps.getVolumes()
volumes
(IResolvable volumes) Sets the value ofCfnInstanceProps.getVolumes()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
additionalInfo
Sets the value ofCfnInstanceProps.getAdditionalInfo()
- Parameters:
additionalInfo
- This property is reserved for internal use. 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)
.- Returns:
this
-
affinity
Sets the value ofCfnInstanceProps.getAffinity()
- Parameters:
affinity
- Indicates whether the instance is associated with a dedicated host. If you want the instance to always restart on the same host on which it was launched, specifyhost
. 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), specifydefault
.- Returns:
this
-
availabilityZone
Sets the value ofCfnInstanceProps.getAvailabilityZone()
- Parameters:
availabilityZone
- The Availability Zone of the instance. 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 .
- Returns:
this
-
blockDeviceMappings
@Stability(Stable) public CfnInstanceProps.Builder blockDeviceMappings(IResolvable blockDeviceMappings) Sets the value ofCfnInstanceProps.getBlockDeviceMappings()
- Parameters:
blockDeviceMappings
- The block device mapping entries that defines the block devices to attach to the instance at launch. 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 theDeleteOnTermination
setting.After the instance is running, you can modify only the
DeleteOnTermination
parameter for the attached volumes without interrupting the instance. Modifying any other parameter results in instance replacement .- Returns:
this
-
blockDeviceMappings
@Stability(Stable) public CfnInstanceProps.Builder blockDeviceMappings(List<? extends Object> blockDeviceMappings) Sets the value ofCfnInstanceProps.getBlockDeviceMappings()
- Parameters:
blockDeviceMappings
- The block device mapping entries that defines the block devices to attach to the instance at launch. 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 theDeleteOnTermination
setting.After the instance is running, you can modify only the
DeleteOnTermination
parameter for the attached volumes without interrupting the instance. Modifying any other parameter results in instance replacement .- Returns:
this
-
cpuOptions
Sets the value ofCfnInstanceProps.getCpuOptions()
- Parameters:
cpuOptions
- The CPU options for the instance. For more information, see Optimize CPU options in the Amazon Elastic Compute Cloud User Guide .- Returns:
this
-
cpuOptions
@Stability(Stable) public CfnInstanceProps.Builder cpuOptions(CfnInstance.CpuOptionsProperty cpuOptions) Sets the value ofCfnInstanceProps.getCpuOptions()
- Parameters:
cpuOptions
- The CPU options for the instance. For more information, see Optimize CPU options in the Amazon Elastic Compute Cloud User Guide .- Returns:
this
-
creditSpecification
@Stability(Stable) public CfnInstanceProps.Builder creditSpecification(IResolvable creditSpecification) Sets the value ofCfnInstanceProps.getCreditSpecification()
- Parameters:
creditSpecification
- The credit option for CPU usage of the burstable performance instance. Valid values arestandard
andunlimited
. 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) orunlimited
(T3/T3a/T4g instances)For T3 instances with
host
tenancy, onlystandard
is supported.- Returns:
this
-
creditSpecification
@Stability(Stable) public CfnInstanceProps.Builder creditSpecification(CfnInstance.CreditSpecificationProperty creditSpecification) Sets the value ofCfnInstanceProps.getCreditSpecification()
- Parameters:
creditSpecification
- The credit option for CPU usage of the burstable performance instance. Valid values arestandard
andunlimited
. 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) orunlimited
(T3/T3a/T4g instances)For T3 instances with
host
tenancy, onlystandard
is supported.- Returns:
this
-
disableApiTermination
@Stability(Stable) public CfnInstanceProps.Builder disableApiTermination(Boolean disableApiTermination) Sets the value ofCfnInstanceProps.getDisableApiTermination()
- Parameters:
disableApiTermination
- If you set this parameter totrue
, you can't terminate the instance using the Amazon EC2 console, CLI, or API;. otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you setInstanceInitiatedShutdownBehavior
toterminate
, you can terminate the instance by running the shutdown command from the instance.Default:
false
- Returns:
this
-
disableApiTermination
@Stability(Stable) public CfnInstanceProps.Builder disableApiTermination(IResolvable disableApiTermination) Sets the value ofCfnInstanceProps.getDisableApiTermination()
- Parameters:
disableApiTermination
- If you set this parameter totrue
, you can't terminate the instance using the Amazon EC2 console, CLI, or API;. otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute . Alternatively, if you setInstanceInitiatedShutdownBehavior
toterminate
, you can terminate the instance by running the shutdown command from the instance.Default:
false
- Returns:
this
-
ebsOptimized
Sets the value ofCfnInstanceProps.getEbsOptimized()
- Parameters:
ebsOptimized
- Indicates whether the instance is optimized for Amazon EBS I/O. 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
- Returns:
this
-
ebsOptimized
Sets the value ofCfnInstanceProps.getEbsOptimized()
- Parameters:
ebsOptimized
- Indicates whether the instance is optimized for Amazon EBS I/O. 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
- Returns:
this
-
elasticGpuSpecifications
@Stability(Stable) public CfnInstanceProps.Builder elasticGpuSpecifications(IResolvable elasticGpuSpecifications) Sets the value ofCfnInstanceProps.getElasticGpuSpecifications()
- Parameters:
elasticGpuSpecifications
- An elastic GPU to associate with the instance.Amazon Elastic Graphics reached end of life on January 8, 2024.
- Returns:
this
-
elasticGpuSpecifications
@Stability(Stable) public CfnInstanceProps.Builder elasticGpuSpecifications(List<? extends Object> elasticGpuSpecifications) Sets the value ofCfnInstanceProps.getElasticGpuSpecifications()
- Parameters:
elasticGpuSpecifications
- An elastic GPU to associate with the instance.Amazon Elastic Graphics reached end of life on January 8, 2024.
- Returns:
this
-
elasticInferenceAccelerators
@Stability(Stable) public CfnInstanceProps.Builder elasticInferenceAccelerators(IResolvable elasticInferenceAccelerators) Sets the value ofCfnInstanceProps.getElasticInferenceAccelerators()
- Parameters:
elasticInferenceAccelerators
- An elastic inference accelerator to associate with the instance.Amazon Elastic Inference is no longer available.
- Returns:
this
-
elasticInferenceAccelerators
@Stability(Stable) public CfnInstanceProps.Builder elasticInferenceAccelerators(List<? extends Object> elasticInferenceAccelerators) Sets the value ofCfnInstanceProps.getElasticInferenceAccelerators()
- Parameters:
elasticInferenceAccelerators
- An elastic inference accelerator to associate with the instance.Amazon Elastic Inference is no longer available.
- Returns:
this
-
enclaveOptions
Sets the value ofCfnInstanceProps.getEnclaveOptions()
- Parameters:
enclaveOptions
- Indicates whether the instance is enabled for AWS Nitro Enclaves.- Returns:
this
-
enclaveOptions
@Stability(Stable) public CfnInstanceProps.Builder enclaveOptions(CfnInstance.EnclaveOptionsProperty enclaveOptions) Sets the value ofCfnInstanceProps.getEnclaveOptions()
- Parameters:
enclaveOptions
- Indicates whether the instance is enabled for AWS Nitro Enclaves.- Returns:
this
-
hibernationOptions
@Stability(Stable) public CfnInstanceProps.Builder hibernationOptions(IResolvable hibernationOptions) Sets the value ofCfnInstanceProps.getHibernationOptions()
- Parameters:
hibernationOptions
- Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the hibernation prerequisites . For more information, see Hibernate your Amazon EC2 instance in the Amazon EC2 User Guide .You can't enable hibernation and AWS Nitro Enclaves on the same instance.
- Returns:
this
-
hibernationOptions
@Stability(Stable) public CfnInstanceProps.Builder hibernationOptions(CfnInstance.HibernationOptionsProperty hibernationOptions) Sets the value ofCfnInstanceProps.getHibernationOptions()
- Parameters:
hibernationOptions
- Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the hibernation prerequisites . For more information, see Hibernate your Amazon EC2 instance in the Amazon EC2 User Guide .You can't enable hibernation and AWS Nitro Enclaves on the same instance.
- Returns:
this
-
hostId
Sets the value ofCfnInstanceProps.getHostId()
- Parameters:
hostId
- If you specify host for theAffinity
property, the ID of a dedicated host that the instance is associated with. 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.- Returns:
this
-
hostResourceGroupArn
@Stability(Stable) public CfnInstanceProps.Builder hostResourceGroupArn(String hostResourceGroupArn) Sets the value ofCfnInstanceProps.getHostResourceGroupArn()
- Parameters:
hostResourceGroupArn
- The ARN of the host resource group in which to launch the instances. If you specify a host resource group ARN, omit the Tenancy parameter or set it tohost
.- Returns:
this
-
iamInstanceProfile
Sets the value ofCfnInstanceProps.getIamInstanceProfile()
- Parameters:
iamInstanceProfile
- The name of an IAM instance profile. To create a new IAM instance profile, use the AWS::IAM::InstanceProfile resource.- Returns:
this
-
imageId
Sets the value ofCfnInstanceProps.getImageId()
- Parameters:
imageId
- The ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.- Returns:
this
-
instanceInitiatedShutdownBehavior
@Stability(Stable) public CfnInstanceProps.Builder instanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior) Sets the value ofCfnInstanceProps.getInstanceInitiatedShutdownBehavior()
- Parameters:
instanceInitiatedShutdownBehavior
- Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown). Default:stop
- Returns:
this
-
instanceType
Sets the value ofCfnInstanceProps.getInstanceType()
- Parameters:
instanceType
- The instance type. For more information, see Instance types in the Amazon EC2 User Guide . When you change your EBS-backed instance type, instance restart or replacement behavior depends on the instance type compatibility between the old and new types. An instance with an instance store volume as the root volume is always replaced. For more information, see Change the instance type in the Amazon EC2 User Guide .- Returns:
this
-
ipv6AddressCount
Sets the value ofCfnInstanceProps.getIpv6AddressCount()
- Parameters:
ipv6AddressCount
- The number of IPv6 addresses to associate with the primary network interface. 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.
- Returns:
this
-
ipv6Addresses
Sets the value ofCfnInstanceProps.getIpv6Addresses()
- Parameters:
ipv6Addresses
- The IPv6 addresses from the range of the subnet to associate with the primary network interface. 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.
- Returns:
this
-
ipv6Addresses
@Stability(Stable) public CfnInstanceProps.Builder ipv6Addresses(List<? extends Object> ipv6Addresses) Sets the value ofCfnInstanceProps.getIpv6Addresses()
- Parameters:
ipv6Addresses
- The IPv6 addresses from the range of the subnet to associate with the primary network interface. 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.
- Returns:
this
-
kernelId
Sets the value ofCfnInstanceProps.getKernelId()
- Parameters:
kernelId
- The ID of the kernel.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 .
- Returns:
this
-
keyName
Sets the value ofCfnInstanceProps.getKeyName()
- Parameters:
keyName
- The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .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.
- Returns:
this
-
launchTemplate
Sets the value ofCfnInstanceProps.getLaunchTemplate()
- Parameters:
launchTemplate
- The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.- Returns:
this
-
launchTemplate
@Stability(Stable) public CfnInstanceProps.Builder launchTemplate(CfnInstance.LaunchTemplateSpecificationProperty launchTemplate) Sets the value ofCfnInstanceProps.getLaunchTemplate()
- Parameters:
launchTemplate
- The launch template. Any additional parameters that you specify for the new instance overwrite the corresponding parameters included in the launch template.- Returns:
this
-
licenseSpecifications
@Stability(Stable) public CfnInstanceProps.Builder licenseSpecifications(IResolvable licenseSpecifications) Sets the value ofCfnInstanceProps.getLicenseSpecifications()
- Parameters:
licenseSpecifications
- The license configurations.- Returns:
this
-
licenseSpecifications
@Stability(Stable) public CfnInstanceProps.Builder licenseSpecifications(List<? extends Object> licenseSpecifications) Sets the value ofCfnInstanceProps.getLicenseSpecifications()
- Parameters:
licenseSpecifications
- The license configurations.- Returns:
this
-
monitoring
Sets the value ofCfnInstanceProps.getMonitoring()
- Parameters:
monitoring
- Specifies whether detailed monitoring is enabled for the instance. Specifytrue
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 .- Returns:
this
-
monitoring
Sets the value ofCfnInstanceProps.getMonitoring()
- Parameters:
monitoring
- Specifies whether detailed monitoring is enabled for the instance. Specifytrue
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 .- Returns:
this
-
networkInterfaces
Sets the value ofCfnInstanceProps.getNetworkInterfaces()
- Parameters:
networkInterfaces
- The network interfaces to associate with the instance.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.
- Returns:
this
-
networkInterfaces
@Stability(Stable) public CfnInstanceProps.Builder networkInterfaces(List<? extends Object> networkInterfaces) Sets the value ofCfnInstanceProps.getNetworkInterfaces()
- Parameters:
networkInterfaces
- The network interfaces to associate with the instance.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.
- Returns:
this
-
placementGroupName
Sets the value ofCfnInstanceProps.getPlacementGroupName()
- Parameters:
placementGroupName
- The name of an existing placement group that you want to launch the instance into (cluster | partition | spread).- Returns:
this
-
privateDnsNameOptions
@Stability(Stable) public CfnInstanceProps.Builder privateDnsNameOptions(IResolvable privateDnsNameOptions) Sets the value ofCfnInstanceProps.getPrivateDnsNameOptions()
- Parameters:
privateDnsNameOptions
- The options for the instance hostname.- Returns:
this
-
privateDnsNameOptions
@Stability(Stable) public CfnInstanceProps.Builder privateDnsNameOptions(CfnInstance.PrivateDnsNameOptionsProperty privateDnsNameOptions) Sets the value ofCfnInstanceProps.getPrivateDnsNameOptions()
- Parameters:
privateDnsNameOptions
- The options for the instance hostname.- Returns:
this
-
privateIpAddress
Sets the value ofCfnInstanceProps.getPrivateIpAddress()
- Parameters:
privateIpAddress
- The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet. 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.
- Returns:
this
-
propagateTagsToVolumeOnCreation
@Stability(Stable) public CfnInstanceProps.Builder propagateTagsToVolumeOnCreation(Boolean propagateTagsToVolumeOnCreation) Sets the value ofCfnInstanceProps.getPropagateTagsToVolumeOnCreation()
- Parameters:
propagateTagsToVolumeOnCreation
- Indicates whether to assign the tags specified in theTags
property to the volumes specified in theBlockDeviceMappings
property. Note that using this feature does not assign the tags to volumes that are created separately and then attached usingAWS::EC2::VolumeAttachment
.- Returns:
this
-
propagateTagsToVolumeOnCreation
@Stability(Stable) public CfnInstanceProps.Builder propagateTagsToVolumeOnCreation(IResolvable propagateTagsToVolumeOnCreation) Sets the value ofCfnInstanceProps.getPropagateTagsToVolumeOnCreation()
- Parameters:
propagateTagsToVolumeOnCreation
- Indicates whether to assign the tags specified in theTags
property to the volumes specified in theBlockDeviceMappings
property. Note that using this feature does not assign the tags to volumes that are created separately and then attached usingAWS::EC2::VolumeAttachment
.- Returns:
this
-
ramdiskId
Sets the value ofCfnInstanceProps.getRamdiskId()
- Parameters:
ramdiskId
- The ID of the RAM disk to select. 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 .
- Returns:
this
-
securityGroupIds
Sets the value ofCfnInstanceProps.getSecurityGroupIds()
- Parameters:
securityGroupIds
- The IDs of the security groups. You can specify the IDs of existing security groups and references to resources created by the stack template.If you specify a network interface, you must specify any security groups as part of the network interface.
- Returns:
this
-
securityGroups
Sets the value ofCfnInstanceProps.getSecurityGroups()
- Parameters:
securityGroups
- [Default VPC] The names of the security groups. 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.
- Returns:
this
-
sourceDestCheck
Sets the value ofCfnInstanceProps.getSourceDestCheck()
- Parameters:
sourceDestCheck
- Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives. If the value istrue
, source/destination checks are enabled; otherwise, they are disabled. The default value istrue
. You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.- Returns:
this
-
sourceDestCheck
Sets the value ofCfnInstanceProps.getSourceDestCheck()
- Parameters:
sourceDestCheck
- Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives. If the value istrue
, source/destination checks are enabled; otherwise, they are disabled. The default value istrue
. You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.- Returns:
this
-
ssmAssociations
Sets the value ofCfnInstanceProps.getSsmAssociations()
- Parameters:
ssmAssociations
- The SSM document and parameter values in AWS Systems Manager to associate with this instance. To use this property, you must specify an IAM instance profile role for the instance. For more information, see Create an IAM instance profile for Systems Manager in the AWS Systems Manager User Guide .You can associate only one document with an instance.
- Returns:
this
-
ssmAssociations
@Stability(Stable) public CfnInstanceProps.Builder ssmAssociations(List<? extends Object> ssmAssociations) Sets the value ofCfnInstanceProps.getSsmAssociations()
- Parameters:
ssmAssociations
- The SSM document and parameter values in AWS Systems Manager to associate with this instance. To use this property, you must specify an IAM instance profile role for the instance. For more information, see Create an IAM instance profile for Systems Manager in the AWS Systems Manager User Guide .You can associate only one document with an instance.
- Returns:
this
-
subnetId
Sets the value ofCfnInstanceProps.getSubnetId()
- Parameters:
subnetId
- The ID of the subnet to launch the instance into. If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.- Returns:
this
-
tags
Sets the value ofCfnInstanceProps.getTags()
- Parameters:
tags
- The tags to add to the instance. These tags are not applied to the EBS volumes, such as the root volume, unless PropagateTagsToVolumeOnCreation istrue
.- Returns:
this
-
tenancy
Sets the value ofCfnInstanceProps.getTenancy()
- Parameters:
tenancy
- The tenancy of the instance. An instance with a tenancy ofdedicated
runs on single-tenant hardware.- Returns:
this
-
userData
Sets the value ofCfnInstanceProps.getUserData()
- Parameters:
userData
- The parameters or scripts to store as user data. Any scripts in user data are run when you launch the instance. User data is limited to 16 KB. You must provide base64-encoded text. For more information, see Fn::Base64 .If the root volume is an EBS volume and you update user data, CloudFormation restarts the instance. If the root volume is an instance store volume and you update user data, the instance is replaced.
- Returns:
this
-
volumes
Sets the value ofCfnInstanceProps.getVolumes()
- Parameters:
volumes
- The volumes to attach to the instance.- Returns:
this
-
volumes
Sets the value ofCfnInstanceProps.getVolumes()
- Parameters:
volumes
- The volumes to attach to the instance.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnInstanceProps>
- Returns:
- a new instance of
CfnInstanceProps
- Throws:
NullPointerException
- if any required attribute was not provided
-