interface LifecycleConfiguration
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.LifecycleConfiguration |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#LifecycleConfiguration |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.LifecycleConfiguration |
Python | aws_cdk.aws_bedrock_agentcore_alpha.LifecycleConfiguration |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป LifecycleConfiguration |
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
const repository = new ecr.Repository(this, "TestRepository", {
repositoryName: "test-agent-runtime",
});
const agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, "v1.0.0");
new agentcore.Runtime(this, 'test-runtime', {
runtimeName: 'test_runtime',
agentRuntimeArtifact: agentRuntimeArtifact,
lifecycleConfiguration: {
idleRuntimeSessionTimeout: Duration.minutes(10),
maxLifetime: Duration.hours(4),
},
});
Properties
| Name | Type | Description |
|---|---|---|
| idle | Duration | Timeout in seconds for idle runtime sessions. |
| max | Duration | Maximum lifetime for the instance in seconds. |
idleRuntimeSessionTimeout?
Type:
Duration
(optional, default: 900 seconds (15 minutes))
Timeout in seconds for idle runtime sessions.
When a session remains idle for this duration, it will be automatically terminated. Default: 900 seconds (15 minutes).
maxLifetime?
Type:
Duration
(optional, default: 28800 seconds (8 hours))
Maximum lifetime for the instance in seconds.
Once reached, instances will be automatically terminated and replaced. Default: 28800 seconds (8 hours).

.NET
Go
Java
Python
TypeScript (