> **Experimental**
>
> `@aws-cdk/aws-imagebuilder-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# LifecyclePolicyImageExclusionRules

The rules to apply for excluding EC2 Image Builder images from the lifecycle policy rule.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/lifecycle-policy.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-imagebuilder-alpha/lib/lifecycle-policy.ts#L176)

## Example

```ts
const excludeImagesPolicy = new imagebuilder.LifecyclePolicy(this, 'ExcludeImagesPolicy', {
  resourceType: imagebuilder.LifecyclePolicyResourceType.CONTAINER_IMAGE,
  details: [
    {
      action: { type: imagebuilder.LifecyclePolicyActionType.DELETE },
      filter: { countFilter: { count: 20 } },
      exclusionRules: {
        imageExclusionRules: {
          tags: {
            DoNotDelete: 'true',
            Critical: 'baseline'
          }
        }
      }
    }
  ],
  resourceSelection: {
    tags: { Application: 'frontend' }
  }
});
```

## Properties

- `tags`: { [key: string]: string } (required) — Excludes EC2 Image Builder images with any of the provided tags from the lifecycle policy rule.
