Template name
ACS-ECS-DeleteImage
Template description
Deletes an ECS custom image to free up storage space. Configure the target region, image ID, and force-deletion option.
Template type
Automated
Owner
Alibaba Cloud
Input parameters
|
Parameter |
Description |
Type |
Required |
Default value |
Limit |
|
imageId |
The image ID. |
String |
Yes |
||
|
regionId |
The region ID. |
String |
No |
{{ ACS::RegionId }} |
|
|
force |
Whether to force-delete the image. |
Boolean |
No |
False |
|
|
OOSAssumeRole |
The RAM role assumed by OOS. |
String |
No |
"" |
Output parameters
None
Required permissions
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DeleteImage",
"ecs:DescribeImageSharePermission",
"ecs:ModifyImageSharePermission"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
References
Source code on GitHub: ACS-ECS-DeleteImage.yml.
Template content
FormatVersion: OOS-2019-06-01
Description:
en: 'Deletes an ECS image, applicable to freeing up storage space by removing custom images that are no longer needed. During configuration, users need to provide the following required parameter information: Region ID (regionId), which specifies the region of the ECS image to be deleted, and Image ID (imageId), which identifies the image to be deleted. Additionally, users can choose whether to enforce the deletion (force). Upon execution, the template will confirm the deletion of the specified ECS image.'
zh-cn: the description in Chinese
name-en: Delete Image
name-zh-cn: the description in Chinese
categories:
- image_manage
- application_manage
Parameters:
regionId:
Type: String
Label:
en: RegionId
zh-cn: the description in Chinese
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
imageId:
Label:
en: ImageId
zh-cn: the description in Chinese
Type: String
AssociationProperty: 'ALIYUN::ECS::Image::ImageId'
AssociationPropertyMetadata:
RegionId: regionId
SupportedImageOwnerAlias:
- self
force:
Label:
en: Force
zh-cn: the description in Chinese
Type: Boolean
Default: false
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: the description in Chinese
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: deleteImage
Action: ACS::ECS::DeleteImage
Description:
en: Deletes the specified ECS image
zh-cn: the description in Chinese
Properties:
regionId: '{{ regionId }}'
imageId: '{{ imageId }}'
force: '{{ force }}'
Outputs:
imageId:
ValueSelector: imageId
Type: String
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- regionId
- imageId
- force
Label:
default:
zh-cn: the description in Chinese
en: Select Image
- Parameters:
- OOSAssumeRole
Label:
default:
zh-cn: the description in Chinese
en: Control Options