Deletes a launch template in a specified region by specifying the LaunchTemplateId or LaunchTemplateName parameter.
Operation description
Take note of the following items:
-
After you delete a launch template, ECS instances that were created by using the launch template are not affected.
-
After you delete a launch template, all versions of the template are also deleted and cannot be recovered. If you want to delete only a specific version of a launch template, see DeleteLaunchTemplateVersion.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DeleteLaunchTemplate |
delete |
LaunchTemplate
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the launch template. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| LaunchTemplateId |
string |
No |
The ID of the launch template. For more information, see DescribeLaunchTemplates. You must specify |
lt-bp1apo0bbbkuy0rj**** |
| LaunchTemplateName |
string |
No |
The name of the launch template. You must specify |
testLaunchTemplateName |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| LaunchTemplateId |
string |
The ID of the launch template. For more information, see DescribeLaunchTemplates. When you use a launch template to create an instance, you must specify |
lt-bp1apo0bbbkuy0rj**** |
| LaunchTemplateVersionNumbers |
object |
||
| versionNumbers |
array |
The collection of deleted launch template version numbers. |
|
|
integer |
The collection of deleted launch template version numbers. |
[3,2,1] |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"LaunchTemplateId": "lt-bp1apo0bbbkuy0rj****",
"LaunchTemplateVersionNumbers": {
"versionNumbers": [
0
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidRegion.NotExist | %s | The specified region does not exist. |
| 400 | MissingParameter | %s | A parameter is not specified. |
| 400 | InvalidParameter | %s | The specified parameter is invalid. |
| 403 | InnerServiceFailed | %s | An internal service cannot be called. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.