delete_launch_template_versions
¶
delete_launch_template_versions(
*,
config_overrides: Optional[EC2ClientConfig] = None,
dry_run: Optional[Boolean] = None,
launch_template_id: Optional[LaunchTemplateId] = None,
launch_template_name: Optional[LaunchTemplateName] = None,
versions: Optional[VersionStringList] = None,
) -> DeleteLaunchTemplateVersionsResult
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.
Parameters:
-
dry_run(Optional[Boolean], default:None) –Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is
DryRunOperation. Otherwise, it isUnauthorizedOperation. -
launch_template_id(Optional[LaunchTemplateId], default:None) –The ID of the launch template.
You must specify either the launch template ID or the launch template name, but not both.
-
launch_template_name(Optional[LaunchTemplateName], default:None) –The name of the launch template.
You must specify either the launch template ID or the launch template name, but not both.
-
versions(Optional[VersionStringList], default:None) –The version numbers of one or more launch template versions to delete. You can specify up to 200 launch template version numbers.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To delete a launch template version This example deletes the specified launch template version.
>>> client.delete_launch_template_versions(launch_template_id='lt-0abcd290751193123', versions=['1'])
Source code in docs_src/capo_ec2/_services/ec2.py
17030 17031 17032 17033 17034 17035 17036 17037 17038 17039 17040 17041 17042 17043 17044 17045 17046 17047 17048 17049 17050 17051 17052 17053 17054 17055 17056 17057 17058 17059 17060 17061 17062 17063 17064 17065 17066 17067 17068 17069 17070 17071 17072 17073 17074 17075 17076 17077 17078 17079 17080 17081 17082 17083 17084 17085 17086 17087 17088 17089 17090 17091 17092 17093 17094 17095 17096 | |