Skip to content
v2.275.0

CfnLifecyclePolicyProps Struct ​

Properties for defining a CfnLifecyclePolicy.

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 ​

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
Optional description for the lifecycle policy.
executionRolestringexecution_rolestrexecutionRoleStringExecutionRolestringExecutionRole*stringrequired#
The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to run lifecycle actions.
namestringnamestrnameStringNamestringName*stringrequired#
The name of the lifecycle policy to create.
policyDetailsIResolvable | IResolvable | CfnLifecyclePolicy.PolicyDetailProperty[]policy_detailstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, PolicyDetailProperty]]]policyDetailsIResolvablePolicyDetailsIResolvablePolicyDetailsinterface{}required#
Configuration details for the lifecycle policy rules.
resourceSelectionIResolvable | CfnLifecyclePolicy.ResourceSelectionPropertyresource_selectiontyping.Union[IResolvable, ResourceSelectionProperty]resourceSelectionIResolvableResourceSelectionIResolvableResourceSelectioninterface{}required#
Selection criteria for the resources that the lifecycle policy applies to.
resourceTypestringresource_typestrresourceTypeStringResourceTypestringResourceType*stringrequired#
The type of Image Builder resource that the lifecycle policy applies to.
statusoptionalstringstatusoptionalstrstatusoptionalStringStatusoptionalstringStatusoptional*string#
Indicates whether the lifecycle policy resource is enabled.
tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string#
Tags to apply to the lifecycle policy resource.