# CfnLifecyclePolicyProps

Properties for defining a `CfnLifecyclePolicy`.

Extends: CfnLifecyclePolicyProps
Used as props by: CfnLifecyclePolicy

- Source: Generated code
- Type last changed: v2.110.0 · 17 Nov 2023

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_imagebuilder as imagebuilder } from 'aws-cdk-lib';
const cfnLifecyclePolicyProps: imagebuilder.CfnLifecyclePolicyProps = {
  executionRole: 'executionRole',
  name: 'name',
  policyDetails: [{
    action: {
      type: 'type',

      // the properties below are optional
      includeResources: {
        amis: false,
        containers: false,
        snapshots: false,
      },
    },
    filter: {
      type: 'type',
      value: 123,

      // the properties below are optional
      retainAtLeast: 123,
      unit: 'unit',
    },

    // the properties below are optional
    exclusionRules: {
      amis: {
        isPublic: false,
        lastLaunched: {
          unit: 'unit',
          value: 123,
        },
        regions: ['regions'],
        sharedAccounts: ['sharedAccounts'],
        tagMap: {
          tagMapKey: 'tagMap',
        },
      },
      tagMap: {
        tagMapKey: 'tagMap',
      },
    },
  }],
  resourceSelection: {
    recipes: [{
      name: 'name',
      semanticVersion: 'semanticVersion',
    }],
    tagMap: {
      tagMapKey: 'tagMap',
    },
  },
  resourceType: 'resourceType',

  // the properties below are optional
  description: 'description',
  status: 'status',
  tags: {
    tagsKey: 'tags',
  },
};
```

## Properties

- `description`: string — Optional description for the lifecycle policy.

- `executionRole`: string (required) — The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to run lifecycle actions.

- `name`: string (required) — The name of the lifecycle policy to create.

- `policyDetails`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLifecyclePolicy.PolicyDetailProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_imagebuilder.CfnLifecyclePolicy.PolicyDetailProperty.html)[] (required) — Configuration details for the lifecycle policy rules.

- `resourceSelection`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLifecyclePolicy.ResourceSelectionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_imagebuilder.CfnLifecyclePolicy.ResourceSelectionProperty.html) (required) — Selection criteria for the resources that the lifecycle policy applies to.

- `resourceType`: string (required) — The type of Image Builder resource that the lifecycle policy applies to.

- `status`: string — Indicates whether the lifecycle policy resource is enabled.

- `tags`: { [key: string]: string } — Tags to apply to the lifecycle policy resource.
