Class: AWSCDK::BedrockAgentCore::AgentRuntimeArtifact

Inherits:
Jsii::Object
  • Object
show all
Defined in:
bedrock_agent_core/agent_runtime_artifact.rb

Overview

Abstract base class for agent runtime artifacts.

Provides methods to reference container images from ECR repositories or local assets.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAgentRuntimeArtifact

Returns a new instance of AgentRuntimeArtifact.



10
11
12
# File 'bedrock_agent_core/agent_runtime_artifact.rb', line 10

def initialize
  Jsii::Object.instance_method(:initialize).bind(self).call
end

Class Method Details

.from_asset(directory, options = nil) ⇒ AWSCDK::BedrockAgentCore::AgentRuntimeArtifact

Reference an agent runtime artifact that's constructed directly from sources on disk.

Parameters:

Returns:

  • (AWSCDK::BedrockAgentCore::AgentRuntimeArtifact)


25
26
27
28
29
30
# File 'bedrock_agent_core/agent_runtime_artifact.rb', line 25

def self.from_asset(directory, options = nil)
  Jsii::Type.check_type(directory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "directory")
  options = options.is_a?(Hash) ? ::AWSCDK::ECRAssets::DockerImageAssetOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNyX2Fzc2V0cy5Eb2NrZXJJbWFnZUFzc2V0T3B0aW9ucyJ9")), "options") unless options.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrockagentcore.AgentRuntimeArtifact", "fromAsset", [directory, options])
end

.from_code_asset(options) ⇒ AWSCDK::BedrockAgentCore::AgentRuntimeArtifact

Reference an agent runtime artifact that's constructed from local code assets uploaded to a CDK-managed S3 bucket.

Parameters:

Returns:

  • (AWSCDK::BedrockAgentCore::AgentRuntimeArtifact)


36
37
38
39
40
# File 'bedrock_agent_core/agent_runtime_artifact.rb', line 36

def self.from_code_asset(options)
  options = options.is_a?(Hash) ? ::AWSCDK::BedrockAgentCore::CodeAssetOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5Db2RlQXNzZXRPcHRpb25zIn0=")), "options")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrockagentcore.AgentRuntimeArtifact", "fromCodeAsset", [options])
end

.from_ecr_repository(repository, tag = nil) ⇒ AWSCDK::BedrockAgentCore::AgentRuntimeArtifact

Reference an image in an ECR repository.

Parameters:

Returns:

  • (AWSCDK::BedrockAgentCore::AgentRuntimeArtifact)


47
48
49
50
51
# File 'bedrock_agent_core/agent_runtime_artifact.rb', line 47

def self.from_ecr_repository(repository, tag = nil)
  Jsii::Type.check_type(repository, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNyLklSZXBvc2l0b3J5In0=")), "repository")
  Jsii::Type.check_type(tag, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tag") unless tag.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrockagentcore.AgentRuntimeArtifact", "fromEcrRepository", [repository, tag])
end

.from_image_uri(container_uri) ⇒ AWSCDK::BedrockAgentCore::AgentRuntimeArtifact

Reference an image using an ECR container URI.

Use this when referencing ECR images from CloudFormation parameters or cross-stack references.

Note: No IAM permissions are automatically granted. You must ensure the runtime has ECR pull permissions for the repository.

Parameters:

  • container_uri (String)

    The ECR container image URI (format: account.dkr.ecr.region.amazonaws.com/repository:tag).

Returns:

  • (AWSCDK::BedrockAgentCore::AgentRuntimeArtifact)


62
63
64
65
# File 'bedrock_agent_core/agent_runtime_artifact.rb', line 62

def self.from_image_uri(container_uri)
  Jsii::Type.check_type(container_uri, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerUri")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrockagentcore.AgentRuntimeArtifact", "fromImageUri", [container_uri])
end

.from_s3(s3_location, runtime, entrypoint) ⇒ AWSCDK::BedrockAgentCore::AgentRuntimeArtifact

Reference an agent runtime artifact that's constructed directly from an S3 object.

Parameters:

  • s3_location (AWSCDK::S3::Location)

    The source code location and configuration details.

  • runtime (AWSCDK::BedrockAgentCore::AgentCoreRuntime)

    The runtime environment for executing the code.

  • entrypoint (Array<String>)

    The entry point for the code execution, specifying the function or method that should be invoked when the code runs.

Returns:

  • (AWSCDK::BedrockAgentCore::AgentRuntimeArtifact)


73
74
75
76
77
78
79
# File 'bedrock_agent_core/agent_runtime_artifact.rb', line 73

def self.from_s3(s3_location, runtime, entrypoint)
  s3_location = s3_location.is_a?(Hash) ? ::AWSCDK::S3::Location.new(**s3_location.transform_keys(&:to_sym)) : s3_location
  Jsii::Type.check_type(s3_location, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuTG9jYXRpb24ifQ==")), "s3Location")
  Jsii::Type.check_type(runtime, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5BZ2VudENvcmVSdW50aW1lIn0=")), "runtime")
  Jsii::Type.check_type(entrypoint, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "entrypoint")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrockagentcore.AgentRuntimeArtifact", "fromS3", [s3_location, runtime, entrypoint])
end

.jsii_overridable_methodsObject



14
15
16
17
18
# File 'bedrock_agent_core/agent_runtime_artifact.rb', line 14

def self.jsii_overridable_methods
  {
    :bind => { kind: :method, name: "bind", is_optional: false },
  }
end

Instance Method Details

#bind(scope, runtime) ⇒ void

This method returns an undefined value.

Called when the image is used by a Runtime to handle side effects like permissions.

Parameters:



86
87
88
89
90
# File 'bedrock_agent_core/agent_runtime_artifact.rb', line 86

def bind(scope, runtime)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(runtime, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5SdW50aW1lIn0=")), "runtime")
  jsii_call_method("bind", [scope, runtime])
end