CfnLifecyclePolicyPropsMixin
- class aws_cdk.mixins_preview.aws_imagebuilder.mixins.CfnLifecyclePolicyPropsMixin(props, *, strategy=None)
Bases:
MixinCreate a lifecycle policy resource.
- See:
- CloudformationResource:
AWS::ImageBuilder::LifecyclePolicy
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins cfn_lifecycle_policy_props_mixin = imagebuilder_mixins.CfnLifecyclePolicyPropsMixin(imagebuilder_mixins.CfnLifecyclePolicyMixinProps( description="description", execution_role="executionRole", name="name", policy_details=[imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.PolicyDetailProperty( action=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.ActionProperty( include_resources=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.IncludeResourcesProperty( amis=False, containers=False, snapshots=False ), type="type" ), exclusion_rules=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.ExclusionRulesProperty( amis=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.AmiExclusionRulesProperty( is_public=False, last_launched=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.LastLaunchedProperty( unit="unit", value=123 ), regions=["regions"], shared_accounts=["sharedAccounts"], tag_map={ "tag_map_key": "tagMap" } ), tag_map={ "tag_map_key": "tagMap" } ), filter=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.FilterProperty( retain_at_least=123, type="type", unit="unit", value=123 ) )], resource_selection=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.ResourceSelectionProperty( recipes=[imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.RecipeSelectionProperty( name="name", semantic_version="semanticVersion" )], tag_map={ "tag_map_key": "tagMap" } ), resource_type="resourceType", status="status", tags={ "tags_key": "tags" } ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::ImageBuilder::LifecyclePolicy.- Parameters:
props (
Union[CfnLifecyclePolicyMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['description', 'executionRole', 'name', 'policyDetails', 'resourceSelection', 'resourceType', 'status', 'tags']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
ActionProperty
- class CfnLifecyclePolicyPropsMixin.ActionProperty(*, include_resources=None, type=None)
Bases:
objectContains selection criteria for the lifecycle policy.
- Parameters:
include_resources (
Union[IResolvable,IncludeResourcesProperty,Dict[str,Any],None]) – Specifies the resources that the lifecycle policy applies to.type (
Optional[str]) – Specifies the lifecycle action to take.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins action_property = imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.ActionProperty( include_resources=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.IncludeResourcesProperty( amis=False, containers=False, snapshots=False ), type="type" )
Attributes
- include_resources
Specifies the resources that the lifecycle policy applies to.
- type
Specifies the lifecycle action to take.
AmiExclusionRulesProperty
- class CfnLifecyclePolicyPropsMixin.AmiExclusionRulesProperty(*, is_public=None, last_launched=None, regions=None, shared_accounts=None, tag_map=None)
Bases:
objectDefines criteria for AMIs that are excluded from lifecycle actions.
- Parameters:
is_public (
Union[bool,IResolvable,None]) – Configures whether public AMIs are excluded from the lifecycle action.last_launched (
Union[IResolvable,LastLaunchedProperty,Dict[str,Any],None]) – Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle actions.regions (
Optional[Sequence[str]]) – Configures AWS Region s that are excluded from the lifecycle action.shared_accounts (
Optional[Sequence[str]]) – Specifies AWS account s whose resources are excluded from the lifecycle action.tag_map (
Union[Mapping[str,str],IResolvable,None]) – Lists tags that should be excluded from lifecycle actions for the AMIs that have them.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins ami_exclusion_rules_property = imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.AmiExclusionRulesProperty( is_public=False, last_launched=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.LastLaunchedProperty( unit="unit", value=123 ), regions=["regions"], shared_accounts=["sharedAccounts"], tag_map={ "tag_map_key": "tagMap" } )
Attributes
- is_public
Configures whether public AMIs are excluded from the lifecycle action.
- last_launched
Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle actions.
- regions
Configures AWS Region s that are excluded from the lifecycle action.
Specifies AWS account s whose resources are excluded from the lifecycle action.
- tag_map
Lists tags that should be excluded from lifecycle actions for the AMIs that have them.
ExclusionRulesProperty
- class CfnLifecyclePolicyPropsMixin.ExclusionRulesProperty(*, amis=None, tag_map=None)
Bases:
objectSpecifies resources that lifecycle policy actions should not apply to.
- Parameters:
amis (
Union[IResolvable,AmiExclusionRulesProperty,Dict[str,Any],None]) – Lists configuration values that apply to AMIs that Image Builder should exclude from the lifecycle action.tag_map (
Union[Mapping[str,str],IResolvable,None]) – Contains a list of tags that Image Builder uses to skip lifecycle actions for Image Builder image resources that have them.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins exclusion_rules_property = imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.ExclusionRulesProperty( amis=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.AmiExclusionRulesProperty( is_public=False, last_launched=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.LastLaunchedProperty( unit="unit", value=123 ), regions=["regions"], shared_accounts=["sharedAccounts"], tag_map={ "tag_map_key": "tagMap" } ), tag_map={ "tag_map_key": "tagMap" } )
Attributes
- amis
Lists configuration values that apply to AMIs that Image Builder should exclude from the lifecycle action.
- tag_map
Contains a list of tags that Image Builder uses to skip lifecycle actions for Image Builder image resources that have them.
FilterProperty
- class CfnLifecyclePolicyPropsMixin.FilterProperty(*, retain_at_least=None, type=None, unit=None, value=None)
Bases:
objectDefines filters that the lifecycle policy uses to determine impacted resource.
- Parameters:
retain_at_least (
Union[int,float,None]) – For age-based filters, this is the number of resources to keep on hand after the lifecycleDELETEaction is applied. Impacted resources are only deleted if you have more than this number of resources. If you have fewer resources than this number, the impacted resource is not deleted.type (
Optional[str]) – Filter resources based on eitherageorcount.unit (
Optional[str]) – Defines the unit of time that the lifecycle policy uses to determine impacted resources. This is required for age-based rules.value (
Union[int,float,None]) – The number of units for the time period or for the count. For example, a value of6might refer to six months or six AMIs. .. epigraph:: For count-based filters, this value represents the minimum number of resources to keep on hand. If you have fewer resources than this number, the resource is excluded from lifecycle actions.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins filter_property = imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.FilterProperty( retain_at_least=123, type="type", unit="unit", value=123 )
Attributes
- retain_at_least
For age-based filters, this is the number of resources to keep on hand after the lifecycle
DELETEaction is applied.Impacted resources are only deleted if you have more than this number of resources. If you have fewer resources than this number, the impacted resource is not deleted.
- type
Filter resources based on either
ageorcount.
- unit
Defines the unit of time that the lifecycle policy uses to determine impacted resources.
This is required for age-based rules.
- value
The number of units for the time period or for the count.
For example, a value of
6might refer to six months or six AMIs. .. epigraph:For count-based filters, this value represents the minimum number of resources to keep on hand. If you have fewer resources than this number, the resource is excluded from lifecycle actions.
IncludeResourcesProperty
- class CfnLifecyclePolicyPropsMixin.IncludeResourcesProperty(*, amis=None, containers=None, snapshots=None)
Bases:
objectSpecifies how the lifecycle policy should apply actions to selected resources.
- Parameters:
amis (
Union[bool,IResolvable,None]) – Specifies whether the lifecycle action should apply to distributed AMIs.containers (
Union[bool,IResolvable,None]) – Specifies whether the lifecycle action should apply to distributed containers.snapshots (
Union[bool,IResolvable,None]) – Specifies whether the lifecycle action should apply to snapshots associated with distributed AMIs.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins include_resources_property = imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.IncludeResourcesProperty( amis=False, containers=False, snapshots=False )
Attributes
- amis
Specifies whether the lifecycle action should apply to distributed AMIs.
- containers
Specifies whether the lifecycle action should apply to distributed containers.
- snapshots
Specifies whether the lifecycle action should apply to snapshots associated with distributed AMIs.
LastLaunchedProperty
- class CfnLifecyclePolicyPropsMixin.LastLaunchedProperty(*, unit=None, value=None)
Bases:
objectDefines criteria to exclude AMIs from lifecycle actions based on the last time they were used to launch an instance.
- Parameters:
unit (
Optional[str]) – Defines the unit of time that the lifecycle policy uses to calculate elapsed time since the last instance launched from the AMI. For example: days, weeks, months, or years.value (
Union[int,float,None]) – The integer number of units for the time period. For example6(months).
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins last_launched_property = imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.LastLaunchedProperty( unit="unit", value=123 )
Attributes
- unit
Defines the unit of time that the lifecycle policy uses to calculate elapsed time since the last instance launched from the AMI.
For example: days, weeks, months, or years.
- value
The integer number of units for the time period.
For example
6(months).
PolicyDetailProperty
- class CfnLifecyclePolicyPropsMixin.PolicyDetailProperty(*, action=None, exclusion_rules=None, filter=None)
Bases:
objectThe configuration details for a lifecycle policy resource.
- Parameters:
action (
Union[IResolvable,ActionProperty,Dict[str,Any],None]) – Configuration details for the policy action.exclusion_rules (
Union[IResolvable,ExclusionRulesProperty,Dict[str,Any],None]) – Additional rules to specify resources that should be exempt from policy actions.filter (
Union[IResolvable,FilterProperty,Dict[str,Any],None]) – Specifies the resources that the lifecycle policy applies to.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins policy_detail_property = imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.PolicyDetailProperty( action=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.ActionProperty( include_resources=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.IncludeResourcesProperty( amis=False, containers=False, snapshots=False ), type="type" ), exclusion_rules=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.ExclusionRulesProperty( amis=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.AmiExclusionRulesProperty( is_public=False, last_launched=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.LastLaunchedProperty( unit="unit", value=123 ), regions=["regions"], shared_accounts=["sharedAccounts"], tag_map={ "tag_map_key": "tagMap" } ), tag_map={ "tag_map_key": "tagMap" } ), filter=imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.FilterProperty( retain_at_least=123, type="type", unit="unit", value=123 ) )
Attributes
- action
Configuration details for the policy action.
- exclusion_rules
Additional rules to specify resources that should be exempt from policy actions.
- filter
Specifies the resources that the lifecycle policy applies to.
RecipeSelectionProperty
- class CfnLifecyclePolicyPropsMixin.RecipeSelectionProperty(*, name=None, semantic_version=None)
Bases:
objectSpecifies an Image Builder recipe that the lifecycle policy uses for resource selection.
- Parameters:
name (
Optional[str]) – The name of an Image Builder recipe that the lifecycle policy uses for resource selection.semantic_version (
Optional[str]) – The version of the Image Builder recipe specified by thenamefield.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins recipe_selection_property = imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.RecipeSelectionProperty( name="name", semantic_version="semanticVersion" )
Attributes
- name
The name of an Image Builder recipe that the lifecycle policy uses for resource selection.
- semantic_version
The version of the Image Builder recipe specified by the
namefield.
ResourceSelectionProperty
- class CfnLifecyclePolicyPropsMixin.ResourceSelectionProperty(*, recipes=None, tag_map=None)
Bases:
objectResource selection criteria for the lifecycle policy.
- Parameters:
recipes (
Union[IResolvable,Sequence[Union[IResolvable,RecipeSelectionProperty,Dict[str,Any]]],None]) – A list of recipes that are used as selection criteria for the output images that the lifecycle policy applies to.tag_map (
Union[Mapping[str,str],IResolvable,None]) – A list of tags that are used as selection criteria for the Image Builder image resources that the lifecycle policy applies to.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_imagebuilder import mixins as imagebuilder_mixins resource_selection_property = imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.ResourceSelectionProperty( recipes=[imagebuilder_mixins.CfnLifecyclePolicyPropsMixin.RecipeSelectionProperty( name="name", semantic_version="semanticVersion" )], tag_map={ "tag_map_key": "tagMap" } )
Attributes
- recipes
A list of recipes that are used as selection criteria for the output images that the lifecycle policy applies to.
- tag_map
A list of tags that are used as selection criteria for the Image Builder image resources that the lifecycle policy applies to.