Class CfnLifecycleAutomation

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.ssmquicksetup.CfnLifecycleAutomation
All Implemented Interfaces:
IInspectable, ITaggableV2, ILifecycleAutomationRef, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)", date="2025-10-24T13:34:47.723Z") @Stability(Stable) public class CfnLifecycleAutomation extends CfnResource implements IInspectable, ILifecycleAutomationRef, ITaggableV2
Creates a lifecycle automation resource that executes SSM Automation documents during AWS CloudFormation stack operations.

This resource replaces inline AWS Lambda custom resources and provides a managed way to handle lifecycle events in Quick Setup configurations.

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.ssmquicksetup.*;
 CfnLifecycleAutomation cfnLifecycleAutomation = CfnLifecycleAutomation.Builder.create(this, "MyCfnLifecycleAutomation")
         .automationDocument("automationDocument")
         .automationParameters(Map.of(
                 "automationParametersKey", List.of("automationParameters")))
         .resourceKey("resourceKey")
         // the properties below are optional
         .tags(Map.of(
                 "tagsKey", "tags"))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnLifecycleAutomation

      protected CfnLifecycleAutomation(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnLifecycleAutomation

      protected CfnLifecycleAutomation(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnLifecycleAutomation

      @Stability(Stable) public CfnLifecycleAutomation(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnLifecycleAutomationProps 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

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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 class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrAssociationId

      @Stability(Stable) @NotNull public String getAttrAssociationId()
      Returns the ID of the SSM Association created to manage the automation document execution lifecycle.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getLifecycleAutomationRef

      @Stability(Stable) @NotNull public LifecycleAutomationReference getLifecycleAutomationRef()
      A reference to a LifecycleAutomation resource.
      Specified by:
      getLifecycleAutomationRef in interface ILifecycleAutomationRef
    • getAutomationDocument

      @Stability(Stable) @NotNull public String getAutomationDocument()
      The name of the SSM Automation document to execute in response to AWS CloudFormation lifecycle events (CREATE, UPDATE, DELETE).
    • setAutomationDocument

      @Stability(Stable) public void setAutomationDocument(@NotNull String value)
      The name of the SSM Automation document to execute in response to AWS CloudFormation lifecycle events (CREATE, UPDATE, DELETE).
    • getAutomationParameters

      @Stability(Stable) @NotNull public Object getAutomationParameters()
      A map of key-value parameters passed to the Automation document during execution.

      Returns union: either IResolvable or Mapinvalid input: '<'String, Listinvalid input: '<'String>>

    • setAutomationParameters

      @Stability(Stable) public void setAutomationParameters(@NotNull IResolvable value)
      A map of key-value parameters passed to the Automation document during execution.
    • setAutomationParameters

      @Stability(Stable) public void setAutomationParameters(@NotNull Map<String,List<String>> value)
      A map of key-value parameters passed to the Automation document during execution.
    • getResourceKey

      @Stability(Stable) @NotNull public String getResourceKey()
      A unique identifier used for generating the SSM Association name.
    • setResourceKey

      @Stability(Stable) public void setResourceKey(@NotNull String value)
      A unique identifier used for generating the SSM Association name.
    • getTags

      @Stability(Stable) @Nullable public Map<String,String> getTags()
      Tags applied to the underlying SSM Association created by this resource.
    • setTags

      @Stability(Stable) public void setTags(@Nullable Map<String,String> value)
      Tags applied to the underlying SSM Association created by this resource.