ALIYUN::ROS::ResourceCleaner creates a resource cleaner that scans for and cleans up resources.
Supported resource types
ROS continually adds support for more resource types. You can call the GetFeatureDetails operation to obtain the list of supported resource types.
|
Alibaba Cloud service |
Resource type |
|
ACM |
ACM:Namespace |
|
ACTIONTRAIL |
ACTIONTRAIL:Trail |
|
ALB |
|
|
ApiGateway |
|
|
ARMS |
|
|
ASM |
ASM:ServiceMesh |
|
CAS |
CAS:Certificate |
|
CDDC |
CDDC:DedicatedHostGroup |
|
CDN |
CDN:Domain |
|
ClickHouse |
ClickHouse:DBCluster |
|
CloudPhone |
CloudPhone:InstanceGroup |
|
CMS |
|
|
CS |
CS:Cluster |
|
CR |
CR:Instance |
|
DATAHUB |
DATAHUB:Project |
|
DCDN |
DCDN:Domain |
|
DFS |
|
|
DirectMail |
|
|
DNS |
|
|
DRDS |
DRDS:DrdsInstance |
|
ECI |
|
|
ECS |
|
|
VPC |
|
|
RAM |
|
|
RDS |
RDS:DBInstance |
|
ROS |
ROS:Template |
|
SLB |
|
|
ENS |
ENS:Instance |
|
ESS |
|
|
ECI |
|
|
FNF |
FNF:Flow |
|
GPDB |
GPDB:DBInstance |
|
KMS |
|
|
KAFKA |
KAFKA:Instance |
|
MONGODB |
MONGODB:Instance |
|
Memcache |
Memcache:Instance |
|
MSE |
|
|
MNS |
|
|
REDIS |
REDIS:Instance |
|
SLS |
SLS:Project |
|
FC |
FC:Service |
|
NAS |
|
|
NLB |
|
|
OTS |
OTS:Instance |
|
OSS |
OSS:Bucket |
|
OOS |
|
|
POLARDB |
POLARDB:DBCluster |
|
PrivateLink |
|
|
DRDS |
DRDS:DrdsInstance |
|
ROCKETMQ |
ROCKETMQ:Instance |
|
ADB |
ADB:DBCluster |
|
EDAS |
|
|
EMR |
EMR:Cluster |
|
ElasticSearch |
ElasticSearch:Instance |
|
HBR |
HBR:DBVault |
|
PVTZ |
PVTZ:Zone |
|
SAE |
|
|
SAG |
|
|
TSDB |
TSDB:HiTSDBInstance |
|
WAF |
WAF:Domain |
Syntax
{
"Type": "ALIYUN::ROS::ResourceCleaner",
"Properties": {
"Action": String,
"ResourceFilters": List,
"Resources": List,
"Mode": String,
"FailureOption": String,
"CleanUpRetryCount": Integer,
"CleanUpTimeout": Number,
"ExcludedResources": List,
"CleanUpAlgorithm": String,
"ResourceTypeOrder": List,
"DisabledSideEffects": List
}
}
Properties
|
Property Name |
Type |
Required |
Update allowed |
Description |
Constraints |
|
Action |
String |
Yes |
Yes |
The action that the resource cleaner performs. |
Valid values:
|
|
ResourceFilters |
List |
No |
Yes |
The resource filters used by the resource cleaner to scan for resources that need to be cleaned up. |
The list can contain up to 100 filters. You can specify either ResourceFilters or Resources, but not both. If the list of resource filters is changed during an update, the resource cleaner rescans the resources. If the Action is set to CleanUp, the operation fails. Filters have two effects: Allow and Deny. They work as follows (a smaller number indicates a higher priority):
For more information, see ResourceFilters properties. |
|
Resources |
List |
No |
Yes |
The resources to clean up. |
The list can contain 1 to 1,000 resources. You can specify either ResourceFilters or Resources, but not both. For more information, see Resources properties. |
|
Mode |
String |
No |
Yes |
The execution mode of the resource cleaner. |
Valid values:
|
|
FailureOption |
String |
No |
Yes |
The behavior for dependent resources when a resource cleanup fails. |
Valid values:
Note
The dependency is a deletion dependency, not a creation dependency. |
|
CleanUpRetryCount |
Integer |
No |
Yes |
The maximum number of cleanup retries. |
Valid values: 1 to 6. The default value is 1, which means no retries. A retry is triggered if one of the following conditions is met:
|
|
CleanUpTimeout |
Number |
No |
Yes |
The timeout period for resource cleanup. |
Valid values: 60 to 14400. Unit: seconds. Default value: 3600. |
|
ExcludedResources |
List |
No |
Yes |
The resources to exclude from cleanup. |
The list can contain 1 to 1,000 resources. Each item can exclude only one resource. If an item is ambiguous and points to multiple resources, the operation fails. Specify more fields to remove ambiguity. For more information, see ExcludedResources properties. |
|
CleanUpAlgorithm |
String |
No |
Yes |
The resource cleanup algorithm. |
Valid values:
|
|
ResourceTypeOrder |
List |
No |
Yes |
The cleanup order of resource types. |
The number of items in the list must be in the range of 1 to 1,000. This parameter takes effect only when CleanUpAlgorithm is set to ResourceTypeOrder. Resources of types not specified in the list are not scanned or cleaned up. For information about valid resource types, see Supported resource types. |
|
DisabledSideEffects |
List |
No |
Yes |
The side effects to disable during cleanup. |
The list can contain 1 to 50 items. Each item can consist of letters, digits, and wildcard characters. The length of each item is 1 to 100 characters. Only the Cleaning up some types of resources can have side effects. You can call the GetFeatureDetails operation to query them. |
ResourceFilters syntax
"ResourceFilters": [
{
"IncludeDeletionProtection": Boolean,
"ResourceTypePatterns": List,
"ResourceIds": List,
"RegionIds": List,
"ResourceGroupIds": List,
"Effect": String,
"ResourceNamePatterns": List,
"Tags": List
}
]
ResourceFilters properties
|
Property name |
Type |
Required |
Update allowed |
Description |
Constraints |
|
IncludeDeletionProtection |
Boolean |
No |
Yes |
Specifies whether to include resources that have deletion protection enabled. |
Valid values:
|
|
ResourceTypePatterns |
List |
No |
Yes |
A list of patterns for resource types to filter. For information about resource types, see Supported resource types. |
The list can contain 1 to 100 patterns. A resource passes this filter if its type matches any pattern in the list. Only the Each pattern in the list must be in the |
|
ResourceIds |
List |
No |
Yes |
A list of resource IDs to filter. |
The list can contain 1 to 100 IDs. A resource passes this filter if its ID matches any ID in the list. A list item can be 1 to 256 characters long. |
|
RegionIds |
List |
No |
Yes |
A list of regions to filter. |
The length of the list must be from 1 to 100. A resource passes this filter if its region matches any region in the list. A list item must be 1 to 64 characters in length. |
|
ResourceGroupIds |
List |
No |
Yes |
A list of resource groups to filter. |
The length of the list ranges from 1 to 100. A resource passes this filter if it belongs to any resource group in the list. The length of a list item must be from 1 to 256 characters. |
|
Effect |
String |
No |
Yes |
The filter effect. |
Valid values:
|
|
ResourceNamePatterns |
List |
No |
Yes |
The resource name patterns to filter by. |
The list can contain 1 to 100 patterns. A resource passes this filter if its name matches any pattern in the list. Only the Resource names only support letters, numbers, Chinese characters, spaces, The length of a list item can range from 1 to 100. |
|
Tags |
List |
No |
Yes |
The tags to filter by. Both custom tags and system tags are supported. |
The list must contain 1 to 100 items. Matching rules:
For more information, see Tags properties. |
Tags syntax
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags properties
|
Property name |
Type |
Required |
Update allowed |
Description |
Constraints |
|
Value |
String |
No |
Yes |
The tag value. |
Length: 0 to 256 characters. Note
Omitting this value is different from specifying an empty string. |
|
Key |
String |
Yes |
Yes |
The tag key. |
Length: 1 to 256 characters. |
Resources syntax
"Resources": [
{
"ResourceId": String,
"ResourceType": String,
"RegionId": String
}
]
Resources properties
|
Property Name |
Type |
Required |
Update allowed |
Description |
Constraints |
|
ResourceId |
String |
Yes |
Yes |
The ID of the resource to be cleaned up. |
Length: 1 to 256 characters. |
|
ResourceType |
String |
Yes |
Yes |
The type of the resource to be cleaned up. |
For more information, see Supported resource types. |
|
RegionId |
String |
Yes |
Yes |
The region ID of the resource to be cleaned up. |
Length: 1 to 64 characters. |
ExcludedResources syntax
"ExcludedResources": [
{
"ResourceId": String,
"ResourceType": String,
"RegionId": String
}
]
ExcludedResources properties
|
Property name |
Type |
Required |
Update allowed |
Description |
Constraints |
|
ResourceId |
String |
Yes |
Yes |
The ID of the resource to be excluded. |
Length: 1 to 256 characters. |
|
ResourceType |
String |
No |
Yes |
The type of the resource to be excluded. |
For more information, see Supported resource types. |
|
RegionId |
String |
No |
Yes |
The region ID of the resource to be excluded. |
Length: 1 to 64 characters. |
Return values
Fn::GetAtt
-
ResourceDetails: The details of the resources to clean up. The value is a list of dictionaries with the following fields:
Field
Type
Description
ResourceType
String
The resource type.
RegionId
String
The region ID of the resource.
ResourceId
String
The resource ID.
ResourceName
String
The resource name.
CleanupType
String
The cleanup type of the resource. Valid values:
-
Normal: The resource can be deleted normally.
-
DeleteWithInstance: The resource is deleted along with the resource to which it belongs. If the resource to which it belongs is filtered or excluded, deletion may fail. See CleanupTypeReasons for details.
-
UnableToDelete: The resource cannot be deleted. See CleanupTypeReasons for details.
CleanupTypeReasons
List
A list of reasons for the resource cleanup type.
ResourceStatus
String
The status of the resource. Valid values:
-
Deleting: The resource is being deleted.
-
Failure: The resource failed to be deleted.
-
Success: The resource was deleted.
-
Skipped: The resource deletion was skipped.
-
Pending: The resource is pending deletion.
ResourceStatusReason
String
The reason for the resource status.
Dependencies
List
The deletion dependencies of the resource. The value is a list of dictionaries with the following fields:
-
ResourceType: The resource type of the dependent resource.
-
RegionId: The region ID of the dependent resource.
-
ResourceId: The ID of the dependent resource.
-
-
ResourcePartialDetails: A simplified version of ResourceDetails that includes only the ResourceType, RegionId, ResourceId, ResourceName, ResourceStatus, and ResourceStatusReason fields.
-
NoCleanupResourceDetails: The details of resources that are scanned but not cleaned up. The format is the same as ResourceDetails.
-
NoCleanupResourcePartialDetails: A simplified version of NoCleanupResourceDetails that includes only the ResourceType, RegionId, ResourceId, ResourceName, ResourceStatus, and ResourceStatusReason fields.
-
ResourceSummary: A summary of the resources to clean up. The value is a list of dictionaries with the following fields:
Field
Type
Description
ResourceType
String
The resource type.
DeletingCount
Integer
The number of resources being deleted.
SuccessCount
Integer
The number of deleted resources.
FailureCount
Integer
The number of resources that failed to be deleted.
SkippedCount
Integer
The number of resources whose deletion was skipped.
PendingCount
Integer
The number of resources pending deletion.
OtherCount
Integer
The number of resources in other states.
TotalCount
Integer
The total number of resources.
-
ScanErrors: The errors that occurred during scanning. This parameter is returned only when Mode is set to Loose. The value is a list of dictionaries with the following fields:
Field
Type
Description
ResourceType
String
The resource type.
RegionId
String
The region ID.
ErrorMessage
String
The error message for the scan of the specified region and resource type.
-
CleanResult: The overall cleanup result. Valid values:
-
Success: All resources were cleaned up.
-
ResourceFailure: The cleanup of some resources failed.
-
Timeout: The cleanup timed out.
-
CheckFailure: The cleanup precheck failed.
-
UnknownFailure: An unknown error occurred.
-
UserCancelled: The operation was canceled by the user.
-
None: No cleanup was triggered.
-