LifecyclePolicyResourceSelection
- class aws_cdk.aws_imagebuilder_alpha.LifecyclePolicyResourceSelection(*, recipes=None, tags=None)
Bases:
object(experimental) Selection criteria for the resources that the lifecycle policy applies to.
- Parameters:
recipes (
Optional[Sequence[IRecipeBase]]) – (experimental) The list of image recipes or container recipes to apply the lifecycle policy to. Default: - none if tag selections are provided. Otherwise, at least one recipe or tag selection must be providedtags (
Optional[Mapping[str,str]]) – (experimental) Selects EC2 Image Builder images containing any of the provided tags. Default: - none if recipe selections are provided. Otherwise, at least one recipe or tag selection must be provided
- 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
- recipes
(experimental) The list of image recipes or container recipes to apply the lifecycle policy to.
- Default:
none if tag selections are provided. Otherwise, at least one recipe or tag selection must be provided
- Stability:
experimental
- tags
(experimental) Selects EC2 Image Builder images containing any of the provided tags.
- Default:
none if recipe selections are provided. Otherwise, at least one recipe or tag selection must be provided
- Stability:
experimental