CfnLifecyclePolicyPropsMixin

class aws_cdk.mixins_preview.aws_imagebuilder.mixins.CfnLifecyclePolicyPropsMixin(props, *, strategy=None)

Bases: Mixin

Create a lifecycle policy resource.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-lifecyclepolicy.html

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:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

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 x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

ActionProperty

class CfnLifecyclePolicyPropsMixin.ActionProperty(*, include_resources=None, type=None)

Bases: object

Contains 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-action.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-action.html#cfn-imagebuilder-lifecyclepolicy-action-includeresources

type

Specifies the lifecycle action to take.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-action.html#cfn-imagebuilder-lifecyclepolicy-action-type

AmiExclusionRulesProperty

class CfnLifecyclePolicyPropsMixin.AmiExclusionRulesProperty(*, is_public=None, last_launched=None, regions=None, shared_accounts=None, tag_map=None)

Bases: object

Defines 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-amiexclusionrules.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-amiexclusionrules.html#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-ispublic

last_launched

Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle actions.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-amiexclusionrules.html#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-lastlaunched

regions

Configures AWS Region s that are excluded from the lifecycle action.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-amiexclusionrules.html#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-regions

shared_accounts

Specifies AWS account s whose resources are excluded from the lifecycle action.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-amiexclusionrules.html#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-sharedaccounts

tag_map

Lists tags that should be excluded from lifecycle actions for the AMIs that have them.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-amiexclusionrules.html#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-tagmap

ExclusionRulesProperty

class CfnLifecyclePolicyPropsMixin.ExclusionRulesProperty(*, amis=None, tag_map=None)

Bases: object

Specifies 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-exclusionrules.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-exclusionrules.html#cfn-imagebuilder-lifecyclepolicy-exclusionrules-amis

tag_map

Contains a list of tags that Image Builder uses to skip lifecycle actions for Image Builder image resources that have them.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-exclusionrules.html#cfn-imagebuilder-lifecyclepolicy-exclusionrules-tagmap

FilterProperty

class CfnLifecyclePolicyPropsMixin.FilterProperty(*, retain_at_least=None, type=None, unit=None, value=None)

Bases: object

Defines 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 lifecycle DELETE action 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 either age or count .

  • 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 of 6 might 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-filter.html

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 DELETE action 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-filter.html#cfn-imagebuilder-lifecyclepolicy-filter-retainatleast

type

Filter resources based on either age or count .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-filter.html#cfn-imagebuilder-lifecyclepolicy-filter-type

unit

Defines the unit of time that the lifecycle policy uses to determine impacted resources.

This is required for age-based rules.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-filter.html#cfn-imagebuilder-lifecyclepolicy-filter-unit

value

The number of units for the time period or for the count.

For example, a value of 6 might 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-filter.html#cfn-imagebuilder-lifecyclepolicy-filter-value

IncludeResourcesProperty

class CfnLifecyclePolicyPropsMixin.IncludeResourcesProperty(*, amis=None, containers=None, snapshots=None)

Bases: object

Specifies 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-includeresources.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-includeresources.html#cfn-imagebuilder-lifecyclepolicy-includeresources-amis

containers

Specifies whether the lifecycle action should apply to distributed containers.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-includeresources.html#cfn-imagebuilder-lifecyclepolicy-includeresources-containers

snapshots

Specifies whether the lifecycle action should apply to snapshots associated with distributed AMIs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-includeresources.html#cfn-imagebuilder-lifecyclepolicy-includeresources-snapshots

LastLaunchedProperty

class CfnLifecyclePolicyPropsMixin.LastLaunchedProperty(*, unit=None, value=None)

Bases: object

Defines 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 example 6 (months).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-lastlaunched.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-lastlaunched.html#cfn-imagebuilder-lifecyclepolicy-lastlaunched-unit

value

The integer number of units for the time period.

For example 6 (months).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-lastlaunched.html#cfn-imagebuilder-lifecyclepolicy-lastlaunched-value

PolicyDetailProperty

class CfnLifecyclePolicyPropsMixin.PolicyDetailProperty(*, action=None, exclusion_rules=None, filter=None)

Bases: object

The 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-policydetail.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-policydetail.html#cfn-imagebuilder-lifecyclepolicy-policydetail-action

exclusion_rules

Additional rules to specify resources that should be exempt from policy actions.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-policydetail.html#cfn-imagebuilder-lifecyclepolicy-policydetail-exclusionrules

filter

Specifies the resources that the lifecycle policy applies to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-policydetail.html#cfn-imagebuilder-lifecyclepolicy-policydetail-filter

RecipeSelectionProperty

class CfnLifecyclePolicyPropsMixin.RecipeSelectionProperty(*, name=None, semantic_version=None)

Bases: object

Specifies 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 the name field.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-recipeselection.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-recipeselection.html#cfn-imagebuilder-lifecyclepolicy-recipeselection-name

semantic_version

The version of the Image Builder recipe specified by the name field.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-recipeselection.html#cfn-imagebuilder-lifecyclepolicy-recipeselection-semanticversion

ResourceSelectionProperty

class CfnLifecyclePolicyPropsMixin.ResourceSelectionProperty(*, recipes=None, tag_map=None)

Bases: object

Resource 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-resourceselection.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-resourceselection.html#cfn-imagebuilder-lifecyclepolicy-resourceselection-recipes

tag_map

A list of tags that are used as selection criteria for the Image Builder image resources that the lifecycle policy applies to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-imagebuilder-lifecyclepolicy-resourceselection.html#cfn-imagebuilder-lifecyclepolicy-resourceselection-tagmap