Skip to content

ResourceCleanerProps

Properties for defining a ResourceCleaner.

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

Initializer

import { ResourceCleanerProps } from '@alicloud/ros-cdk-ros'
const resourceCleanerProps: ResourceCleanerProps = { ... }

Properties

Name Type Description
action string | @alicloud/ros-cdk-core.IResolvable Property action: Resource cleaner actions: - Scan: Scanning phase.
cleanUpAlgorithm string | @alicloud/ros-cdk-core.IResolvable Property cleanUpAlgorithm: The cleanup algorithm of cleanup phase: - ResourceDependency: Clean up by resource dependency tree.
cleanUpRetryCount number | @alicloud/ros-cdk-core.IResolvable Property cleanUpRetryCount: The maximum number of executions of cleanup phase.
cleanUpTimeout number | @alicloud/ros-cdk-core.IResolvable Property cleanUpTimeout: The timeout seconds of executions of cleanup phase.
disabledSideEffects @alicloud/ros-cdk-core.IResolvable | string | @alicloud/ros-cdk-core.IResolvable[] Property disabledSideEffects: Side effects to be disabled.
excludedResources @alicloud/ros-cdk-core.IResolvable | @alicloud/ros-cdk-core.IResolvable | ExcludedResourcesProperty[] Property excludedResources: Exclude parts from resources to be cleaned up.
failureOption string | @alicloud/ros-cdk-core.IResolvable Property failureOption: The failure option of cleanup phase: - Normal: Resource failure does not affect the resources that depend on it.
mode string | @alicloud/ros-cdk-core.IResolvable Property mode: The result mode of resource cleaner: - Strict: Any scanning or cleanup failure leads to the failure of the cleaner.
resourceFilters @alicloud/ros-cdk-core.IResolvable | @alicloud/ros-cdk-core.IResolvable | ResourceFiltersProperty[] Property resourceFilters: Resource filters that ResourceCleaner uses to filter out the resources to be cleaned up during scanning.
resources @alicloud/ros-cdk-core.IResolvable | @alicloud/ros-cdk-core.IResolvable | ResourcesProperty[] Property resources: Resources to be cleaned up.
resourceTypeOrder @alicloud/ros-cdk-core.IResolvable | string | @alicloud/ros-cdk-core.IResolvable[] Property resourceTypeOrder: This property takes effect only when property CleanUpAlgorithm is ResourceTypeOrder.

actionRequired

public readonly action: string | IResolvable;
  • Type: string | @alicloud/ros-cdk-core.IResolvable

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

public readonly cleanUpAlgorithm: string | IResolvable;
  • Type: string | @alicloud/ros-cdk-core.IResolvable

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

public readonly cleanUpRetryCount: number | IResolvable;
  • Type: number | @alicloud/ros-cdk-core.IResolvable

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

public readonly cleanUpTimeout: number | IResolvable;
  • Type: number | @alicloud/ros-cdk-core.IResolvable

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

Default to 1 hour.


disabledSideEffectsOptional

public readonly disabledSideEffects: IResolvable | string | IResolvable[];
  • Type: @alicloud/ros-cdk-core.IResolvable | string | @alicloud/ros-cdk-core.IResolvable[]

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

public readonly excludedResources: IResolvable | IResolvable | ExcludedResourcesProperty[];

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


failureOptionOptional

public readonly failureOption: string | IResolvable;
  • Type: string | @alicloud/ros-cdk-core.IResolvable

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

public readonly mode: string | IResolvable;
  • Type: string | @alicloud/ros-cdk-core.IResolvable

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

public readonly resourceFilters: IResolvable | IResolvable | ResourceFiltersProperty[];

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

public readonly resources: IResolvable | IResolvable | ResourcesProperty[];
  • Type: @alicloud/ros-cdk-core.IResolvable | @alicloud/ros-cdk-core.IResolvable | ResourcesProperty[]

Property resources: Resources to be cleaned up.

Only one of Resources and ResourceFilters can be specified.


resourceTypeOrderOptional

public readonly resourceTypeOrder: IResolvable | string | IResolvable[];
  • Type: @alicloud/ros-cdk-core.IResolvable | string | @alicloud/ros-cdk-core.IResolvable[]

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.