Skip to content
v2.278.0

RuntimeProps Struct ​

Properties for creating a Bedrock Agent Core Runtime resource.

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,
});
python
# S3 bucket containing the agent core
code_bucket = s3.Bucket(self, "AgentCode",
    bucket_name="my-code-bucket",
    removal_policy=RemovalPolicy.DESTROY
)

# the bucket above needs to contain the agent code

agent_runtime_artifact = agentcore.AgentRuntimeArtifact.from_s3(s3.Location(
    bucket_name=code_bucket.bucket_name,
    object_key="deployment_package.zip"
), agentcore.AgentCoreRuntime.PYTHON_3_12, ["opentelemetry-instrument", "main.py"])

runtime_instance = agentcore.Runtime(self, "MyAgentRuntime",
    runtime_name="myAgent",
    agent_runtime_artifact=agent_runtime_artifact
)
java
// S3 bucket containing the agent core
Bucket codeBucket = Bucket.Builder.create(this, "AgentCode")
        .bucketName("my-code-bucket")
        .removalPolicy(RemovalPolicy.DESTROY)
        .build();

// the bucket above needs to contain the agent code

AgentRuntimeArtifact agentRuntimeArtifact = AgentRuntimeArtifact.fromS3(Location.builder()
        .bucketName(codeBucket.getBucketName())
        .objectKey("deployment_package.zip")
        .build(), AgentCoreRuntime.PYTHON_3_12, List.of("opentelemetry-instrument", "main.py"));

Runtime runtimeInstance = Runtime.Builder.create(this, "MyAgentRuntime")
        .runtimeName("myAgent")
        .agentRuntimeArtifact(agentRuntimeArtifact)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// S3 bucket containing the agent core
var codeBucket = new Bucket(this, "AgentCode", new BucketProps {
    BucketName = "my-code-bucket",
    RemovalPolicy = RemovalPolicy.DESTROY
});

// the bucket above needs to contain the agent code

var agentRuntimeArtifact = AgentRuntimeArtifact.FromS3(new Location {
    BucketName = codeBucket.BucketName,
    ObjectKey = "deployment_package.zip"
}, AgentCoreRuntime.PYTHON_3_12, new [] { "opentelemetry-instrument", "main.py" });

