

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::ImageBuilder::LifecyclePolicy
<a name="aws-resource-imagebuilder-lifecyclepolicy"></a>

Create a lifecycle policy resource.

## Syntax
<a name="aws-resource-imagebuilder-lifecyclepolicy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-imagebuilder-lifecyclepolicy-syntax.json"></a>

```
{
  "Type" : "AWS::ImageBuilder::LifecyclePolicy",
  "Properties" : {
      "[Description](#cfn-imagebuilder-lifecyclepolicy-description)" : String,
      "[ExecutionRole](#cfn-imagebuilder-lifecyclepolicy-executionrole)" : String,
      "[Name](#cfn-imagebuilder-lifecyclepolicy-name)" : String,
      "[PolicyDetails](#cfn-imagebuilder-lifecyclepolicy-policydetails)" : [ PolicyDetail, ... ],
      "[ResourceSelection](#cfn-imagebuilder-lifecyclepolicy-resourceselection)" : ResourceSelection,
      "[ResourceType](#cfn-imagebuilder-lifecyclepolicy-resourcetype)" : String,
      "[Status](#cfn-imagebuilder-lifecyclepolicy-status)" : String,
      "[Tags](#cfn-imagebuilder-lifecyclepolicy-tags)" : {Key: Value, ...}
    }
}
```

### YAML
<a name="aws-resource-imagebuilder-lifecyclepolicy-syntax.yaml"></a>

```
Type: AWS::ImageBuilder::LifecyclePolicy
Properties:
  [Description](#cfn-imagebuilder-lifecyclepolicy-description): String
  [ExecutionRole](#cfn-imagebuilder-lifecyclepolicy-executionrole): String
  [Name](#cfn-imagebuilder-lifecyclepolicy-name): String
  [PolicyDetails](#cfn-imagebuilder-lifecyclepolicy-policydetails): 
    - PolicyDetail
  [ResourceSelection](#cfn-imagebuilder-lifecyclepolicy-resourceselection): 
    ResourceSelection
  [ResourceType](#cfn-imagebuilder-lifecyclepolicy-resourcetype): String
  [Status](#cfn-imagebuilder-lifecyclepolicy-status): String
  [Tags](#cfn-imagebuilder-lifecyclepolicy-tags): 
    Key: Value
```

## Properties
<a name="aws-resource-imagebuilder-lifecyclepolicy-properties"></a>

