CfnRuntime
- class aws_cdk.aws_bedrockagentcore.CfnRuntime(scope, id, *, agent_runtime_artifact, agent_runtime_name, network_configuration, role_arn, authorizer_configuration=None, description=None, environment_variables=None, lifecycle_configuration=None, protocol_configuration=None, request_header_configuration=None, tags=None)
Bases:
CfnResourceContains information about an agent runtime. An agent runtime is the execution environment for a Amazon Bedrock Agent.
AgentCore Runtime is a secure, serverless runtime purpose-built for deploying and scaling dynamic AI agents and tools using any open-source framework including LangGraph, CrewAI, and Strands Agents, any protocol, and any model.
For more information about using agent runtime in Amazon Bedrock AgentCore, see Host agent or tools with Amazon Bedrock AgentCore Runtime .
See the Properties section below for descriptions of both the required and optional properties.
- See:
- CloudformationResource:
AWS::BedrockAgentCore::Runtime
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_bedrockagentcore as bedrockagentcore cfn_runtime = bedrockagentcore.CfnRuntime(self, "MyCfnRuntime", agent_runtime_artifact=bedrockagentcore.CfnRuntime.AgentRuntimeArtifactProperty( code_configuration=bedrockagentcore.CfnRuntime.CodeConfigurationProperty( code=bedrockagentcore.CfnRuntime.CodeProperty( s3=bedrockagentcore.CfnRuntime.S3LocationProperty( bucket="bucket", prefix="prefix", # the properties below are optional version_id="versionId" ) ), entry_point=["entryPoint"], runtime="runtime" ), container_configuration=bedrockagentcore.CfnRuntime.ContainerConfigurationProperty( container_uri="containerUri" ) ), agent_runtime_name="agentRuntimeName", network_configuration=bedrockagentcore.CfnRuntime.NetworkConfigurationProperty( network_mode="networkMode", # the properties below are optional network_mode_config=bedrockagentcore.CfnRuntime.VpcConfigProperty( security_groups=["securityGroups"], subnets=["subnets"] ) ), role_arn="roleArn", # the properties below are optional authorizer_configuration=bedrockagentcore.CfnRuntime.AuthorizerConfigurationProperty( custom_jwt_authorizer=bedrockagentcore.CfnRuntime.CustomJWTAuthorizerConfigurationProperty( discovery_url="discoveryUrl", # the properties below are optional allowed_audience=["allowedAudience"], allowed_clients=["allowedClients"] ) ), description="description", environment_variables={ "environment_variables_key": "environmentVariables" }, lifecycle_configuration=bedrockagentcore.CfnRuntime.LifecycleConfigurationProperty( idle_runtime_session_timeout=123, max_lifetime=123 ), protocol_configuration="protocolConfiguration", request_header_configuration=bedrockagentcore.CfnRuntime.RequestHeaderConfigurationProperty( request_header_allowlist=["requestHeaderAllowlist"] ), tags={ "tags_key": "tags" } )
Create a new
AWS::BedrockAgentCore::Runtime.- Parameters:
scope (
Construct) – Scope in which this resource is defined.id (
str) – Construct identifier for this resource (unique in its scope).agent_runtime_artifact (
Union[IResolvable,AgentRuntimeArtifactProperty,Dict[str,Any]]) – The artifact of the agent.agent_runtime_name (
str) – The name of the AgentCore Runtime endpoint.network_configuration (
Union[IResolvable,NetworkConfigurationProperty,Dict[str,Any]]) – The network configuration.role_arn (
str) – The Amazon Resource Name (ARN) for for the role.authorizer_configuration (
Union[IResolvable,AuthorizerConfigurationProperty,Dict[str,Any],None]) – Represents inbound authorization configuration options used to authenticate incoming requests.description (
Optional[str]) – The agent runtime description.environment_variables (
Union[Mapping[str,str],IResolvable,None]) – The environment variables for the agent.lifecycle_configuration (
Union[IResolvable,LifecycleConfigurationProperty,Dict[str,Any],None]) – Configuration for managing the lifecycle of runtime sessions and resources.protocol_configuration (
Optional[str]) – The protocol configuration for an agent runtime. This structure defines how the agent runtime communicates with clients.request_header_configuration (
Union[IResolvable,RequestHeaderConfigurationProperty,Dict[str,Any],None]) – Configuration for HTTP request headers.tags (
Optional[Mapping[str,str]]) – The tags for the agent.
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined).- Parameters:
path (
str) – The path of the value to delete.- Return type:
None
- add_dependency(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource)- Return type:
None
- add_depends_on(target)
(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
- Parameters:
target (
CfnResource)- Deprecated:
use addDependency
- Stability:
deprecated
- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str)value (
Any)
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverrideor prefixpathwith “Properties.” (i.e.Properties.TopicName).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.in the property name, prefix with a\. In most programming languages you will need to write this as"\\."because the\itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
valueargument toaddOverridewill not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str) –The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed.
value (
Any) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value).- Parameters:
property_path (
str) – The path of the property.value (
Any) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:- Parameters:
policy (
Optional[RemovalPolicy])apply_to_update_replace_policy (
Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.
- See:
- Return type:
None
- get_att(attribute_name, type_hint=None)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str) – The name of the attribute.type_hint (
Optional[ResolutionTypeHint])
- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str)- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector) – tree inspector to collect and process attributes.- Return type:
None
- obtain_dependencies()
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
- Return type:
List[Union[Stack,CfnResource]]
- obtain_resource_dependencies()
Get a shallow copy of dependencies between this resource and other resources in the same stack.
- Return type:
List[CfnResource]
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str) – The new logical ID to use for this stack element.- Return type:
None
- remove_dependency(target)
Indicates that this resource no longer depends on another resource.
This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
- Parameters:
target (
CfnResource)- Return type:
None
- replace_dependency(target, new_target)
Replaces one dependency with another.
- Parameters:
target (
CfnResource) – The dependency to replace.new_target (
CfnResource) – The new dependency to add.
- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::BedrockAgentCore::Runtime'
- agent_runtime_artifact
The artifact of the agent.
- agent_runtime_name
The name of the AgentCore Runtime endpoint.
- attr_agent_runtime_arn
The agent runtime ARN.
- CloudformationAttribute:
AgentRuntimeArn
- attr_agent_runtime_id
The ID for the agent runtime.
- CloudformationAttribute:
AgentRuntimeId
- attr_agent_runtime_version
The version for the agent runtime.
- CloudformationAttribute:
AgentRuntimeVersion
- attr_created_at
The time at which the runtime was created.
- CloudformationAttribute:
CreatedAt
- attr_last_updated_at
The time at which the runtime was last updated.
- CloudformationAttribute:
LastUpdatedAt
- attr_status
The status for the agent runtime.
- CloudformationAttribute:
Status
- attr_workload_identity_details
Configuration for workload identity.
- CloudformationAttribute:
WorkloadIdentityDetails
- authorizer_configuration
Represents inbound authorization configuration options used to authenticate incoming requests.
- cdk_tag_manager
Tag Manager which manages the tags for this resource.
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- description
The agent runtime description.
- env
- environment_variables
The environment variables for the agent.
- lifecycle_configuration
Configuration for managing the lifecycle of runtime sessions and resources.
- logical_id
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId).- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- network_configuration
The network configuration.
- node
The tree node.
- protocol_configuration
The protocol configuration for an agent runtime.
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref }).
- request_header_configuration
Configuration for HTTP request headers.
- role_arn
The Amazon Resource Name (ARN) for for the role.
- runtime_ref
A reference to a Runtime resource.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- tags
The tags for the agent.
Static Methods
- classmethod is_cfn_element(x)
Returns
trueif a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceofto allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any)- Return type:
bool- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(x)
Check whether the given object is a CfnResource.
- Parameters:
x (
Any)- Return type:
bool
- classmethod is_construct(x)
Checks if
xis a construct.Use this method instead of
instanceofto properly detectConstructinstances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the classConstructin each copy of theconstructslibrary is seen as a different class, and an instance of one class will not test asinstanceofthe other class.npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructslibrary can be accidentally installed, andinstanceofwill behave unpredictably. It is safest to avoid usinginstanceof, and using this type-testing method instead.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsConstruct.
AgentRuntimeArtifactProperty
- class CfnRuntime.AgentRuntimeArtifactProperty(*, code_configuration=None, container_configuration=None)
Bases:
objectThe artifact of the agent.
- Parameters:
code_configuration (
Union[IResolvable,CodeConfigurationProperty,Dict[str,Any],None]) – Representation of a code configuration.container_configuration (
Union[IResolvable,ContainerConfigurationProperty,Dict[str,Any],None]) – Representation of a container configuration.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_bedrockagentcore as bedrockagentcore agent_runtime_artifact_property = bedrockagentcore.CfnRuntime.AgentRuntimeArtifactProperty( code_configuration=bedrockagentcore.CfnRuntime.CodeConfigurationProperty( code=bedrockagentcore.CfnRuntime.CodeProperty( s3=bedrockagentcore.CfnRuntime.S3LocationProperty( bucket="bucket", prefix="prefix", # the properties below are optional version_id="versionId" ) ), entry_point=["entryPoint"], runtime="runtime" ), container_configuration=bedrockagentcore.CfnRuntime.ContainerConfigurationProperty( container_uri="containerUri" ) )
Attributes
- code_configuration
Representation of a code configuration.
- container_configuration
Representation of a container configuration.
CodeConfigurationProperty
- class CfnRuntime.CodeConfigurationProperty(*, code, entry_point, runtime)
Bases:
objectRepresentation of a code configuration.
- Parameters:
code (
Union[IResolvable,CodeProperty,Dict[str,Any]]) – Object represents source code from zip file.entry_point (
Sequence[str]) – List of entry points.runtime (
str) – Managed runtime types.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_bedrockagentcore as bedrockagentcore code_configuration_property = bedrockagentcore.CfnRuntime.CodeConfigurationProperty( code=bedrockagentcore.CfnRuntime.CodeProperty( s3=bedrockagentcore.CfnRuntime.S3LocationProperty( bucket="bucket", prefix="prefix", # the properties below are optional version_id="versionId" ) ), entry_point=["entryPoint"], runtime="runtime" )
Attributes
- code
Object represents source code from zip file.
- entry_point
List of entry points.
CodeProperty
- class CfnRuntime.CodeProperty(*, s3=None)
Bases:
objectObject represents source code from zip file.
- Parameters:
s3 (
Union[IResolvable,S3LocationProperty,Dict[str,Any],None]) – S3 Location Configuration.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_bedrockagentcore as bedrockagentcore code_property = bedrockagentcore.CfnRuntime.CodeProperty( s3=bedrockagentcore.CfnRuntime.S3LocationProperty( bucket="bucket", prefix="prefix", # the properties below are optional version_id="versionId" ) )
Attributes
ContainerConfigurationProperty
- class CfnRuntime.ContainerConfigurationProperty(*, container_uri)
Bases:
objectThe container configuration.
- Parameters:
container_uri (
str) – The container Uri.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_bedrockagentcore as bedrockagentcore container_configuration_property = bedrockagentcore.CfnRuntime.ContainerConfigurationProperty( container_uri="containerUri" )
Attributes
LifecycleConfigurationProperty
- class CfnRuntime.LifecycleConfigurationProperty(*, idle_runtime_session_timeout=None, max_lifetime=None)
Bases:
objectConfiguration for managing the lifecycle of runtime sessions and resources.
- Parameters:
idle_runtime_session_timeout (
Union[int,float,None]) – Timeout in seconds for idle runtime sessions.max_lifetime (
Union[int,float,None]) – Maximum lifetime in seconds for runtime sessions.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_bedrockagentcore as bedrockagentcore lifecycle_configuration_property = bedrockagentcore.CfnRuntime.LifecycleConfigurationProperty( idle_runtime_session_timeout=123, max_lifetime=123 )
Attributes
- idle_runtime_session_timeout
Timeout in seconds for idle runtime sessions.
- max_lifetime
Maximum lifetime in seconds for runtime sessions.
NetworkConfigurationProperty
- class CfnRuntime.NetworkConfigurationProperty(*, network_mode, network_mode_config=None)
Bases:
objectThe network configuration for the agent.
- Parameters:
network_mode (
str) – The network mode.network_mode_config (
Union[IResolvable,VpcConfigProperty,Dict[str,Any],None]) – Network mode configuration for VPC.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_bedrockagentcore as bedrockagentcore network_configuration_property = bedrockagentcore.CfnRuntime.NetworkConfigurationProperty( network_mode="networkMode", # the properties below are optional network_mode_config=bedrockagentcore.CfnRuntime.VpcConfigProperty( security_groups=["securityGroups"], subnets=["subnets"] ) )
Attributes
- network_mode
The network mode.
- network_mode_config
Network mode configuration for VPC.
RequestHeaderConfigurationProperty
- class CfnRuntime.RequestHeaderConfigurationProperty(*, request_header_allowlist=None)
Bases:
objectConfiguration for HTTP request headers.
- Parameters:
request_header_allowlist (
Optional[Sequence[str]]) – List of allowed HTTP headers for agent runtime requests.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_bedrockagentcore as bedrockagentcore request_header_configuration_property = bedrockagentcore.CfnRuntime.RequestHeaderConfigurationProperty( request_header_allowlist=["requestHeaderAllowlist"] )
Attributes
- request_header_allowlist
List of allowed HTTP headers for agent runtime requests.
S3LocationProperty
- class CfnRuntime.S3LocationProperty(*, bucket, prefix, version_id=None)
Bases:
objectS3 Location Configuration.
- Parameters:
bucket (
str) – S3 bucket name.prefix (
str) – S3 object key prefix.version_id (
Optional[str]) – S3 object version ID.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_bedrockagentcore as bedrockagentcore s3_location_property = bedrockagentcore.CfnRuntime.S3LocationProperty( bucket="bucket", prefix="prefix", # the properties below are optional version_id="versionId" )
Attributes
- bucket
S3 bucket name.
- prefix
S3 object key prefix.
VpcConfigProperty
- class CfnRuntime.VpcConfigProperty(*, security_groups, subnets)
Bases:
objectNetwork mode configuration for VPC.
- Parameters:
security_groups (
Sequence[str]) – Security groups for VPC.subnets (
Sequence[str]) – Subnets for VPC.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_bedrockagentcore as bedrockagentcore vpc_config_property = bedrockagentcore.CfnRuntime.VpcConfigProperty( security_groups=["securityGroups"], subnets=["subnets"] )
Attributes
- security_groups
Security groups for VPC.
WorkloadIdentityDetailsProperty
- class CfnRuntime.WorkloadIdentityDetailsProperty(*, workload_identity_arn)
Bases:
objectThe workload identity details for the agent.
- Parameters:
workload_identity_arn (
str) – The Amazon Resource Name (ARN) for the workload identity.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_bedrockagentcore as bedrockagentcore workload_identity_details_property = bedrockagentcore.CfnRuntime.WorkloadIdentityDetailsProperty( workload_identity_arn="workloadIdentityArn" )
Attributes
- workload_identity_arn
The Amazon Resource Name (ARN) for the workload identity.