Skip to content
v2.273.0

AgentCoreRuntime Class ​

Bedrock AgentCore runtime environment for code execution Allowed values: PYTHON_3_10 | PYTHON_3_11 | PYTHON_3_12 | PYTHON_3_13 | PYTHON_3_14 | NODE_22.

Example ​

ts
// S3 bucket containing the agent core
const codeBucket = new s3.Bucket(this, "AgentCode", {
  bucketName: "my-code-bucket",
  removalPolicy: RemovalPolicy.DESTROY, // For demo purposes
});

// the bucket above needs to contain the agent code

const agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromS3(
  {
    bucketName: codeBucket.bucketName,
    objectKey: 'deployment_package.zip',
  },
  agentcore.AgentCoreRuntime.PYTHON_3_12,
  ['opentelemetry-instrument', 'main.py']
);

const runtimeInstance = new agentcore.Runtime(this, "MyAgentRuntime", {
  runtimeName: "myAgent",
  agentRuntimeArtifact: agentRuntimeArtifact,
});

Properties ​

Node.js 22 runtime.
PYTHON_3_10AgentCoreRuntimepython_3_10AgentCoreRuntimePYTHON_3_10AgentCoreRuntimePYTHON_3_10AgentCoreRuntimePYTHON_3_10AgentCoreRuntimerequiredstatic#
Python 3.10 runtime.
PYTHON_3_11AgentCoreRuntimepython_3_11AgentCoreRuntimePYTHON_3_11AgentCoreRuntimePYTHON_3_11AgentCoreRuntimePYTHON_3_11AgentCoreRuntimerequiredstatic#
Python 3.11 runtime.
PYTHON_3_12AgentCoreRuntimepython_3_12AgentCoreRuntimePYTHON_3_12AgentCoreRuntimePYTHON_3_12AgentCoreRuntimePYTHON_3_12AgentCoreRuntimerequiredstatic#
Python 3.12 runtime.
PYTHON_3_13AgentCoreRuntimepython_3_13AgentCoreRuntimePYTHON_3_13AgentCoreRuntimePYTHON_3_13AgentCoreRuntimePYTHON_3_13AgentCoreRuntimerequiredstatic#
Python 3.13 runtime.
PYTHON_3_14AgentCoreRuntimepython_3_14AgentCoreRuntimePYTHON_3_14AgentCoreRuntimePYTHON_3_14AgentCoreRuntimePYTHON_3_14AgentCoreRuntimerequiredstatic#
Python 3.14 runtime.
valuestringvaluestrvalueStringValuestringValue*stringrequired#
The runtime string value.

Methods ​

of(value: string): AgentCoreRuntime // chainable@staticmethod def of(value: str) -> AgentCoreRuntimepublic static AgentCoreRuntime of(String value)public static AgentCoreRuntime Of(string value)func Of(Value *string) AgentCoreRuntimestatic#
Create a custom runtime value for runtimes not yet defined in this enum.
1 parameter

Parameters

  • valuevaluevaluevalueValue — The runtime string value.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns the runtime string value.