createLaunchConfiguration
Creates a launch configuration.
If you exceed your maximum limit of launch configurations, the call fails. To query this limit, call the DescribeAccountLimits API. For information about updating this limit, see Quotas for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
For more information, see Launch configurations in the Amazon EC2 Auto Scaling User Guide.
Amazon EC2 Auto Scaling configures instances launched as part of an Auto Scaling group using either a launch template or a launch configuration. We strongly recommend that you do not use launch configurations. They do not provide full functionality for Amazon EC2 Auto Scaling or Amazon EC2. For information about using launch templates, see Launch templates in the Amazon EC2 Auto Scaling User Guide.
Samples
fun main() {
//sampleStart
// This example creates a launch configuration.
autoScalingClient.createLaunchConfiguration {
launchConfigurationName = "my-launch-config"
imageId = "ami-12345678"
securityGroups = listOf<String>(
"sg-eb2af88e"
)
instanceType = "m3.medium"
iamInstanceProfile = "my-iam-role"
}
//sampleEnd
}