Skip to content

ResourceCleanerProps

Properties for defining a ResourceCleaner.

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

Initializer

import ros_cdk_ros
ros_cdk_ros.ResourceCleanerProps(
  action: typing.Union[str, IResolvable],
  clean_up_algorithm: typing.Union[str, IResolvable] = None,
  clean_up_retry_count: typing.Union[typing.Union[int, float], IResolvable] = None,
  clean_up_timeout: typing.Union[typing.Union[int, float], IResolvable] = None,
  disabled_side_effects: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
  excluded_resources: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ExcludedResourcesProperty]]] = None,
  failure_option: typing.Union[str, IResolvable] = None,
  mode: typing.Union[str, IResolvable] = None,
  resource_filters: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ResourceFiltersProperty]]] = None,
  resources: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ResourcesProperty]]] = None,
  resource_type_order: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None
)

Properties

Name Type Description
action typing.Union[str, ros_cdk_core.IResolvable] Property action: Resource cleaner actions: - Scan: Scanning phase.
clean_up_algorithm typing.Union[str, ros_cdk_core.IResolvable] Property cleanUpAlgorithm: The cleanup algorithm of cleanup phase: - ResourceDependency: Clean up by resource dependency tree.
clean_up_retry_count typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property cleanUpRetryCount: The maximum number of executions of cleanup phase.
clean_up_timeout typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property cleanUpTimeout: The timeout seconds of executions of cleanup phase.
disabled_side_effects typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property disabledSideEffects: Side effects to be disabled.
excluded_resources typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ExcludedResourcesProperty]]] Property excludedResources: Exclude parts from resources to be cleaned up.
failure_option typing.Union[str, 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 typing.Union[str, 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.
resource_filters typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ResourceFiltersProperty]]] Property resourceFilters: Resource filters that ResourceCleaner uses to filter out the resources to be cleaned up during scanning.
resources typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ResourcesProperty]]] Property resources: Resources to be cleaned up.
resource_type_order typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property resourceTypeOrder: This property takes effect only when property CleanUpAlgorithm is ResourceTypeOrder.

actionRequired

action: typing.Union[str, IResolvable]
  • Type: typing.Union[str, 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.

clean_up_algorithmOptional

clean_up_algorithm: typing.Union[str, IResolvable]
  • Type: typing.Union[str, 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.

clean_up_retry_countOptional

clean_up_retry_count: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], 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.


clean_up_timeoutOptional

clean_up_timeout: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

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

Default to 1 hour.


disabled_side_effectsOptional

disabled_side_effects: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]]
  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, 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.


excluded_resourcesOptional

excluded_resources: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ExcludedResourcesProperty]]]
  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ExcludedResourcesProperty]]]

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


failure_optionOptional

failure_option: typing.Union[str, IResolvable]
  • Type: typing.Union[str, 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

mode: typing.Union[str, IResolvable]
  • Type: typing.Union[str, 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.

resource_filtersOptional

resource_filters: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ResourceFiltersProperty]]]
  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.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

resources: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ResourcesProperty]]]
  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ResourcesProperty]]]

Property resources: Resources to be cleaned up.

Only one of Resources and ResourceFilters can be specified.


resource_type_orderOptional

resource_type_order: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]]
  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, 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.