`Description`  <a name="cfn-imagebuilder-lifecyclepolicy-description"></a>
Optional description for the lifecycle policy.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `1024`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ExecutionRole`  <a name="cfn-imagebuilder-lifecyclepolicy-executionrole"></a>
The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to run lifecycle actions.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^(?:arn:aws(?:-[a-z]+)*:iam::[0-9]{12}:role/)?[a-zA-Z_0-9+=,.@\-_/]+$`  
*Minimum*: `1`  
*Maximum*: `2048`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Name`  <a name="cfn-imagebuilder-lifecyclepolicy-name"></a>
The name of the lifecycle policy to create.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^[-_A-Za-z-0-9][-_A-Za-z0-9 ]{1,126}[-_A-Za-z-0-9]$`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`PolicyDetails`  <a name="cfn-imagebuilder-lifecyclepolicy-policydetails"></a>
Configuration details for the lifecycle policy rules.  
*Required*: Yes  
*Type*: Array of [PolicyDetail](aws-properties-imagebuilder-lifecyclepolicy-policydetail.md)  
*Minimum*: `1`  
*Maximum*: `3`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ResourceSelection`  <a name="cfn-imagebuilder-lifecyclepolicy-resourceselection"></a>
Selection criteria for the resources that the lifecycle policy applies to.   
*Required*: Yes  
*Type*: [ResourceSelection](aws-properties-imagebuilder-lifecyclepolicy-resourceselection.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ResourceType`  <a name="cfn-imagebuilder-lifecyclepolicy-resourcetype"></a>
The type of Image Builder resource that the lifecycle policy applies to.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `AMI_IMAGE | CONTAINER_IMAGE`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Status`  <a name="cfn-imagebuilder-lifecyclepolicy-status"></a>
Indicates whether the lifecycle policy resource is enabled.  
*Required*: No  
*Type*: String  
*Allowed values*: `DISABLED | ENABLED`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-imagebuilder-lifecyclepolicy-tags"></a>
Tags to apply to the lifecycle policy resource.  
*Required*: No  
*Type*: Object of String  
*Pattern*: `.{1,}`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-imagebuilder-lifecyclepolicy-return-values"></a>

### Ref
<a name="aws-resource-imagebuilder-lifecyclepolicy-return-values-ref"></a>

### Fn::GetAtt
<a name="aws-resource-imagebuilder-lifecyclepolicy-return-values-fn--getatt"></a>

#### 
<a name="aws-resource-imagebuilder-lifecyclepolicy-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
The Amazon Resource Name (ARN) of the lifecycle policy resource.

# AWS::ImageBuilder::LifecyclePolicy Action
<a name="aws-properties-imagebuilder-lifecyclepolicy-action"></a>

Contains selection criteria for the lifecycle policy.

## Syntax
<a name="aws-properties-imagebuilder-lifecyclepolicy-action-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-imagebuilder-lifecyclepolicy-action-syntax.json"></a>

```
{
  "[IncludeResources](#cfn-imagebuilder-lifecyclepolicy-action-includeresources)" : IncludeResources,
  "[Type](#cfn-imagebuilder-lifecyclepolicy-action-type)" : String
}
```

### YAML
<a name="aws-properties-imagebuilder-lifecyclepolicy-action-syntax.yaml"></a>

```
  [IncludeResources](#cfn-imagebuilder-lifecyclepolicy-action-includeresources): 
    IncludeResources
  [Type](#cfn-imagebuilder-lifecyclepolicy-action-type): String
```

## Properties
<a name="aws-properties-imagebuilder-lifecyclepolicy-action-properties"></a>

`IncludeResources`  <a name="cfn-imagebuilder-lifecyclepolicy-action-includeresources"></a>
Specifies the resources that the lifecycle policy applies to.  
*Required*: No  
*Type*: [IncludeResources](aws-properties-imagebuilder-lifecyclepolicy-includeresources.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Type`  <a name="cfn-imagebuilder-lifecyclepolicy-action-type"></a>
Specifies the lifecycle action to take.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `DELETE | DEPRECATE | DISABLE`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::ImageBuilder::LifecyclePolicy AmiExclusionRules
<a name="aws-properties-imagebuilder-lifecyclepolicy-amiexclusionrules"></a>

Defines criteria for AMIs that are excluded from lifecycle actions.

## Syntax
<a name="aws-properties-imagebuilder-lifecyclepolicy-amiexclusionrules-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-imagebuilder-lifecyclepolicy-amiexclusionrules-syntax.json"></a>

```
{
  "[IsPublic](#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-ispublic)" : Boolean,
  "[LastLaunched](#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-lastlaunched)" : LastLaunched,
  "[Regions](#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-regions)" : [ String, ... ],
  "[SharedAccounts](#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-sharedaccounts)" : [ String, ... ],
  "[TagMap](#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-tagmap)" : {Key: Value, ...}
}
```

### YAML
<a name="aws-properties-imagebuilder-lifecyclepolicy-amiexclusionrules-syntax.yaml"></a>

```
  [IsPublic](#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-ispublic): Boolean
  [LastLaunched](#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-lastlaunched): 
    LastLaunched
  [Regions](#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-regions): 
    - String
  [SharedAccounts](#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-sharedaccounts): 
    - String
  [TagMap](#cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-tagmap): 
    Key: Value
```

## Properties
<a name="aws-properties-imagebuilder-lifecyclepolicy-amiexclusionrules-properties"></a>

`IsPublic`  <a name="cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-ispublic"></a>
Configures whether public AMIs are excluded from the lifecycle action.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LastLaunched`  <a name="cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-lastlaunched"></a>
Specifies configuration details for Image Builder to exclude the most recent resources from lifecycle actions.  
*Required*: No  
*Type*: [LastLaunched](aws-properties-imagebuilder-lifecyclepolicy-lastlaunched.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Regions`  <a name="cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-regions"></a>
Configures AWS Regions that are excluded from the lifecycle action.  
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SharedAccounts`  <a name="cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-sharedaccounts"></a>
Specifies AWS accounts whose resources are excluded from the lifecycle action.  
*Required*: No  
*Type*: Array of String  
*Minimum*: `1`  
*Maximum*: `1536`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TagMap`  <a name="cfn-imagebuilder-lifecyclepolicy-amiexclusionrules-tagmap"></a>
Lists tags that should be excluded from lifecycle actions for the AMIs that have them.  
*Required*: No  
*Type*: Object of String  
*Pattern*: `.{1,}`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::ImageBuilder::LifecyclePolicy ExclusionRules
<a name="aws-properties-imagebuilder-lifecyclepolicy-exclusionrules"></a>

Specifies resources that lifecycle policy actions should not apply to.

## Syntax
<a name="aws-properties-imagebuilder-lifecyclepolicy-exclusionrules-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-imagebuilder-lifecyclepolicy-exclusionrules-syntax.json"></a>

```
{
  "[Amis](#cfn-imagebuilder-lifecyclepolicy-exclusionrules-amis)" : AmiExclusionRules,
  "[TagMap](#cfn-imagebuilder-lifecyclepolicy-exclusionrules-tagmap)" : {Key: Value, ...}
}
```

### YAML
<a name="aws-properties-imagebuilder-lifecyclepolicy-exclusionrules-syntax.yaml"></a>

```
  [Amis](#cfn-imagebuilder-lifecyclepolicy-exclusionrules-amis): 
    AmiExclusionRules
  [TagMap](#cfn-imagebuilder-lifecyclepolicy-exclusionrules-tagmap): 
    Key: Value
```

## Properties
<a name="aws-properties-imagebuilder-lifecyclepolicy-exclusionrules-properties"></a>

`Amis`  <a name="cfn-imagebuilder-lifecyclepolicy-exclusionrules-amis"></a>
Lists configuration values that apply to AMIs that Image Builder should exclude from the lifecycle action.  
*Required*: No  
*Type*: [AmiExclusionRules](aws-properties-imagebuilder-lifecyclepolicy-amiexclusionrules.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TagMap`  <a name="cfn-imagebuilder-lifecyclepolicy-exclusionrules-tagmap"></a>
Contains a list of tags that Image Builder uses to skip lifecycle actions for Image Builder image resources that have them.  
*Required*: No  
*Type*: Object of String  
*Pattern*: `.{1,}`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::ImageBuilder::LifecyclePolicy Filter
<a name="aws-properties-imagebuilder-lifecyclepolicy-filter"></a>

Defines filters that the lifecycle policy uses to determine impacted resource.

## Syntax
<a name="aws-properties-imagebuilder-lifecyclepolicy-filter-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-imagebuilder-lifecyclepolicy-filter-syntax.json"></a>

```
{
  "[RetainAtLeast](#cfn-imagebuilder-lifecyclepolicy-filter-retainatleast)" : Integer,
  "[Type](#cfn-imagebuilder-lifecyclepolicy-filter-type)" : String,
  "[Unit](#cfn-imagebuilder-lifecyclepolicy-filter-unit)" : String,
  "[Value](#cfn-imagebuilder-lifecyclepolicy-filter-value)" : Integer
}
```

### YAML
<a name="aws-properties-imagebuilder-lifecyclepolicy-filter-syntax.yaml"></a>

```
  [RetainAtLeast](#cfn-imagebuilder-lifecyclepolicy-filter-retainatleast): Integer
  [Type](#cfn-imagebuilder-lifecyclepolicy-filter-type): String
  [Unit](#cfn-imagebuilder-lifecyclepolicy-filter-unit): String
  [Value](#cfn-imagebuilder-lifecyclepolicy-filter-value): Integer
```

## Properties
<a name="aws-properties-imagebuilder-lifecyclepolicy-filter-properties"></a>

`RetainAtLeast`  <a name="cfn-imagebuilder-lifecyclepolicy-filter-retainatleast"></a>
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.  
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Maximum*: `10`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Type`  <a name="cfn-imagebuilder-lifecyclepolicy-filter-type"></a>
Filter resources based on either `age` or `count`.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `AGE | COUNT`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Unit`  <a name="cfn-imagebuilder-lifecyclepolicy-filter-unit"></a>
Defines the unit of time that the lifecycle policy uses to determine impacted resources. This is required for age-based rules.  
*Required*: No  
*Type*: String  
*Allowed values*: `DAYS | WEEKS | MONTHS | YEARS`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-imagebuilder-lifecyclepolicy-filter-value"></a>
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.  
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.
*Required*: Yes  
*Type*: Integer  
*Minimum*: `1`  
*Maximum*: `1000`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::ImageBuilder::LifecyclePolicy IncludeResources
<a name="aws-properties-imagebuilder-lifecyclepolicy-includeresources"></a>

Specifies how the lifecycle policy should apply actions to selected resources.

## Syntax
<a name="aws-properties-imagebuilder-lifecyclepolicy-includeresources-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-imagebuilder-lifecyclepolicy-includeresources-syntax.json"></a>

```
{
  "[Amis](#cfn-imagebuilder-lifecyclepolicy-includeresources-amis)" : Boolean,
  "[Containers](#cfn-imagebuilder-lifecyclepolicy-includeresources-containers)" : Boolean,
  "[Snapshots](#cfn-imagebuilder-lifecyclepolicy-includeresources-snapshots)" : Boolean
}
```

### YAML
<a name="aws-properties-imagebuilder-lifecyclepolicy-includeresources-syntax.yaml"></a>

```
  [Amis](#cfn-imagebuilder-lifecyclepolicy-includeresources-amis): Boolean
  [Containers](#cfn-imagebuilder-lifecyclepolicy-includeresources-containers): Boolean
  [Snapshots](#cfn-imagebuilder-lifecyclepolicy-includeresources-snapshots): Boolean
```

## Properties
<a name="aws-properties-imagebuilder-lifecyclepolicy-includeresources-properties"></a>

`Amis`  <a name="cfn-imagebuilder-lifecyclepolicy-includeresources-amis"></a>
Specifies whether the lifecycle action should apply to distributed AMIs.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Containers`  <a name="cfn-imagebuilder-lifecyclepolicy-includeresources-containers"></a>
Specifies whether the lifecycle action should apply to distributed containers.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Snapshots`  <a name="cfn-imagebuilder-lifecyclepolicy-includeresources-snapshots"></a>
Specifies whether the lifecycle action should apply to snapshots associated with distributed AMIs.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::ImageBuilder::LifecyclePolicy LastLaunched
<a name="aws-properties-imagebuilder-lifecyclepolicy-lastlaunched"></a>

Defines criteria to exclude AMIs from lifecycle actions based on the last time they were used to launch an instance.

## Syntax
<a name="aws-properties-imagebuilder-lifecyclepolicy-lastlaunched-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-imagebuilder-lifecyclepolicy-lastlaunched-syntax.json"></a>

```
{
  "[Unit](#cfn-imagebuilder-lifecyclepolicy-lastlaunched-unit)" : String,
  "[Value](#cfn-imagebuilder-lifecyclepolicy-lastlaunched-value)" : Integer
}
```

### YAML
<a name="aws-properties-imagebuilder-lifecyclepolicy-lastlaunched-syntax.yaml"></a>

```
  [Unit](#cfn-imagebuilder-lifecyclepolicy-lastlaunched-unit): String
  [Value](#cfn-imagebuilder-lifecyclepolicy-lastlaunched-value): Integer
```

## Properties
<a name="aws-properties-imagebuilder-lifecyclepolicy-lastlaunched-properties"></a>

`Unit`  <a name="cfn-imagebuilder-lifecyclepolicy-lastlaunched-unit"></a>
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.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `DAYS | WEEKS | MONTHS | YEARS`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-imagebuilder-lifecyclepolicy-lastlaunched-value"></a>
The integer number of units for the time period. For example `6` (months).  
*Required*: Yes  
*Type*: Integer  
*Minimum*: `1`  
*Maximum*: `365`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::ImageBuilder::LifecyclePolicy PolicyDetail
<a name="aws-properties-imagebuilder-lifecyclepolicy-policydetail"></a>

The configuration details for a lifecycle policy resource.

## Syntax
<a name="aws-properties-imagebuilder-lifecyclepolicy-policydetail-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-imagebuilder-lifecyclepolicy-policydetail-syntax.json"></a>

```
{
  "[Action](#cfn-imagebuilder-lifecyclepolicy-policydetail-action)" : Action,
  "[ExclusionRules](#cfn-imagebuilder-lifecyclepolicy-policydetail-exclusionrules)" : ExclusionRules,
  "[Filter](#cfn-imagebuilder-lifecyclepolicy-policydetail-filter)" : Filter
}
```

### YAML
<a name="aws-properties-imagebuilder-lifecyclepolicy-policydetail-syntax.yaml"></a>

```
  [Action](#cfn-imagebuilder-lifecyclepolicy-policydetail-action): 
    Action
  [ExclusionRules](#cfn-imagebuilder-lifecyclepolicy-policydetail-exclusionrules): 
    ExclusionRules
  [Filter](#cfn-imagebuilder-lifecyclepolicy-policydetail-filter): 
    Filter
```

## Properties
<a name="aws-properties-imagebuilder-lifecyclepolicy-policydetail-properties"></a>

`Action`  <a name="cfn-imagebuilder-lifecyclepolicy-policydetail-action"></a>
Configuration details for the policy action.  
*Required*: Yes  
*Type*: [Action](aws-properties-imagebuilder-lifecyclepolicy-action.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ExclusionRules`  <a name="cfn-imagebuilder-lifecyclepolicy-policydetail-exclusionrules"></a>
Additional rules to specify resources that should be exempt from policy actions.  
*Required*: No  
*Type*: [ExclusionRules](aws-properties-imagebuilder-lifecyclepolicy-exclusionrules.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Filter`  <a name="cfn-imagebuilder-lifecyclepolicy-policydetail-filter"></a>
Specifies the resources that the lifecycle policy applies to.  
*Required*: Yes  
*Type*: [Filter](aws-properties-imagebuilder-lifecyclepolicy-filter.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::ImageBuilder::LifecyclePolicy RecipeSelection
<a name="aws-properties-imagebuilder-lifecyclepolicy-recipeselection"></a>

Specifies an Image Builder recipe that the lifecycle policy uses for resource selection.

## Syntax
<a name="aws-properties-imagebuilder-lifecyclepolicy-recipeselection-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-imagebuilder-lifecyclepolicy-recipeselection-syntax.json"></a>

```
{
  "[Name](#cfn-imagebuilder-lifecyclepolicy-recipeselection-name)" : String,
  "[SemanticVersion](#cfn-imagebuilder-lifecyclepolicy-recipeselection-semanticversion)" : String
}
```

### YAML
<a name="aws-properties-imagebuilder-lifecyclepolicy-recipeselection-syntax.yaml"></a>

```
  [Name](#cfn-imagebuilder-lifecyclepolicy-recipeselection-name): String
  [SemanticVersion](#cfn-imagebuilder-lifecyclepolicy-recipeselection-semanticversion): String
```

## Properties
<a name="aws-properties-imagebuilder-lifecyclepolicy-recipeselection-properties"></a>

`Name`  <a name="cfn-imagebuilder-lifecyclepolicy-recipeselection-name"></a>
The name of an Image Builder recipe that the lifecycle policy uses for resource selection.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^[-_A-Za-z-0-9][-_A-Za-z0-9 ]{1,126}[-_A-Za-z-0-9]$`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SemanticVersion`  <a name="cfn-imagebuilder-lifecyclepolicy-recipeselection-semanticversion"></a>
The version of the Image Builder recipe specified by the `name` field.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^(?:[0-9]+|x)\.(?:[0-9]+|x)\.(?:[0-9]+|x)$`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::ImageBuilder::LifecyclePolicy ResourceSelection
<a name="aws-properties-imagebuilder-lifecyclepolicy-resourceselection"></a>

Resource selection criteria for the lifecycle policy.

## Syntax
<a name="aws-properties-imagebuilder-lifecyclepolicy-resourceselection-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-imagebuilder-lifecyclepolicy-resourceselection-syntax.json"></a>

```
{
  "[Recipes](#cfn-imagebuilder-lifecyclepolicy-resourceselection-recipes)" : [ RecipeSelection, ... ],
  "[TagMap](#cfn-imagebuilder-lifecyclepolicy-resourceselection-tagmap)" : {Key: Value, ...}
}
```

### YAML
<a name="aws-properties-imagebuilder-lifecyclepolicy-resourceselection-syntax.yaml"></a>

```
  [Recipes](#cfn-imagebuilder-lifecyclepolicy-resourceselection-recipes): 
    - RecipeSelection
  [TagMap](#cfn-imagebuilder-lifecyclepolicy-resourceselection-tagmap): 
    Key: Value
```

## Properties
<a name="aws-properties-imagebuilder-lifecyclepolicy-resourceselection-properties"></a>

`Recipes`  <a name="cfn-imagebuilder-lifecyclepolicy-resourceselection-recipes"></a>
A list of recipes that are used as selection criteria for the output images that the lifecycle policy applies to.  
*Required*: No  
*Type*: Array of [RecipeSelection](aws-properties-imagebuilder-lifecyclepolicy-recipeselection.md)  
*Minimum*: `1`  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TagMap`  <a name="cfn-imagebuilder-lifecyclepolicy-resourceselection-tagmap"></a>
A list of tags that are used as selection criteria for the Image Builder image resources that the lifecycle policy applies to.  
*Required*: No  
*Type*: Object of String  
*Pattern*: `.{1,}`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)