LifecyclePolicyAction

class aws_cdk.aws_imagebuilder_alpha.LifecyclePolicyAction(*, type, include_amis=None, include_containers=None, include_snapshots=None)

Bases: object

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

Parameters:
  • type (LifecyclePolicyActionType) – (experimental) The action to perform on the resources selected in the lifecycle policy rule.

  • include_amis (Optional[bool]) – (experimental) Whether to include AMIs in the scope of the lifecycle rule. Default: - true for AMI-based policies, false otherwise

  • include_containers (Optional[bool]) – (experimental) Whether to include containers in the scope of the lifecycle rule. Default: - true for container-based policies, false otherwise

  • include_snapshots (Optional[bool]) – (experimental) Whether to include snapshots in the scope of the lifecycle rule. Default: - true for AMI-based policies, false otherwise

Stability:

experimental

ExampleMetadata:

infused

Example:

disabled_policy = imagebuilder.LifecyclePolicy(self, "DisabledPolicy",
    lifecycle_policy_name="my-disabled-policy",
    description="A lifecycle policy that is temporarily disabled",
    status=imagebuilder.LifecyclePolicyStatus.DISABLED,
    resource_type=imagebuilder.LifecyclePolicyResourceType.AMI_IMAGE,
    details=[imagebuilder.LifecyclePolicyDetail(
        action=imagebuilder.LifecyclePolicyAction(type=imagebuilder.LifecyclePolicyActionType.DELETE),
        filter=imagebuilder.LifecyclePolicyFilter(age_filter=imagebuilder.LifecyclePolicyAgeFilter(age=Duration.days(30)))
    )
    ],
    resource_selection=imagebuilder.LifecyclePolicyResourceSelection(
        tags={"Environment": "testing"}
    ),
    tags={
        "Owner": "DevOps",
        "CostCenter": "Engineering"
    }
)

Attributes

include_amis

(experimental) Whether to include AMIs in the scope of the lifecycle rule.

Default:
  • true for AMI-based policies, false otherwise

Stability:

experimental

include_containers

(experimental) Whether to include containers in the scope of the lifecycle rule.

Default:
  • true for container-based policies, false otherwise

Stability:

experimental

include_snapshots

(experimental) Whether to include snapshots in the scope of the lifecycle rule.

Default:
  • true for AMI-based policies, false otherwise

Stability:

experimental

type

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

Stability:

experimental