Interface LifecycleConfiguration

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
LifecycleConfiguration.Jsii$Proxy

@Generated(value="jsii-pacmak/1.129.0 (build eaca441)", date="2026-05-19T08:18:44.454Z") @Stability(Stable) public interface LifecycleConfiguration extends software.amazon.jsii.JsiiSerializable
LifecycleConfiguration lets you manage the lifecycle of runtime sessions and resources in AgentCore Runtime.

This configuration helps optimize resource utilization by automatically cleaning up idle sessions and preventing long-running instances from consuming resources indefinitely.

Example:

 Repository repository = Repository.Builder.create(this, "TestRepository")
         .repositoryName("test-agent-runtime")
         .build();
 AgentRuntimeArtifact agentRuntimeArtifact = AgentRuntimeArtifact.fromEcrRepository(repository, "v1.0.0");
 Runtime.Builder.create(this, "test-runtime")
         .runtimeName("test_runtime")
         .agentRuntimeArtifact(agentRuntimeArtifact)
         .lifecycleConfiguration(LifecycleConfiguration.builder()
                 .idleRuntimeSessionTimeout(Duration.minutes(10))
                 .maxLifetime(Duration.hours(4))
                 .build())
         .build();
 
  • Method Details

    • getIdleRuntimeSessionTimeout

      @Stability(Stable) @Nullable default Duration getIdleRuntimeSessionTimeout()
      Timeout in seconds for idle runtime sessions.

      When a session remains idle for this duration, it will be automatically terminated.

      Default: undefined - service default setting is 900 seconds (15 minutes)

    • getMaxLifetime

      @Stability(Stable) @Nullable default Duration getMaxLifetime()
      Maximum lifetime for the instance in seconds.

      Once reached, instances will be automatically terminated and replaced.

      Default: undefined - service default setting is 28800 seconds (8 hours)

    • builder

      @Stability(Stable) static LifecycleConfiguration.Builder builder()
      Returns:
      a LifecycleConfiguration.Builder of LifecycleConfiguration