LifecyclePolicyDetail

class aws_cdk.aws_imagebuilder_alpha.LifecyclePolicyDetail(*, action, filter, exclusion_rules=None)

Bases: object

(experimental) Configuration details for the lifecycle policy rules.

Parameters:
  • action (Union[LifecyclePolicyAction, Dict[str, Any]]) – (experimental) The action to perform in the lifecycle policy rule.

  • filter (Union[LifecyclePolicyFilter, Dict[str, Any]]) – (experimental) The resource filtering to apply in the lifecycle policy rule.

  • exclusion_rules (Union[LifecyclePolicyExclusionRules, Dict[str, Any], None]) – (experimental) The rules to apply for excluding resources from the lifecycle policy rule. Default: - no exclusion rules are applied on any resource

Stability:

experimental

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_imagebuilder_alpha as imagebuilder_alpha
import aws_cdk as cdk

lifecycle_policy_detail = imagebuilder_alpha.LifecyclePolicyDetail(
    action=imagebuilder_alpha.LifecyclePolicyAction(
        type=imagebuilder_alpha.LifecyclePolicyActionType.DELETE,

        # the properties below are optional
        include_amis=False,
        include_containers=False,
        include_snapshots=False
    ),
    filter=imagebuilder_alpha.LifecyclePolicyFilter(
        age_filter=imagebuilder_alpha.LifecyclePolicyAgeFilter(
            age=cdk.Duration.minutes(30),

            # the properties below are optional
            retain_at_least=123
        ),
        count_filter=imagebuilder_alpha.LifecyclePolicyCountFilter(
            count=123
        )
    ),

    # the properties below are optional
    exclusion_rules=imagebuilder_alpha.LifecyclePolicyExclusionRules(
        ami_exclusion_rules=imagebuilder_alpha.LifecyclePolicyAmiExclusionRules(
            is_public=False,
            last_launched=cdk.Duration.minutes(30),
            regions=["regions"],
            shared_accounts=["sharedAccounts"],
            tags={
                "tags_key": "tags"
            }
        ),
        image_exclusion_rules=imagebuilder_alpha.LifecyclePolicyImageExclusionRules(
            tags={
                "tags_key": "tags"
            }
        )
    )
)

Attributes

action

(experimental) The action to perform in the lifecycle policy rule.

Stability:

experimental

exclusion_rules

(experimental) The rules to apply for excluding resources from the lifecycle policy rule.

Default:
  • no exclusion rules are applied on any resource

Stability:

experimental

filter

(experimental) The resource filtering to apply in the lifecycle policy rule.

Stability:

experimental