Class CfnLifecyclePolicy
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.imagebuilder.CfnLifecyclePolicy
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,ILifecyclePolicyRef,ITaggableV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-20T23:37:23.095Z")
@Stability(Stable)
public class CfnLifecyclePolicy
extends CfnResource
implements IInspectable, ILifecyclePolicyRef, ITaggableV2
Create a lifecycle policy resource.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.imagebuilder.*;
CfnLifecyclePolicy cfnLifecyclePolicy = CfnLifecyclePolicy.Builder.create(this, "MyCfnLifecyclePolicy")
.executionRole("executionRole")
.name("name")
.policyDetails(List.of(PolicyDetailProperty.builder()
.action(ActionProperty.builder()
.type("type")
// the properties below are optional
.includeResources(IncludeResourcesProperty.builder()
.amis(false)
.containers(false)
.snapshots(false)
.build())
.build())
.filter(FilterProperty.builder()
.type("type")
.value(123)
// the properties below are optional
.retainAtLeast(123)
.unit("unit")
.build())
// the properties below are optional
.exclusionRules(ExclusionRulesProperty.builder()
.amis(AmiExclusionRulesProperty.builder()
.isPublic(false)
.lastLaunched(LastLaunchedProperty.builder()
.unit("unit")
.value(123)
.build())
.regions(List.of("regions"))
.sharedAccounts(List.of("sharedAccounts"))
.tagMap(Map.of(
"tagMapKey", "tagMap"))
.build())
.tagMap(Map.of(
"tagMapKey", "tagMap"))
.build())
.build()))
.resourceSelection(ResourceSelectionProperty.builder()
.recipes(List.of(RecipeSelectionProperty.builder()
.name("name")
.semanticVersion("semanticVersion")
.build()))
.tagMap(Map.of(
"tagMapKey", "tagMap"))
.build())
.resourceType("resourceType")
// the properties below are optional
.description("description")
.status("status")
.tags(Map.of(
"tagsKey", "tags"))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceContains selection criteria for the lifecycle policy.static interfaceDefines criteria for AMIs that are excluded from lifecycle actions.static final classA fluent builder forCfnLifecyclePolicy.static interfaceSpecifies resources that lifecycle policy actions should not apply to.static interfaceDefines filters that the lifecycle policy uses to determine impacted resource.static interfaceSpecifies how the lifecycle policy should apply actions to selected resources.static interfaceDefines criteria to exclude AMIs from lifecycle actions based on the last time they were used to launch an instance.static interfaceThe configuration details for a lifecycle policy resource.static interfaceSpecifies an Image Builder recipe that the lifecycle policy uses for resource selection.static interfaceResource selection criteria for the lifecycle policy.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.imagebuilder.ILifecyclePolicyRef
ILifecyclePolicyRef.Jsii$Default, ILifecyclePolicyRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnLifecyclePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnLifecyclePolicy(software.amazon.jsii.JsiiObjectRef objRef) CfnLifecyclePolicy(software.constructs.Construct scope, String id, CfnLifecyclePolicyProps props) Create a newAWS::ImageBuilder::LifecyclePolicy. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForLifecyclePolicy(ILifecyclePolicyRef resource) The Amazon Resource Name (ARN) of the lifecycle policy resource.Tag Manager which manages the tags for this resource.Optional description for the lifecycle policy.The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to run lifecycle actions.A reference to a LifecyclePolicy resource.getName()The name of the lifecycle policy to create.Configuration details for the lifecycle policy rules.Selection criteria for the resources that the lifecycle policy applies to.The type of Image Builder resource that the lifecycle policy applies to.Indicates whether the lifecycle policy resource is enabled.getTags()Tags to apply to the lifecycle policy resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetDescription(String value) Optional description for the lifecycle policy.voidsetExecutionRole(String value) The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to run lifecycle actions.voidThe name of the lifecycle policy to create.voidsetPolicyDetails(List<Object> value) Configuration details for the lifecycle policy rules.voidsetPolicyDetails(IResolvable value) Configuration details for the lifecycle policy rules.voidsetResourceSelection(IResolvable value) Selection criteria for the resources that the lifecycle policy applies to.voidSelection criteria for the resources that the lifecycle policy applies to.voidsetResourceType(String value) The type of Image Builder resource that the lifecycle policy applies to.voidIndicates whether the lifecycle policy resource is enabled.voidTags to apply to the lifecycle policy resource.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnLifecyclePolicy
protected CfnLifecyclePolicy(software.amazon.jsii.JsiiObjectRef objRef) -
CfnLifecyclePolicy
protected CfnLifecyclePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnLifecyclePolicy
@Stability(Stable) public CfnLifecyclePolicy(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnLifecyclePolicyProps props) Create a newAWS::ImageBuilder::LifecyclePolicy.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForLifecyclePolicy
@Stability(Stable) @NotNull public static String arnForLifecyclePolicy(@NotNull ILifecyclePolicyRef resource) - Parameters:
resource- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) of the lifecycle policy resource. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getLifecyclePolicyRef
A reference to a LifecyclePolicy resource.- Specified by:
getLifecyclePolicyRefin interfaceILifecyclePolicyRef
-
getExecutionRole
The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to run lifecycle actions. -
setExecutionRole
The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to run lifecycle actions. -
getName
The name of the lifecycle policy to create. -
setName
The name of the lifecycle policy to create. -
getPolicyDetails
Configuration details for the lifecycle policy rules.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnLifecyclePolicy.PolicyDetailProperty> -
setPolicyDetails
Configuration details for the lifecycle policy rules. -
setPolicyDetails
Configuration details for the lifecycle policy rules. -
getResourceSelection
Selection criteria for the resources that the lifecycle policy applies to.Returns union: either
IResolvableorCfnLifecyclePolicy.ResourceSelectionProperty -
setResourceSelection
Selection criteria for the resources that the lifecycle policy applies to. -
setResourceSelection
@Stability(Stable) public void setResourceSelection(@NotNull CfnLifecyclePolicy.ResourceSelectionProperty value) Selection criteria for the resources that the lifecycle policy applies to. -
getResourceType
The type of Image Builder resource that the lifecycle policy applies to. -
setResourceType
The type of Image Builder resource that the lifecycle policy applies to. -
getDescription
Optional description for the lifecycle policy. -
setDescription
Optional description for the lifecycle policy. -
getStatus
Indicates whether the lifecycle policy resource is enabled. -
setStatus
Indicates whether the lifecycle policy resource is enabled. -
getTags
Tags to apply to the lifecycle policy resource. -
setTags
Tags to apply to the lifecycle policy resource.
-