-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Open
Description
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
LifecycleConfigurationat all (let AgentCore apply its defaults), or - render the documented defaults:
idleRuntimeSessionTimeout = 900seconds (15 minutes) andmaxLifetime = 28800seconds (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
[email protected]and@aws-cdk/[email protected] - 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
IdleRuntimeSessionTimeoutto60.
Notes / References
- AgentCore docs say
idleRuntimeSessionTimeoutdefaults to 900 seconds if not provided: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-lifecycle-settings.html - CDK API docs for
LifecycleConfiguration.idleRuntimeSessionTimeoutalso state default 900 seconds: https://docs.aws.amazon.com/cdk/api/v2/docs/%40aws-cdk_aws-bedrock-agentcore-alpha.LifecycleConfiguration.html
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.
Metadata
Metadata
Assignees
Labels
No labels