var runtimeInstance = new Runtime(this, "MyAgentRuntime", new RuntimeProps {
    RuntimeName = "myAgent",
    AgentRuntimeArtifact = agentRuntimeArtifact
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// S3 bucket containing the agent core
codeBucket := s3.NewBucket(this, jsii.String("AgentCode"), &BucketProps{
	BucketName: jsii.String("my-code-bucket"),
	RemovalPolicy: awscdk.RemovalPolicy_DESTROY,
})

// the bucket above needs to contain the agent code

agentRuntimeArtifact := agentcore.AgentRuntimeArtifact_FromS3(&Location{
	BucketName: codeBucket.bucketName,
	ObjectKey: jsii.String("deployment_package.zip"),
}, agentcore.AgentCoreRuntime_PYTHON_3_12(), []*string{
	jsii.String("opentelemetry-instrument"),
	jsii.String("main.py"),
})

runtimeInstance := agentcore.NewRuntime(this, jsii.String("MyAgentRuntime"), &RuntimeProps{
	RuntimeName: jsii.String("myAgent"),
	AgentRuntimeArtifact: agentRuntimeArtifact,
})

Properties ​

agentRuntimeArtifactAgentRuntimeArtifactagent_runtime_artifactAgentRuntimeArtifactagentRuntimeArtifactAgentRuntimeArtifactAgentRuntimeArtifactAgentRuntimeArtifactAgentRuntimeArtifactAgentRuntimeArtifact required #
The artifact configuration for the agent runtime Contains the container configuration with ECR URI.
authorizerConfigurationoptionalRuntimeAuthorizerConfigurationauthorizer_configurationoptionalRuntimeAuthorizerConfigurationauthorizerConfigurationoptionalRuntimeAuthorizerConfigurationAuthorizerConfigurationoptionalRuntimeAuthorizerConfigurationAuthorizerConfigurationoptionalRuntimeAuthorizerConfiguration #
Authorizer configuration for the agent runtime Use RuntimeAuthorizerConfiguration static methods to create the configuration.

Default: RuntimeAuthorizerConfiguration.iam() (IAM authentication)

buildHooksoptionalBuildLifecycleHooksbuild_hooksoptionalBuildLifecycleHooksbuildHooksoptionalBuildLifecycleHooksBuildHooksoptionalBuildLifecycleHooksBuildHooksoptionalBuildLifecycleHooks #
Hooks the AgentCore service calls on the agent's container while it builds the runtime.

Default: no build hooks

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #
Optional description for the agent runtime.

Default: No description Length Minimum: 1 , Maximum: 1200

environmentVariablesoptional{ [key: string]: string }environment_variablesoptionaltyping.Mapping[str, str]environmentVariablesoptionalMap<String, String>EnvironmentVariablesoptionalIDictionary<string, string>EnvironmentVariablesoptional*map[string]*string #
Environment variables for the agent runtime - Maximum 50 environment variables - Key: Must be 1-100 characters, start with letter or underscore, contain only letters, numbers, and underscores - Value: Must be 0-2048 characters (per CloudFormation specification).

Default: No environment variables

executionRoleoptionalIRoleexecution_roleoptionalIRoleexecutionRoleoptionalIRoleExecutionRoleoptionalIRoleExecutionRoleoptionalIRole #
The IAM role that provides permissions for the agent runtime If not provided, a role will be created automatically.

Default: A new role will be created

lifecycleConfigurationoptionalLifecycleConfigurationlifecycle_configurationoptionalLifecycleConfigurationlifecycleConfigurationoptionalLifecycleConfigurationLifecycleConfigurationoptionalLifecycleConfigurationLifecycleConfigurationoptionalLifecycleConfiguration #
The life cycle configuration for the AgentCore Runtime.

Default: No lifecycle configuration

loggingConfigsoptionalLoggingConfig[]logging_configsoptionaltyping.List[LoggingConfig]loggingConfigsoptionalList<LoggingConfig>LoggingConfigsoptionalLoggingConfig[]LoggingConfigsoptional*[]LoggingConfig #
Logging configuration for the runtime.

Default: No logging configured

Allows sending APPLICATION_LOGS and USAGE_LOGS to CloudWatch Logs, S3, or Kinesis Data Firehose.

manageDeliveryResourcePolicyoptionalbooleanmanage_delivery_resource_policyoptionalboolmanageDeliveryResourcePolicyoptionalBooleanManageDeliveryResourcePolicyoptionalboolManageDeliveryResourcePolicyoptional*bool = true #
Whether to create resource policies for log/trace delivery.
notes

When false, the AWS::Logs::ResourcePolicy and AWS::XRay::ResourcePolicy are not created. This is useful when deploying many runtimes per account/Region, as each resource policy consumes an account-level quota slot (CloudWatch Logs: 10, X-Ray: lower).

Setting false means you are responsible for ensuring delivery permissions exist. There are two safe ways to use this:

  • Same-account delivery to a /aws/vendedlogs/ log group, where the log-delivery service-linked role grants write access implicitly.
  • Attaching the delivery resource policy yourself.

Otherwise delivery silently fails: synthesis and deploy succeed, but nothing is delivered. Per the vended-logs delivery docs, a resource policy is required for CloudWatch Logs delivery outside the /aws/vendedlogs/ same-account case.

minimumMemoryoptionalSizeminimum_memoryoptionalSizeminimumMemoryoptionalSizeMinimumMemoryoptionalSizeMinimumMemoryoptionalSize #
The minimum memory for each runtime session.

Default: the service default

Must be a whole number of MiB. The service validates which values are allowed.

networkConfigurationoptionalRuntimeNetworkConfigurationnetwork_configurationoptionalRuntimeNetworkConfigurationnetworkConfigurationoptionalRuntimeNetworkConfigurationNetworkConfigurationoptionalRuntimeNetworkConfigurationNetworkConfigurationoptionalRuntimeNetworkConfiguration #
Network configuration for the agent runtime.

Default: RuntimeNetworkConfiguration.usingPublicNetwork()

platformVersionoptionalPlatformVersionplatform_versionoptionalPlatformVersionplatformVersionoptionalPlatformVersionPlatformVersionoptionalPlatformVersionPlatformVersionoptionalPlatformVersion #
The platform version of the runtime.

Default: the AgentCore service default platform version

When omitted, the property is not rendered and the AgentCore service applies its own default platform version.

protocolConfigurationoptionalProtocolTypeprotocol_configurationoptionalProtocolTypeprotocolConfigurationoptionalProtocolTypeProtocolConfigurationoptionalProtocolTypeProtocolConfigurationoptionalProtocolType = ProtocolType.HTTP #
Protocol configuration for the agent runtime.
requestHeaderConfigurationoptionalRequestHeaderConfigurationrequest_header_configurationoptionalRequestHeaderConfigurationrequestHeaderConfigurationoptionalRequestHeaderConfigurationRequestHeaderConfigurationoptionalRequestHeaderConfigurationRequestHeaderConfigurationoptionalRequestHeaderConfiguration #
Configuration for HTTP request headers that will be passed through to the runtime.

Default: No request headers configured

runtimeNameoptionalstringruntime_nameoptionalstrruntimeNameoptionalStringRuntimeNameoptionalstringRuntimeNameoptional*string #
The name of the agent runtime Valid characters are a-z, A-Z, 0-9, _ (underscore) Must start with a letter and can be up to 48 characters long Pattern: ^[a-zA-Z][a-zA-Z0-9_]{0,47}$.

Default: auto generate

tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string #
Tags for the agent runtime A list of key:value pairs of tags to apply to this Runtime resource.

Default: {} - no tags

tracingEnabledoptionalbooleantracing_enabledoptionalbooltracingEnabledoptionalBooleanTracingEnabledoptionalboolTracingEnabledoptional*bool = false #
Whether to enable X-Ray tracing for this runtime. When enabled, traces will be delivered to AWS X-Ray.

Tracing requires CloudWatch Transaction Search to be enabled in the account and Region, so that the X-Ray trace segment destination is CloudWatch Logs. Without it the deploy fails. This is a one-time, account-wide setting.