Skip to content
v2.273.0

Experimental

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

LifecyclePolicyProps Struct ​

Properties for creating a Lifecycle Policy resource.

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 ​

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= None#
The description of the lifecycle policy.
Configuration details for the lifecycle policy rules.
executionRoleIRoleexecution_roleIRoleexecutionRoleIRoleExecutionRoleIRoleExecutionRoleIRole= an execution role will be genera…#
The execution role that grants Image Builder access to run lifecycle actions.

By default, an execution role will be created with the minimal permissions needed to execute the lifecycle policy actions.

default

Default: an execution role will be generated

lifecyclePolicyNamestringlifecycle_policy_namestrlifecyclePolicyNameStringLifecyclePolicyNamestringLifecyclePolicyName*string= a name is generated#
The name of the lifecycle policy.
Selection criteria for the resources that the lifecycle policy applies to.
The type of Image Builder resource that the lifecycle policy applies to.
The status of the lifecycle policy.
tags{ [key: string]: string }tagstyping.Mapping[str, str]tagsMap<String, String>TagsIDictionary<string, string>Tags*map[string]*string= none#
The tags to apply to the lifecycle policy.

Used as props by ​