Class LifecyclePolicy
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.imagebuilder.alpha.LifecyclePolicy
- All Implemented Interfaces:
IEnvironmentAware,IResource,ILifecyclePolicy,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:50.071Z")
@Stability(Experimental)
public class LifecyclePolicy
extends Resource
implements ILifecyclePolicy
(experimental) Represents an EC2 Image Builder Lifecycle Policy.
Example:
LifecyclePolicy disabledPolicy = LifecyclePolicy.Builder.create(this, "DisabledPolicy")
.lifecyclePolicyName("my-disabled-policy")
.description("A lifecycle policy that is temporarily disabled")
.status(LifecyclePolicyStatus.DISABLED)
.resourceType(LifecyclePolicyResourceType.AMI_IMAGE)
.details(List.of(LifecyclePolicyDetail.builder()
.action(LifecyclePolicyAction.builder().type(LifecyclePolicyActionType.DELETE).build())
.filter(LifecyclePolicyFilter.builder().ageFilter(LifecyclePolicyAgeFilter.builder().age(Duration.days(30)).build()).build())
.build()))
.resourceSelection(LifecyclePolicyResourceSelection.builder()
.tags(Map.of("Environment", "testing"))
.build())
.tags(Map.of(
"Owner", "DevOps",
"CostCenter", "Engineering"))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class(experimental) A fluent builder forLifecyclePolicy.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.services.imagebuilder.alpha.ILifecyclePolicy
ILifecyclePolicy.Jsii$Default, ILifecyclePolicy.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLifecyclePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedLifecyclePolicy(software.amazon.jsii.JsiiObjectRef objRef) LifecyclePolicy(software.constructs.Construct scope, String id, LifecyclePolicyProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic ILifecyclePolicyfromLifecyclePolicyArn(software.constructs.Construct scope, String id, String lifecyclePolicyArn) (experimental) Import an existing lifecycle policy given its ARN.static ILifecyclePolicyfromLifecyclePolicyName(software.constructs.Construct scope, String id, String lifecyclePolicyName) (experimental) Import an existing lifecycle policy given its name.(experimental) The execution role used for lifecycle policy executions.(experimental) The ARN of the lifecycle policy.(experimental) The name of the lifecycle policy.grant(IGrantable grantee, String... actions) (experimental) Grant custom actions to the given grantee for the lifecycle policy.grantRead(IGrantable grantee) (experimental) Grant read permissions to the given grantee for the lifecycle policy.static Boolean(experimental) Return whether the given object is a LifecyclePolicy.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods 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.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
-
-
Constructor Details
-
LifecyclePolicy
protected LifecyclePolicy(software.amazon.jsii.JsiiObjectRef objRef) -
LifecyclePolicy
protected LifecyclePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
LifecyclePolicy
@Stability(Experimental) public LifecyclePolicy(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull LifecyclePolicyProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromLifecyclePolicyArn
@Stability(Experimental) @NotNull public static ILifecyclePolicy fromLifecyclePolicyArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String lifecyclePolicyArn) (experimental) Import an existing lifecycle policy given its ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.lifecyclePolicyArn- This parameter is required.
-
fromLifecyclePolicyName
@Stability(Experimental) @NotNull public static ILifecyclePolicy fromLifecyclePolicyName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String lifecyclePolicyName) (experimental) Import an existing lifecycle policy given its name.If the name is a token representing a dynamic CloudFormation expression, you must ensure all alphabetic characters in the expression are already lowercased
- Parameters:
scope- This parameter is required.id- This parameter is required.lifecyclePolicyName- This parameter is required.
-
isLifecyclePolicy
(experimental) Return whether the given object is a LifecyclePolicy.- Parameters:
x- This parameter is required.
-
grant
@Stability(Experimental) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions) (experimental) Grant custom actions to the given grantee for the lifecycle policy.- Specified by:
grantin interfaceILifecyclePolicy- Parameters:
grantee- This parameter is required.actions- This parameter is required.
-
grantRead
(experimental) Grant read permissions to the given grantee for the lifecycle policy.- Specified by:
grantReadin interfaceILifecyclePolicy- Parameters:
grantee- This parameter is required.
-
getExecutionRole
(experimental) The execution role used for lifecycle policy executions. -
getLifecyclePolicyArn
(experimental) The ARN of the lifecycle policy.- Specified by:
getLifecyclePolicyArnin interfaceILifecyclePolicy
-
getLifecyclePolicyName
(experimental) The name of the lifecycle policy.- Specified by:
getLifecyclePolicyNamein interfaceILifecyclePolicy
-