Skip to content
v2.274.0

Experimental

@aws-cdk/aws-imagebuilder-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

LifecyclePolicyResourceSelection Struct ​

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

Example ​

ts
const disabledPolicy = new imagebuilder.LifecyclePolicy(this, 'DisabledPolicy', {
  lifecyclePolicyName: 'my-disabled-policy',
  description: 'A lifecycle policy that is temporarily disabled',
  status: imagebuilder.LifecyclePolicyStatus.DISABLED,
  resourceType: imagebuilder.LifecyclePolicyResourceType.AMI_IMAGE,
  details: [
    {
      action: { type: imagebuilder.LifecyclePolicyActionType.DELETE },
      filter: { ageFilter: { age: Duration.days(30) } }
    }
  ],
  resourceSelection: {
    tags: { Environment: 'testing' }
  },
  tags: {
    Owner: 'DevOps',
    CostCenter: 'Engineering'
  }
});

Properties ​

recipesoptionalIRecipeBase[]recipesoptionaltyping.List[IRecipeBase]recipesoptionalList<IRecipeBase>RecipesoptionalIRecipeBase[]Recipesoptional*[]IRecipeBase#
The list of image recipes or container recipes to apply the lifecycle policy to.

Default: none if tag selections are provided. Otherwise, at least one recipe or tag selection must be provided

tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string#
Selects EC2 Image Builder images containing any of the provided tags.

Default: none if recipe selections are provided. Otherwise, at least one recipe or tag selection must be provided