Class CodeInterpreterCustomBase

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.bedrockagentcore.CodeInterpreterCustomBase
All Implemented Interfaces:
ICodeInterpreterCustomRef, IEnvironmentAware, IResource, ICodeInterpreterCustom, IConnectable, IGrantable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable
Direct Known Subclasses:
CodeInterpreterCustom

@Generated(value="jsii-pacmak/1.129.0 (build eaca441)", date="2026-05-19T08:18:44.371Z") @Stability(Stable) public abstract class CodeInterpreterCustomBase extends Resource implements ICodeInterpreterCustom
Abstract base class for a Code Interpreter.

Contains methods and attributes valid for Code Interpreters either created with CDK or imported.

  • Constructor Details

    • CodeInterpreterCustomBase

      protected CodeInterpreterCustomBase(software.amazon.jsii.JsiiObjectRef objRef)
    • CodeInterpreterCustomBase

      protected CodeInterpreterCustomBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CodeInterpreterCustomBase

      @Stability(Stable) protected CodeInterpreterCustomBase(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ResourceProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • CodeInterpreterCustomBase

      @Stability(Stable) protected CodeInterpreterCustomBase(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • grant

      @Stability(Stable) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions)
      Grants IAM actions to the IAM Principal.

      [disable-awslint:no-grants]

      Specified by:
      grant in interface ICodeInterpreterCustom
      Parameters:
      grantee -
      • The IAM principal to grant permissions to.
      This parameter is required.
      actions -
      • The actions to grant.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantInvoke

      @Stability(Stable) @NotNull public Grant grantInvoke(@NotNull IGrantable grantee)
      Grant invoke permissions on this code interpreter to an IAM principal.

      [disable-awslint:no-grants]

      Default: - Default grant configuration: - actions: ['bedrock-agentcore:InvokeCodeInterpreter'] - resourceArns: [this.codeInterpreterArn]

      Parameters:
      grantee -
      • The IAM principal to grant invoke permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantRead

      @Stability(Stable) @NotNull public Grant grantRead(@NotNull IGrantable grantee)
      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.

      [disable-awslint:no-grants]

      Default: - Default grant configuration: - actions: ['bedrock-agentcore:GetCodeInterpreter', 'bedrock-agentcore:GetCodeInterpreterSession'] on this.codeInterpreterArn - actions: ['bedrock-agentcore:ListCodeInterpreters', 'bedrock-agentcore:ListCodeInterpreterSessions'] on all resources (*)

      Specified by:
      grantRead in interface ICodeInterpreterCustom
      Parameters:
      grantee -
      • The IAM principal to grant read permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • grantUse

      @Stability(Stable) @NotNull public Grant grantUse(@NotNull IGrantable grantee)
      Grant invoke permissions on this code interpreter to an IAM principal.

      [disable-awslint:no-grants]

      Default: - Default grant configuration: - actions: ['bedrock-agentcore:StartCodeInterpreterSession', 'bedrock-agentcore:InvokeCodeInterpreter', 'bedrock-agentcore:StopCodeInterpreterSession'] - resourceArns: [this.codeInterpreterArn]

      Specified by:
      grantUse in interface ICodeInterpreterCustom
      Parameters:
      grantee -
      • The IAM principal to grant invoke permissions to.
      This parameter is required.
      Returns:
      An IAM Grant object representing the granted permissions
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
      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 statistic and period properties.

      Specified by:
      metric in interface ICodeInterpreterCustom
      Parameters:
      metricName - This parameter is required.
      props -
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName)
      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 statistic and period properties.

      Specified by:
      metric in interface ICodeInterpreterCustom
      Parameters:
      metricName - This parameter is required.
    • metricErrorsForApiOperation

      @Stability(Stable) @NotNull public Metric metricErrorsForApiOperation(@NotNull String operation, @Nullable MetricOptions props)
      Creates a CloudWatch metric for tracking code interpreter errors.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: Errors

      Specified by:
      metricErrorsForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      operation - This parameter is required.
      props -
      • Configuration options for the metric.
      Returns:
      A CloudWatch Metric configured for code interpreter errors
    • metricErrorsForApiOperation

      @Stability(Stable) @NotNull public Metric metricErrorsForApiOperation(@NotNull String operation)
      Creates a CloudWatch metric for tracking code interpreter errors.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: Errors

      Specified by:
      metricErrorsForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      operation - This parameter is required.
      Returns:
      A CloudWatch Metric configured for code interpreter errors
    • metricForApiOperation

      @Stability(Stable) @NotNull public Metric metricForApiOperation(@NotNull String metricName, @NotNull String operation, @Nullable MetricOptions props)
      Creates a CloudWatch metric for tracking code interpreter api operations..

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: metricName - dimensionsMap: { CodeInterpreterId: this.codeInterpreterId }

      Specified by:
      metricForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      metricName - This parameter is required.
      operation - This parameter is required.
      props -
      • Configuration options for the metric.
      Returns:
      A CloudWatch Metric configured for code interpreter api operations
    • metricForApiOperation

      @Stability(Stable) @NotNull public Metric metricForApiOperation(@NotNull String metricName, @NotNull String operation)
      Creates a CloudWatch metric for tracking code interpreter api operations..

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: metricName - dimensionsMap: { CodeInterpreterId: this.codeInterpreterId }

      Specified by:
      metricForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      metricName - This parameter is required.
      operation - This parameter is required.
      Returns:
      A CloudWatch Metric configured for code interpreter api operations
    • metricInvocationsForApiOperation

      @Stability(Stable) @NotNull public Metric metricInvocationsForApiOperation(@NotNull String operation, @Nullable MetricOptions props)
      Creates a CloudWatch metric for tracking code interpreter invocations.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: Invocations

      Specified by:
      metricInvocationsForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      operation - This parameter is required.
      props -
      • Configuration options for the metric.
      Returns:
      A CloudWatch Metric configured for code interpreter invocations
    • metricInvocationsForApiOperation

      @Stability(Stable) @NotNull public Metric metricInvocationsForApiOperation(@NotNull String operation)
      Creates a CloudWatch metric for tracking code interpreter invocations.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: Invocations

      Specified by:
      metricInvocationsForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      operation - This parameter is required.
      Returns:
      A CloudWatch Metric configured for code interpreter invocations
    • metricLatencyForApiOperation

      @Stability(Stable) @NotNull public Metric metricLatencyForApiOperation(@NotNull String operation, @Nullable MetricOptions props)
      Creates a CloudWatch metric for tracking code interpreter latencies.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: Latency

      Specified by:
      metricLatencyForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      operation - This parameter is required.
      props -
      • Configuration options for the metric.
      Returns:
      A CloudWatch Metric configured for code interpreter latencies
    • metricLatencyForApiOperation

      @Stability(Stable) @NotNull public Metric metricLatencyForApiOperation(@NotNull String operation)
      Creates a CloudWatch metric for tracking code interpreter latencies.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: Latency

      Specified by:
      metricLatencyForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      operation - This parameter is required.
      Returns:
      A CloudWatch Metric configured for code interpreter latencies
    • metricSessionDuration

      @Stability(Stable) @NotNull public Metric metricSessionDuration(@Nullable MetricOptions props)
      Creates a CloudWatch metric for tracking code interpreter session duration.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: Duration

      Specified by:
      metricSessionDuration in interface ICodeInterpreterCustom
      Parameters:
      props -
      • Configuration options for the metric.
      Returns:
      A CloudWatch Metric configured for code interpreter session duration
    • metricSessionDuration

      @Stability(Stable) @NotNull public Metric metricSessionDuration()
      Creates a CloudWatch metric for tracking code interpreter session duration.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: Duration

      Specified by:
      metricSessionDuration in interface ICodeInterpreterCustom
      Returns:
      A CloudWatch Metric configured for code interpreter session duration
    • metricSystemErrorsForApiOperation

      @Stability(Stable) @NotNull public Metric metricSystemErrorsForApiOperation(@NotNull String operation, @Nullable MetricOptions props)
      Creates a CloudWatch metric for tracking code interpreter system errors.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: SystemErrors

      Specified by:
      metricSystemErrorsForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      operation - This parameter is required.
      props -
      • Configuration options for the metric.
      Returns:
      A CloudWatch Metric configured for code interpreter system errors
    • metricSystemErrorsForApiOperation

      @Stability(Stable) @NotNull public Metric metricSystemErrorsForApiOperation(@NotNull String operation)
      Creates a CloudWatch metric for tracking code interpreter system errors.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: SystemErrors

      Specified by:
      metricSystemErrorsForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      operation - This parameter is required.
      Returns:
      A CloudWatch Metric configured for code interpreter system errors
    • metricThrottlesForApiOperation

      @Stability(Stable) @NotNull public Metric metricThrottlesForApiOperation(@NotNull String operation, @Nullable MetricOptions props)
      Creates a CloudWatch metric for tracking code interpreter throttles.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: Throttles

      Specified by:
      metricThrottlesForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      operation - This parameter is required.
      props -
      • Configuration options for the metric.
      Returns:
      A CloudWatch Metric configured for code interpreter throttles
    • metricThrottlesForApiOperation

      @Stability(Stable) @NotNull public Metric metricThrottlesForApiOperation(@NotNull String operation)
      Creates a CloudWatch metric for tracking code interpreter throttles.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: Throttles

      Specified by:
      metricThrottlesForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      operation - This parameter is required.
      Returns:
      A CloudWatch Metric configured for code interpreter throttles
    • metricUserErrorsForApiOperation

      @Stability(Stable) @NotNull public Metric metricUserErrorsForApiOperation(@NotNull String operation, @Nullable MetricOptions props)
      Creates a CloudWatch metric for tracking code interpreter user errors.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: UserErrors

      Specified by:
      metricUserErrorsForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      operation - This parameter is required.
      props -
      • Configuration options for the metric.
      Returns:
      A CloudWatch Metric configured for code interpreter user errors
    • metricUserErrorsForApiOperation

      @Stability(Stable) @NotNull public Metric metricUserErrorsForApiOperation(@NotNull String operation)
      Creates a CloudWatch metric for tracking code interpreter user errors.

      Default: - Default metric configuration: - namespace: 'AWS/Bedrock-AgentCore' - metricName: UserErrors

      Specified by:
      metricUserErrorsForApiOperation in interface ICodeInterpreterCustom
      Parameters:
      operation - This parameter is required.
      Returns:
      A CloudWatch Metric configured for code interpreter user errors
    • getCodeInterpreterArn

      @Stability(Stable) @NotNull public abstract String getCodeInterpreterArn()
      The ARN of the code interpreter resource.
      Specified by:
      getCodeInterpreterArn in interface ICodeInterpreterCustom
    • getCodeInterpreterCustomRef

      @Stability(Stable) @NotNull public CodeInterpreterCustomReference getCodeInterpreterCustomRef()
      A reference to a CodeInterpreterCustom resource.
      Specified by:
      getCodeInterpreterCustomRef in interface ICodeInterpreterCustomRef
    • getCodeInterpreterId

      @Stability(Stable) @NotNull public abstract String getCodeInterpreterId()
      The id of the code interpreter.
      Specified by:
      getCodeInterpreterId in interface ICodeInterpreterCustom
    • getConnections

      @Stability(Stable) @NotNull public Connections getConnections()
      An accessor for the Connections object that will fail if this Browser does not have a VPC configured.
      Specified by:
      getConnections in interface IConnectable
    • getExecutionRole

      @Stability(Stable) @NotNull public abstract IRole getExecutionRole()
      The IAM role that provides permissions for the code interpreter to access AWS services.
      Specified by:
      getExecutionRole in interface ICodeInterpreterCustom
    • getGrantPrincipal

      @Stability(Stable) @NotNull public abstract IPrincipal getGrantPrincipal()
      The principal to grant permissions to.
      Specified by:
      getGrantPrincipal in interface IGrantable
    • getCreatedAt

      @Stability(Stable) @Nullable public abstract String getCreatedAt()
      Timestamp when the code interpreter was created.
      Specified by:
      getCreatedAt in interface ICodeInterpreterCustom
    • getLastUpdatedAt

      @Stability(Stable) @Nullable public abstract String getLastUpdatedAt()
      Timestamp when the code interpreter was last updated.
      Specified by:
      getLastUpdatedAt in interface ICodeInterpreterCustom
    • getStatus

      @Stability(Stable) @Nullable public abstract String getStatus()
      The status of the code interpreter.
      Specified by:
      getStatus in interface ICodeInterpreterCustom