deleteLaunchTemplateVersions
inline suspend fun Ec2Client.deleteLaunchTemplateVersions(crossinline block: DeleteLaunchTemplateVersionsRequest.Builder.() -> Unit): DeleteLaunchTemplateVersionsResponse
Deletes one or more versions of a launch template.
You can't delete the default version of a launch template; you must first assign a different version as the default. If the default version is the only version for the launch template, you must delete the entire launch template using DeleteLaunchTemplate.
You can delete up to 200 launch template versions in a single request. To delete more than 200 versions in a single request, use DeleteLaunchTemplate, which deletes the launch template and all of its versions.
For more information, see Delete a launch template version in the Amazon EC2 User Guide.
Samples
fun main() {
//sampleStart
// This example deletes the specified launch template version.
val resp = ec2Client.deleteLaunchTemplateVersions {
launchTemplateId = "lt-0abcd290751193123"
versions = listOf<String>(
"1"
)
}
//sampleEnd
}