Skip to content

(aws-bedrock-agentcore-alpha): Runtime defaults idleRuntimeSessionTimeout to 60s instead of 900s #36376

@nakedible-p

Description

@nakedible-p

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:

  1. not render LifecycleConfiguration at all (let AgentCore apply its defaults), or
  2. 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

  1. Use [email protected] and @aws-cdk/[email protected]
  2. 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
});
  1. Run npx cdk synth
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions