Skip to content
v2.277.0

Experimental

@aws-cdk/aws-bedrock-agentcore-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

LifecycleConfiguration Struct ​

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 ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';
import * as cdk from 'aws-cdk-lib';
const lifecycleConfiguration: bedrock_agentcore_alpha.LifecycleConfiguration = {
  idleRuntimeSessionTimeout: cdk.Duration.minutes(30),
  maxLifetime: cdk.Duration.minutes(30),
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha
import aws_cdk as cdk

lifecycle_configuration = bedrock_agentcore_alpha.LifecycleConfiguration(
    idle_runtime_session_timeout=cdk.Duration.minutes(30),
    max_lifetime=cdk.Duration.minutes(30)
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;
import software.amazon.awscdk.*;

LifecycleConfiguration lifecycleConfiguration = LifecycleConfiguration.builder()
        .idleRuntimeSessionTimeout(Duration.minutes(30))
        .maxLifetime(Duration.minutes(30))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;
using Amazon.CDK;

var lifecycleConfiguration = new LifecycleConfiguration {
    IdleRuntimeSessionTimeout = Duration.Minutes(30),
    MaxLifetime = Duration.Minutes(30)
};
go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import bedrock_agentcore_alpha "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"
import "github.com/aws/aws-cdk-go/awscdk"

lifecycleConfiguration := &LifecycleConfiguration{
	IdleRuntimeSessionTimeout: cdk.Duration_Minutes(jsii.Number(30)),
	MaxLifetime: cdk.Duration_*Minutes(jsii.Number(30)),
}

Properties ​

idleRuntimeSessionTimeoutoptionalDurationidle_runtime_session_timeoutoptionalDurationidleRuntimeSessionTimeoutoptionalDurationIdleRuntimeSessionTimeoutoptionalDurationIdleRuntimeSessionTimeoutoptionalDuration#
Timeout in seconds for idle runtime sessions.

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

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

maxLifetimeoptionalDurationmax_lifetimeoptionalDurationmaxLifetimeoptionalDurationMaxLifetimeoptionalDurationMaxLifetimeoptionalDuration#
Maximum lifetime for the instance in seconds.

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

Once reached, instances will be automatically terminated and replaced.