Skip to content

ResourceCleanerProps

Properties for defining a ResourceCleaner.

See https://www.alibabacloud.com/help/ros/developer-reference/aliyun-ros-resourcecleaner

Initializer

import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkros"
&alicloudroscdkros.ResourceCleanerProps {
    Action: interface{},
    CleanUpAlgorithm: interface{},
    CleanUpRetryCount: interface{},
    CleanUpTimeout: interface{},
    DisabledSideEffects: interface{},
    ExcludedResources: interface{},
    FailureOption: interface{},
    Mode: interface{},
    ResourceFilters: interface{},
    Resources: interface{},
    ResourceTypeOrder: interface{},
}

Properties

Name Type Description
Action interface{} Property action: Resource cleaner actions: - Scan: Scanning phase.
CleanUpAlgorithm interface{} Property cleanUpAlgorithm: The cleanup algorithm of cleanup phase: - ResourceDependency: Clean up by resource dependency tree.
CleanUpRetryCount interface{} Property cleanUpRetryCount: The maximum number of executions of cleanup phase.
CleanUpTimeout interface{} Property cleanUpTimeout: The timeout seconds of executions of cleanup phase.
DisabledSideEffects interface{} Property disabledSideEffects: Side effects to be disabled.
ExcludedResources interface{} Property excludedResources: Exclude parts from resources to be cleaned up.
FailureOption interface{} Property failureOption: The failure option of cleanup phase: - Normal: Resource failure does not affect the resources that depend on it.
Mode interface{} Property mode: The result mode of resource cleaner: - Strict: Any scanning or cleanup failure leads to the failure of the cleaner.
ResourceFilters interface{} Property resourceFilters: Resource filters that ResourceCleaner uses to filter out the resources to be cleaned up during scanning.
Resources interface{} Property resources: Resources to be cleaned up.
ResourceTypeOrder interface{} Property resourceTypeOrder: This property takes effect only when property CleanUpAlgorithm is ResourceTypeOrder.

ActionRequired

Action interface{}
  • Type: interface{}

Property action: Resource cleaner actions: - Scan: Scanning phase.

Scan out the resources to be cleaned up.

  • CleanUp: Cleanup phase. Clean up the scanned resources. It it not allowed for resource creation.
  • Scan+CleanUp: Scan first, then CleanUp.
  • ScanWhenCreatingAndUpdating+CleanUpWhenDeleting: Scan when creating or updating resource, and CleanUp when deleting stack.

CleanUpAlgorithmOptional

CleanUpAlgorithm interface{}
  • Type: interface{}

Property cleanUpAlgorithm: The cleanup algorithm of cleanup phase: - ResourceDependency: Clean up by resource dependency tree.

  • ResourceTypeOrder: Clean up by resource type order. Property ResourceTypeOrder can be used to specify resource type order. If it is not specified, a default order will be used. Default to ResourceDependency.

CleanUpRetryCountOptional

CleanUpRetryCount interface{}
  • Type: interface{}

Property cleanUpRetryCount: The maximum number of executions of cleanup phase.

Default to 1, which means no retry. Conditions that trigger a retry: (the relationship is or) 1.There are resources which fail to be cleaned up. 2.The cleanup is timeout.


CleanUpTimeoutOptional

CleanUpTimeout interface{}
  • Type: interface{}

Property cleanUpTimeout: The timeout seconds of executions of cleanup phase.

Default to 1 hour.


DisabledSideEffectsOptional

DisabledSideEffects interface{}
  • Type: interface{}

Property disabledSideEffects: Side effects to be disabled.

Cleaning up some resources will cause some side effects. If is not expected, use the property to disable them. The side effects can be found in response(ResourceCleaner) of API GetFeatureDetails.


ExcludedResourcesOptional

ExcludedResources interface{}
  • Type: interface{}

Property excludedResources: Exclude parts from resources to be cleaned up.


FailureOptionOptional

FailureOption interface{}
  • Type: interface{}

Property failureOption: The failure option of cleanup phase: - Normal: Resource failure does not affect the resources that depend on it.

  • Fast: Resource failure causes all resources that depend on it to fail. Default to Normal.

ModeOptional

Mode interface{}
  • Type: interface{}

Property mode: The result mode of resource cleaner: - Strict: Any scanning or cleanup failure leads to the failure of the cleaner.

  • Loose: Only a little scanning and cleanup failures lead to the failure of the cleaner. Most scanning failures will be ignored, failure messages can be found in ScanErrors or ResourceDetails. Most cleanup failures will be ignored, failure messages can be found in ResourceDetails. Default to Loose.

ResourceFiltersOptional

ResourceFilters interface{}
  • Type: interface{}

Property resourceFilters: Resource filters that ResourceCleaner uses to filter out the resources to be cleaned up during scanning.

Only one of ResourceFilters and Resources can be specified. There are two filtering behaviors(Effect): Allow and Deny. The filters work as below: 1.Any resource denied by any Deny filter will not be cleaned up. 2.Only resources allowed by some Allow filter and not denied by any Deny filter will be cleaned up. If filters are changed during resource update, ResourceCleaner requires to rescan. And if Action equals CleanUp, an error occurs.


ResourcesOptional

Resources interface{}
  • Type: interface{}

Property resources: Resources to be cleaned up.

Only one of Resources and ResourceFilters can be specified.


ResourceTypeOrderOptional

ResourceTypeOrder interface{}
  • Type: interface{}

Property resourceTypeOrder: This property takes effect only when property CleanUpAlgorithm is ResourceTypeOrder.

If it takes effect:

  • Resources will be cleaned up in order from front to back.
  • Resource with resource type not specified in this property will not be cleaned up.