CfnLifecyclePolicyProps

class aws_cdk.aws_imagebuilder.CfnLifecyclePolicyProps(*, execution_role, name, policy_details, resource_selection, resource_type, description=None, status=None, tags=None)

Bases: object

Properties for defining a CfnLifecyclePolicy.

Parameters:
  • execution_role (str) – The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to run lifecycle actions.

  • name (str) – The name of the lifecycle policy to create.

  • policy_details (Union[IResolvable, Sequence[Union[IResolvable, PolicyDetailProperty, Dict[str, Any]]]]) – Configuration details for the lifecycle policy rules.

  • resource_selection (Union[IResolvable, ResourceSelectionProperty, Dict[str, Any]]) – Selection criteria for the resources that the lifecycle policy applies to.

  • resource_type (str) – The type of Image Builder resource that the lifecycle policy applies to.

  • description (Optional[str]) – Optional description for the lifecycle policy.

  • status (Optional[str]) – Indicates whether the lifecycle policy resource is enabled.

  • tags (Optional[Mapping[str, str]]) – Tags to apply to the lifecycle policy resource.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-lifecyclepolicy.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 import aws_imagebuilder as imagebuilder

cfn_lifecycle_policy_props = imagebuilder.CfnLifecyclePolicyProps(
    execution_role="executionRole",
    name="name",
    policy_details=[imagebuilder.CfnLifecyclePolicy.PolicyDetailProperty(
        action=imagebuilder.CfnLifecyclePolicy.ActionProperty(
            type="type",

            # the properties below are optional
            include_resources=imagebuilder.CfnLifecyclePolicy.IncludeResourcesProperty(
                amis=False,
                containers=False,
                snapshots=False
            )
        ),
        filter=imagebuilder.CfnLifecyclePolicy.FilterProperty(
            type="type",
            value=123,

            # the properties below are optional
            retain_at_least=123,
            unit="unit"
        ),

        # the properties below are optional
        exclusion_rules=imagebuilder.CfnLifecyclePolicy.ExclusionRulesProperty(
            amis=imagebuilder.CfnLifecyclePolicy.AmiExclusionRulesProperty(
                is_public=False,
                last_launched=imagebuilder.CfnLifecyclePolicy.LastLaunchedProperty(
                    unit="unit",
                    value=123
                ),
                regions=["regions"],
                shared_accounts=["sharedAccounts"],
                tag_map={
                    "tag_map_key": "tagMap"
                }
            ),
            tag_map={
                "tag_map_key": "tagMap"
            }
        )
    )],
    resource_selection=imagebuilder.CfnLifecyclePolicy.ResourceSelectionProperty(
        recipes=[imagebuilder.CfnLifecyclePolicy.RecipeSelectionProperty(
            name="name",
            semantic_version="semanticVersion"
        )],
        tag_map={
            "tag_map_key": "tagMap"
        }
    ),
    resource_type="resourceType",

    # the properties below are optional
    description="description",
    status="status",
    tags={
        "tags_key": "tags"
    }
)

Attributes

description

Optional description for the lifecycle policy.

See:

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

execution_role

The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to run lifecycle actions.

See:

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

name

The name of the lifecycle policy to create.

See:

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

policy_details

Configuration details for the lifecycle policy rules.

See:

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

resource_selection

Selection criteria for the resources that the lifecycle policy applies to.

See:

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

resource_type

The type of Image Builder resource that the lifecycle policy applies to.

See:

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

status

Indicates whether the lifecycle policy resource is enabled.

See:

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

tags

Tags to apply to the lifecycle policy resource.

See:

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