Describe the bug
When I create an AgentCore Runtime using @aws-cdk/aws-bedrock-agentcore-alpha and I do not specify lifecycleConfiguration, the synthesized CloudFormation template sets LifecycleConfiguration.IdleRuntimeSessionTimeout to 60 seconds.
This makes AgentCore runtime sessions terminate after 60s idle, which is inconsistent with the AgentCore service defaults and the CDK docs.
Expected Behavior
If lifecycleConfiguration is omitted, CDK should either:
- not render
LifecycleConfiguration at all (let AgentCore apply its defaults), or
- render the documented defaults:
idleRuntimeSessionTimeout = 900 seconds (15 minutes) and maxLifetime = 28800 seconds (8 hours).
Current Behavior
CDK renders:
"LifecycleConfiguration": {
"IdleRuntimeSessionTimeout": 60,
"MaxLifetime": 28800
}
Result: runtime sessions terminate after 60 seconds of idleness, causing frequent cold starts and breaking warm caching.
Reproduction Steps
- Use
aws-cdk-lib@2.232.1 and @aws-cdk/aws-bedrock-agentcore-alpha@2.232.1-alpha.0
- Create a runtime without
lifecycleConfiguration:
import * as agentcore from '@aws-cdk/aws-bedrock-agentcore-alpha';
import * as ecr from 'aws-cdk-lib/aws-ecr';
const repo = ecr.Repository.fromRepositoryName(this, 'Repo', 'my-agent-repo');
new agentcore.Runtime(this, 'Runtime', {
runtimeName: 'test_runtime',
agentRuntimeArtifact: agentcore.AgentRuntimeArtifact.fromEcrRepository(repo, 'v1'),
// lifecycleConfiguration intentionally omitted
});
- Run
npx cdk synth
- Inspect the synthesized template: it sets
IdleRuntimeSessionTimeout to 60.
Notes / References
Suggested fix
Change the construct default from the minimum allowed value (60s) to the documented default (900s), or omit the property when the user doesn’t specify it.
Describe the bug
When I create an AgentCore Runtime using
@aws-cdk/aws-bedrock-agentcore-alphaand I do not specifylifecycleConfiguration, the synthesized CloudFormation template setsLifecycleConfiguration.IdleRuntimeSessionTimeoutto 60 seconds.This makes AgentCore runtime sessions terminate after 60s idle, which is inconsistent with the AgentCore service defaults and the CDK docs.
Expected Behavior
If
lifecycleConfigurationis omitted, CDK should either:LifecycleConfigurationat all (let AgentCore apply its defaults), oridleRuntimeSessionTimeout = 900seconds (15 minutes) andmaxLifetime = 28800seconds (8 hours).Current Behavior
CDK renders:
Result: runtime sessions terminate after 60 seconds of idleness, causing frequent cold starts and breaking warm caching.
Reproduction Steps
aws-cdk-lib@2.232.1and@aws-cdk/aws-bedrock-agentcore-alpha@2.232.1-alpha.0lifecycleConfiguration:npx cdk synthIdleRuntimeSessionTimeoutto60.Notes / References
idleRuntimeSessionTimeoutdefaults to 900 seconds if not provided: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-lifecycle-settings.htmlLifecycleConfiguration.idleRuntimeSessionTimeoutalso state default 900 seconds: https://docs.aws.amazon.com/cdk/api/v2/docs/%40aws-cdk_aws-bedrock-agentcore-alpha.LifecycleConfiguration.htmlSuggested fix
Change the construct default from the minimum allowed value (60s) to the documented default (900s), or omit the property when the user doesn’t specify it.