CodeInterpreterCustom
- class aws_cdk.aws_bedrock_agentcore_alpha.CodeInterpreterCustom(scope, id, *, code_interpreter_custom_name, description=None, execution_role=None, network_configuration=None, tags=None)
Bases:
CodeInterpreterCustomBase(experimental) Custom code interpreter resource for AWS Bedrock Agent Core.
Provides a sandboxed environment for code execution with configurable network access.
- See:
https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/code-interpreter.html
- Stability:
experimental
- Resource:
AWS::BedrockAgentCore::CodeInterpreterCustom
- ExampleMetadata:
fixture=default infused
Example:
# Create a custom execution role execution_role = iam.Role(self, "CodeInterpreterExecutionRole", assumed_by=iam.ServicePrincipal("bedrock-agentcore.amazonaws.com") ) # Create code interpreter with custom execution role code_interpreter = agentcore.CodeInterpreterCustom(self, "MyCodeInterpreter", code_interpreter_custom_name="my_code_interpreter", description="Code interpreter with custom execution role", network_configuration=agentcore.CodeInterpreterNetworkConfiguration.using_public_network(), execution_role=execution_role )
- Parameters:
scope (
Construct)id (
str)code_interpreter_custom_name (
str) – (experimental) The name of the code interpreter Valid characters are a-z, A-Z, 0-9, _ (underscore) The name must start with a letter and can be up to 48 characters long Pattern: [a-zA-Z][a-zA-Z0-9_]{0,47}.description (
Optional[str]) – (experimental) Optional description for the code interpreter Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces The description can have up to 200 characters. Default: - No descriptionexecution_role (
Optional[IRole]) – (experimental) The IAM role that provides permissions for the code interpreter to access AWS services. Default: - A new role will be created.network_configuration (
Optional[CodeInterpreterNetworkConfiguration]) – (experimental) Network configuration for code interpreter. Default: - PUBLIC network modetags (
Optional[Mapping[str,str]]) – (experimental) Tags (optional) A list of key:value pairs of tags to apply to this Code Interpreter resource. Default: {} - no tags
- Stability:
experimental
Methods
- apply_removal_policy(policy)
Apply the given removal policy to this resource.
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).- Parameters:
policy (
RemovalPolicy)- Return type:
None
- grant(grantee, *actions)
(experimental) Grants IAM actions to the IAM Principal.
- Parameters:
grantee (
IGrantable) –The IAM principal to grant permissions to.
actions (
str) –The actions to grant.
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- grant_invoke(grantee)
(experimental) Grant invoke permissions on this code interpreter to an IAM principal.
- Parameters:
grantee (
IGrantable) –The IAM principal to grant invoke permissions to.
- Default:
Default grant configuration:
actions: [‘bedrock-agentcore:InvokeCodeInterpreter’]
resourceArns: [this.codeInterpreterArn]
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- grant_read(grantee)
(experimental) Grant read permissions on this code interpreter to an IAM principal.
This includes both read permissions on the specific code interpreter and list permissions on all code interpreters.
- Parameters:
grantee (
IGrantable) –The IAM principal to grant read permissions to.
- Default:
Default grant configuration:
actions: [‘bedrock-agentcore:GetCodeInterpreter’, ‘bedrock-agentcore:GetCodeInterpreterSession’] on this.codeInterpreterArn
actions: [‘bedrock-agentcore:ListCodeInterpreters’, ‘bedrock-agentcore:ListCodeInterpreterSessions’] on all resources (*)
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- grant_use(grantee)
(experimental) Grant invoke permissions on this code interpreter to an IAM principal.
- Parameters:
grantee (
IGrantable) –The IAM principal to grant invoke permissions to.
- Default:
Default grant configuration:
actions: [‘bedrock-agentcore:StartCodeInterpreterSession’, ‘bedrock-agentcore:InvokeCodeInterpreter’, ‘bedrock-agentcore:StopCodeInterpreterSession’]
resourceArns: [this.codeInterpreterArn]
- Return type:
- Returns:
An IAM Grant object representing the granted permissions
- Stability:
experimental
- metric(metric_name, dimensions, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Return the given named metric for this code interpreter.
By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the
statisticandperiodproperties.- Parameters:
metric_name (
str)dimensions (
Mapping[str,str])account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) – Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No labelperiod (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Stability:
experimental
- Return type:
- metric_errors_for_api_operation(operation, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Creates a CloudWatch metric for tracking code interpreter errors.
- Parameters:
operation (
str)account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Default:
Default metric configuration:
namespace: ‘AWS/Bedrock-AgentCore’
metricName: Errors
- Return type:
- Returns:
A CloudWatch Metric configured for code interpreter errors
- Stability:
experimental
- metric_for_api_operation(metric_name, operation, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Creates a CloudWatch metric for tracking code interpreter api operations..
- Parameters:
metric_name (
str)operation (
str)account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Default:
Default metric configuration:
namespace: ‘AWS/Bedrock-AgentCore’
metricName: metricName
dimensionsMap: { CodeInterpreterId: this.codeInterpreterId }
- Return type:
- Returns:
A CloudWatch Metric configured for code interpreter api operations
- Stability:
experimental
- metric_invocations_for_api_operation(operation, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Creates a CloudWatch metric for tracking code interpreter invocations.
- Parameters:
operation (
str)account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Default:
Default metric configuration:
namespace: ‘AWS/Bedrock-AgentCore’
metricName: Invocations
- Return type:
- Returns:
A CloudWatch Metric configured for code interpreter invocations
- Stability:
experimental
- metric_latency_for_api_operation(operation, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Creates a CloudWatch metric for tracking code interpreter latencies.
- Parameters:
operation (
str)account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Default:
Default metric configuration:
namespace: ‘AWS/Bedrock-AgentCore’
metricName: Latency
- Return type:
- Returns:
A CloudWatch Metric configured for code interpreter latencies
- Stability:
experimental
- metric_session_duration(*, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Creates a CloudWatch metric for tracking code interpreter session duration.
- Parameters:
account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Default:
Default metric configuration:
namespace: ‘AWS/Bedrock-AgentCore’
metricName: Duration
- Return type:
- Returns:
A CloudWatch Metric configured for code interpreter session duration
- Stability:
experimental
- metric_system_errors_for_api_operation(operation, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Creates a CloudWatch metric for tracking code interpreter system errors.
- Parameters:
operation (
str)account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Default:
Default metric configuration:
namespace: ‘AWS/Bedrock-AgentCore’
metricName: SystemErrors
- Return type:
- Returns:
A CloudWatch Metric configured for code interpreter system errors
- Stability:
experimental
- metric_throttles_for_api_operation(operation, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Creates a CloudWatch metric for tracking code interpreter throttles.
- Parameters:
operation (
str)account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Default:
Default metric configuration:
namespace: ‘AWS/Bedrock-AgentCore’
metricName: Throttles
- Return type:
- Returns:
A CloudWatch Metric configured for code interpreter throttles
- Stability:
experimental
- metric_user_errors_for_api_operation(operation, *, account=None, color=None, dimensions_map=None, id=None, label=None, period=None, region=None, stack_account=None, stack_region=None, statistic=None, unit=None, visible=None)
(experimental) Creates a CloudWatch metric for tracking code interpreter user errors.
- Parameters:
operation (
str)account (
Optional[str]) – Account which this metric comes from. Default: - Deployment account.color (
Optional[str]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColorclass has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional[Mapping[str,str]]) – Dimensions of the metric. Default: - No dimensions.id (
Optional[str]) – Unique identifier for this metric when used in dashboard widgets. The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Default: - No IDlabel (
Optional[str]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional[str]) – Region which this metric comes from. Default: - Deployment region.stack_account (
Optional[str]) – Account of the stack this metric is attached to. Default: - Deployment account.stack_region (
Optional[str]) – Region of the stack this metric is attached to. Default: - Deployment region.statistic (
Optional[str]) – What function to use for aggregating. Use theaws_cloudwatch.Statshelper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional[Unit]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric streamvisible (
Optional[bool]) – Whether this metric should be visible in dashboard graphs. Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results. Default: true
- Default:
Default metric configuration:
namespace: ‘AWS/Bedrock-AgentCore’
metricName: UserErrors
- Return type:
- Returns:
A CloudWatch Metric configured for code interpreter user errors
- Stability:
experimental
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- PROPERTY_INJECTION_ID = '@aws-cdk.aws-bedrock-agentcore-alpha.CodeInterpreterCustom'
- code_interpreter_arn
(experimental) The ARN of the code interpreter resource.
- Stability:
experimental
- Attribute:
true
- code_interpreter_id
(experimental) The id of the code interpreter.
- Stability:
experimental
- Attribute:
true
- connections
(experimental) An accessor for the Connections object that will fail if this Browser does not have a VPC configured.
- Stability:
experimental
- created_at
(experimental) The created timestamp of the code interpreter.
- Stability:
experimental
- Attribute:
true
- description
(experimental) The description of the code interpreter.
- Stability:
experimental
- env
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
- execution_role
(experimental) The IAM role that provides permissions for the code interpreter to access AWS services.
- Stability:
experimental
- failure_reason
(experimental) The failure reason of the code interpreter.
- Stability:
experimental
- Attribute:
true
- grant_principal
(experimental) The principal to grant permissions to.
- Stability:
experimental
- last_updated_at
(experimental) The last updated timestamp of the code interpreter.
- Stability:
experimental
- Attribute:
true
- name
(experimental) The name of the code interpreter.
- Stability:
experimental
- network_configuration
(experimental) The network configuration of the code interpreter.
- Stability:
experimental
- node
The tree node.
- stack
The stack in which this resource is defined.
- status
(experimental) The status of the code interpreter.
- Stability:
experimental
- Attribute:
true
- tags
(experimental) Tags applied to this code interpreter resource A map of key-value pairs for resource tagging.
- Default:
No tags applied
- Stability:
experimental
Static Methods
- classmethod from_code_interpreter_custom_attributes(scope, id, *, code_interpreter_arn, role_arn, created_at=None, last_updated_at=None, security_groups=None, status=None)
(experimental) Creates an Code Interpreter Custom reference from an existing code interpreter’s attributes.
- Parameters:
scope (
Construct) –The construct scope.
id (
str) –Identifier of the construct.
code_interpreter_arn (
str) – (experimental) The ARN of the agent.role_arn (
str) – (experimental) The ARN of the IAM role associated to the code interpreter.created_at (
Optional[str]) – (experimental) The created timestamp of the code interpreter. Default: undefined - No created timestamp is providedlast_updated_at (
Optional[str]) – (experimental) When this code interpreter was last updated. Default: undefined - No last updated timestamp is providedsecurity_groups (
Optional[Sequence[ISecurityGroup]]) – (experimental) The security groups for this code interpreter, if in a VPC. Default: - By default, the code interpreter is not in a VPC.status (
Optional[str]) – (experimental) The status of the code interpreter. Default: undefined - No status is provided
- Return type:
- Returns:
An ICodeInterpreterCustom reference to the existing code interpreter
- Stability:
experimental
- 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.
- classmethod is_owned_resource(construct)
Returns true if the construct was created by CDK, and false otherwise.
- Parameters:
construct (
IConstruct)- Return type:
bool
- classmethod is_resource(construct)
Check whether the given construct is a Resource.
- Parameters:
construct (
IConstruct)- Return type:
bool