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
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-10-31T19:12:59.436Z")
@Stability(Stable)
public class CfnLifecyclePolicy
extends CfnResource
implements IInspectable
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
Modifier and TypeClassDescriptionstatic interface
Contains selection criteria for the lifecycle policy.static interface
Defines criteria for AMIs that are excluded from lifecycle actions.static final class
A fluent builder forCfnLifecyclePolicy
.static interface
Specifies resources that lifecycle policy actions should not apply to.static interface
Defines filters that the lifecycle policy uses to determine impacted resource.static interface
Specifies how the lifecycle policy should apply actions to selected resources.static interface
Defines criteria to exclude AMIs from lifecycle actions based on the last time they were used to launch an instance.static interface
The configuration details for a lifecycle policy resource.static interface
Specifies an Image Builder recipe that the lifecycle policy uses for resource selection.static interface
Resource selection criteria for the lifecycle policy.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnLifecyclePolicy
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnLifecyclePolicy
(software.amazon.jsii.JsiiObjectRef objRef) CfnLifecyclePolicy
(software.constructs.Construct scope, String id, CfnLifecyclePolicyProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe Amazon Resource Name (ARN) of the lifecycle policy 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.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.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setDescription
(String value) Optional description for the lifecycle policy.void
setExecutionRole
(String value) The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to run lifecycle actions.void
The name of the lifecycle policy to create.void
setPolicyDetails
(List<Object> value) Configuration details for the lifecycle policy rules.void
setPolicyDetails
(IResolvable value) Configuration details for the lifecycle policy rules.void
setResourceSelection
(IResolvable value) Selection criteria for the resources that the lifecycle policy applies to.void
Selection criteria for the resources that the lifecycle policy applies to.void
setResourceType
(String value) The type of Image Builder resource that the lifecycle policy applies to.void
Indicates whether the lifecycle policy resource is enabled.void
Tags 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, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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) - 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
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in 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:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) of the lifecycle policy resource. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
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. -
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. -
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.
-