Class CfnLaunchConfiguration.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnLaunchConfiguration>
- Enclosing class:
CfnLaunchConfiguration
CfnLaunchConfiguration
.-
Method Summary
Modifier and TypeMethodDescriptionassociatePublicIpAddress
(Boolean associatePublicIpAddress) Specifies whether to assign a public IPv4 address to the group's instances.associatePublicIpAddress
(IResolvable associatePublicIpAddress) Specifies whether to assign a public IPv4 address to the group's instances.blockDeviceMappings
(List<? extends Object> blockDeviceMappings) The block device mapping entries that define the block devices to attach to the instances at launch.blockDeviceMappings
(IResolvable blockDeviceMappings) The block device mapping entries that define the block devices to attach to the instances at launch.build()
classicLinkVpcId
(String classicLinkVpcId) Available for backward compatibility.classicLinkVpcSecurityGroups
(List<String> classicLinkVpcSecurityGroups) Available for backward compatibility.ebsOptimized
(Boolean ebsOptimized) Specifies whether the launch configuration is optimized for EBS I/O (true
) or not (false
).ebsOptimized
(IResolvable ebsOptimized) Specifies whether the launch configuration is optimized for EBS I/O (true
) or not (false
).iamInstanceProfile
(String iamInstanceProfile) The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance.The ID of the Amazon Machine Image (AMI) that was assigned during registration.instanceId
(String instanceId) The ID of the Amazon EC2 instance to use to create the launch configuration.instanceMonitoring
(Boolean instanceMonitoring) Controls whether instances in this group are launched with detailed (true
) or basic (false
) monitoring.instanceMonitoring
(IResolvable instanceMonitoring) Controls whether instances in this group are launched with detailed (true
) or basic (false
) monitoring.instanceType
(String instanceType) Specifies the instance type of the EC2 instance.The ID of the kernel associated with the AMI.The name of the key pair.launchConfigurationName
(String launchConfigurationName) The name of the launch configuration.metadataOptions
(IResolvable metadataOptions) The metadata options for the instances.metadataOptions
(CfnLaunchConfiguration.MetadataOptionsProperty metadataOptions) The metadata options for the instances.placementTenancy
(String placementTenancy) The tenancy of the instance, eitherdefault
ordedicated
.The ID of the RAM disk to select.securityGroups
(List<String> securityGroups) A list that contains the security groups to assign to the instances in the Auto Scaling group.The maximum hourly price to be paid for any Spot Instance launched to fulfill the request.The Base64-encoded user data to make available to the launched EC2 instances.
-
Method Details
-
create
@Stability(Stable) public static CfnLaunchConfiguration.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.- Returns:
- a new instance of
CfnLaunchConfiguration.Builder
.
-
imageId
The ID of the Amazon Machine Image (AMI) that was assigned during registration.For more information, see Find a Linux AMI in the Amazon EC2 User Guide for Linux Instances .
If you specify
InstanceId
, anImageId
is not required.- Parameters:
imageId
- The ID of the Amazon Machine Image (AMI) that was assigned during registration. This parameter is required.- Returns:
this
- See Also:
-
instanceType
Specifies the instance type of the EC2 instance.For information about available instance types, see Available instance types in the Amazon EC2 User Guide for Linux Instances .
If you specify
InstanceId
, anInstanceType
is not required.- Parameters:
instanceType
- Specifies the instance type of the EC2 instance. This parameter is required.- Returns:
this
- See Also:
-
associatePublicIpAddress
@Stability(Stable) public CfnLaunchConfiguration.Builder associatePublicIpAddress(Boolean associatePublicIpAddress) Specifies whether to assign a public IPv4 address to the group's instances.If the instance is launched into a default subnet, the default is to assign a public IPv4 address, unless you disabled the option to assign a public IPv4 address on the subnet. If the instance is launched into a nondefault subnet, the default is not to assign a public IPv4 address, unless you enabled the option to assign a public IPv4 address on the subnet.
If you specify
true
, each instance in the Auto Scaling group receives a unique public IPv4 address. For more information, see Provide network connectivity for your Auto Scaling instances using Amazon VPC in the Amazon EC2 Auto Scaling User Guide .If you specify this property, you must specify at least one subnet for
VPCZoneIdentifier
when you create your group.- Parameters:
associatePublicIpAddress
- Specifies whether to assign a public IPv4 address to the group's instances. This parameter is required.- Returns:
this
- See Also:
-
associatePublicIpAddress
@Stability(Stable) public CfnLaunchConfiguration.Builder associatePublicIpAddress(IResolvable associatePublicIpAddress) Specifies whether to assign a public IPv4 address to the group's instances.If the instance is launched into a default subnet, the default is to assign a public IPv4 address, unless you disabled the option to assign a public IPv4 address on the subnet. If the instance is launched into a nondefault subnet, the default is not to assign a public IPv4 address, unless you enabled the option to assign a public IPv4 address on the subnet.
If you specify
true
, each instance in the Auto Scaling group receives a unique public IPv4 address. For more information, see Provide network connectivity for your Auto Scaling instances using Amazon VPC in the Amazon EC2 Auto Scaling User Guide .If you specify this property, you must specify at least one subnet for
VPCZoneIdentifier
when you create your group.- Parameters:
associatePublicIpAddress
- Specifies whether to assign a public IPv4 address to the group's instances. This parameter is required.- Returns:
this
- See Also:
-
blockDeviceMappings
@Stability(Stable) public CfnLaunchConfiguration.Builder blockDeviceMappings(IResolvable blockDeviceMappings) The block device mapping entries that define the block devices to attach to the instances at launch.By default, the block devices specified in the block device mapping for the AMI are used. For more information, see Block device mappings in the Amazon EC2 User Guide for Linux Instances .
- Parameters:
blockDeviceMappings
- The block device mapping entries that define the block devices to attach to the instances at launch. This parameter is required.- Returns:
this
- See Also:
-
blockDeviceMappings
@Stability(Stable) public CfnLaunchConfiguration.Builder blockDeviceMappings(List<? extends Object> blockDeviceMappings) The block device mapping entries that define the block devices to attach to the instances at launch.By default, the block devices specified in the block device mapping for the AMI are used. For more information, see Block device mappings in the Amazon EC2 User Guide for Linux Instances .
- Parameters:
blockDeviceMappings
- The block device mapping entries that define the block devices to attach to the instances at launch. This parameter is required.- Returns:
this
- See Also:
-
classicLinkVpcId
Available for backward compatibility.- Parameters:
classicLinkVpcId
- Available for backward compatibility. This parameter is required.- Returns:
this
- See Also:
-
classicLinkVpcSecurityGroups
@Stability(Stable) public CfnLaunchConfiguration.Builder classicLinkVpcSecurityGroups(List<String> classicLinkVpcSecurityGroups) Available for backward compatibility.- Parameters:
classicLinkVpcSecurityGroups
- Available for backward compatibility. This parameter is required.- Returns:
this
- See Also:
-
ebsOptimized
Specifies whether the launch configuration is optimized for EBS I/O (true
) or not (false
).The optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization is not available with all instance types. Additional fees are incurred when you enable EBS optimization for an instance type that is not EBS-optimized by default. For more information, see Amazon EBS-optimized instances in the Amazon EC2 User Guide for Linux Instances .
The default value is
false
.- Parameters:
ebsOptimized
- Specifies whether the launch configuration is optimized for EBS I/O (true
) or not (false
). This parameter is required.- Returns:
this
- See Also:
-
ebsOptimized
Specifies whether the launch configuration is optimized for EBS I/O (true
) or not (false
).The optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization is not available with all instance types. Additional fees are incurred when you enable EBS optimization for an instance type that is not EBS-optimized by default. For more information, see Amazon EBS-optimized instances in the Amazon EC2 User Guide for Linux Instances .
The default value is
false
.- Parameters:
ebsOptimized
- Specifies whether the launch configuration is optimized for EBS I/O (true
) or not (false
). This parameter is required.- Returns:
this
- See Also:
-
iamInstanceProfile
@Stability(Stable) public CfnLaunchConfiguration.Builder iamInstanceProfile(String iamInstanceProfile) The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance.The instance profile contains the IAM role. For more information, see IAM role for applications that run on Amazon EC2 instances in the Amazon EC2 Auto Scaling User Guide .
- Parameters:
iamInstanceProfile
- The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. This parameter is required.- Returns:
this
- See Also:
-
instanceId
The ID of the Amazon EC2 instance to use to create the launch configuration.When you use an instance to create a launch configuration, all properties are derived from the instance with the exception of
BlockDeviceMapping
andAssociatePublicIpAddress
. You can override any properties from the instance by specifying them in the launch configuration.- Parameters:
instanceId
- The ID of the Amazon EC2 instance to use to create the launch configuration. This parameter is required.- Returns:
this
- See Also:
-
instanceMonitoring
@Stability(Stable) public CfnLaunchConfiguration.Builder instanceMonitoring(Boolean instanceMonitoring) Controls whether instances in this group are launched with detailed (true
) or basic (false
) monitoring.The default value is
true
(enabled).When detailed monitoring is enabled, Amazon CloudWatch generates metrics every minute and your account is charged a fee. When you disable detailed monitoring, CloudWatch generates metrics every 5 minutes. For more information, see Configure monitoring for Auto Scaling instances in the Amazon EC2 Auto Scaling User Guide .
- Parameters:
instanceMonitoring
- Controls whether instances in this group are launched with detailed (true
) or basic (false
) monitoring. This parameter is required.- Returns:
this
- See Also:
-
instanceMonitoring
@Stability(Stable) public CfnLaunchConfiguration.Builder instanceMonitoring(IResolvable instanceMonitoring) Controls whether instances in this group are launched with detailed (true
) or basic (false
) monitoring.The default value is
true
(enabled).When detailed monitoring is enabled, Amazon CloudWatch generates metrics every minute and your account is charged a fee. When you disable detailed monitoring, CloudWatch generates metrics every 5 minutes. For more information, see Configure monitoring for Auto Scaling instances in the Amazon EC2 Auto Scaling User Guide .
- Parameters:
instanceMonitoring
- Controls whether instances in this group are launched with detailed (true
) or basic (false
) monitoring. This parameter is required.- Returns:
this
- See Also:
-
kernelId
The ID of the kernel associated with the AMI.We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide for Linux Instances .
- Parameters:
kernelId
- The ID of the kernel associated with the AMI. This parameter is required.- Returns:
this
- See Also:
-
keyName
The name of the key pair.For more information, see Amazon EC2 key pairs and Amazon EC2 instances in the Amazon EC2 User Guide for Linux Instances .
- Parameters:
keyName
- The name of the key pair. This parameter is required.- Returns:
this
- See Also:
-
launchConfigurationName
@Stability(Stable) public CfnLaunchConfiguration.Builder launchConfigurationName(String launchConfigurationName) The name of the launch configuration.This name must be unique per Region per account.
- Parameters:
launchConfigurationName
- The name of the launch configuration. This parameter is required.- Returns:
this
- See Also:
-
metadataOptions
@Stability(Stable) public CfnLaunchConfiguration.Builder metadataOptions(IResolvable metadataOptions) The metadata options for the instances.For more information, see Configure the instance metadata options in the Amazon EC2 Auto Scaling User Guide .
- Parameters:
metadataOptions
- The metadata options for the instances. This parameter is required.- Returns:
this
- See Also:
-
metadataOptions
@Stability(Stable) public CfnLaunchConfiguration.Builder metadataOptions(CfnLaunchConfiguration.MetadataOptionsProperty metadataOptions) The metadata options for the instances.For more information, see Configure the instance metadata options in the Amazon EC2 Auto Scaling User Guide .
- Parameters:
metadataOptions
- The metadata options for the instances. This parameter is required.- Returns:
this
- See Also:
-
placementTenancy
The tenancy of the instance, eitherdefault
ordedicated
.An instance with
dedicated
tenancy runs on isolated, single-tenant hardware and can only be launched into a VPC. To launch dedicated instances into a shared tenancy VPC (a VPC with the instance placement tenancy attribute set todefault
), you must set the value of this property todedicated
.If you specify
PlacementTenancy
, you must specify at least one subnet forVPCZoneIdentifier
when you create your group.Valid values:
default
|dedicated
- Parameters:
placementTenancy
- The tenancy of the instance, eitherdefault
ordedicated
. This parameter is required.- Returns:
this
- See Also:
-
ramDiskId
The ID of the RAM disk to select.We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide for Linux Instances .
- Parameters:
ramDiskId
- The ID of the RAM disk to select. This parameter is required.- Returns:
this
- See Also:
-
securityGroups
@Stability(Stable) public CfnLaunchConfiguration.Builder securityGroups(List<String> securityGroups) A list that contains the security groups to assign to the instances in the Auto Scaling group.The list can contain both the IDs of existing security groups and references to SecurityGroup resources created in the template.
For more information, see Control traffic to resources using security groups in the Amazon Virtual Private Cloud User Guide .
- Parameters:
securityGroups
- A list that contains the security groups to assign to the instances in the Auto Scaling group. This parameter is required.- Returns:
this
- See Also:
-
spotPrice
The maximum hourly price to be paid for any Spot Instance launched to fulfill the request.Spot Instances are launched when the price you specify exceeds the current Spot price. For more information, see Request Spot Instances for fault-tolerant and flexible applications in the Amazon EC2 Auto Scaling User Guide .
Valid Range: Minimum value of 0.001
When you change your maximum price by creating a new launch configuration, running instances will continue to run as long as the maximum price for those running instances is higher than the current Spot price.
- Parameters:
spotPrice
- The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. This parameter is required.- Returns:
this
- See Also:
-
userData
The Base64-encoded user data to make available to the launched EC2 instances.For more information, see Instance metadata and user data in the Amazon EC2 User Guide for Linux Instances .
- Parameters:
userData
- The Base64-encoded user data to make available to the launched EC2 instances. This parameter is required.- Returns:
this
- See Also:
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnLaunchConfiguration>
- Returns:
- a newly built instance of
CfnLaunchConfiguration
.
-