Class: AWSCDK::BedrockAgentCore::GatewayTargetLambdaProps

Inherits:
GatewayTargetCommonProps
  • Object
show all
Defined in:
bedrock_agent_core/gateway_target_lambda_props.rb

Overview

Properties for creating a Lambda-based Gateway Target Convenience interface for the most common use case.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description: nil, gateway_target_name: nil, gateway:, lambda_function:, tool_schema:, credential_provider_configurations: nil) ⇒ GatewayTargetLambdaProps

Returns a new instance of GatewayTargetLambdaProps.

Parameters:

  • description (String, nil) (defaults to: nil)

    Optional description for the gateway target The description can have up to 200 characters.

  • gateway_target_name (String, nil) (defaults to: nil)

    The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?)1,100$.

  • gateway (AWSCDK::BedrockAgentCore::IGateway)

    The gateway this target belongs to.

  • lambda_function (AWSCDK::Lambda::IFunction)

    The Lambda function to associate with this target.

  • tool_schema (AWSCDK::BedrockAgentCore::ToolSchema)

    The tool schema defining the available tools.

  • credential_provider_configurations (Array<AWSCDK::BedrockAgentCore::ICredentialProviderConfig>, nil) (defaults to: nil)

    Credential providers for authentication Lambda targets only support IAM role authentication.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'bedrock_agent_core/gateway_target_lambda_props.rb', line 13

def initialize(description: nil, gateway_target_name: nil, gateway:, lambda_function:, tool_schema:, credential_provider_configurations: nil)
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @gateway_target_name = gateway_target_name
  Jsii::Type.check_type(@gateway_target_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "gatewayTargetName") unless @gateway_target_name.nil?
  @gateway = gateway
  Jsii::Type.check_type(@gateway, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5JR2F0ZXdheSJ9")), "gateway")
  @lambda_function = lambda_function
  Jsii::Type.check_type(@lambda_function, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "lambdaFunction")
  @tool_schema = tool_schema
  Jsii::Type.check_type(@tool_schema, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5Ub29sU2NoZW1hIn0=")), "toolSchema")
  @credential_provider_configurations = credential_provider_configurations
  Jsii::Type.check_type(@credential_provider_configurations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrYWdlbnRjb3JlLklDcmVkZW50aWFsUHJvdmlkZXJDb25maWcifSwia2luZCI6ImFycmF5In19")), "credentialProviderConfigurations") unless @credential_provider_configurations.nil?
end

Instance Attribute Details

#credential_provider_configurationsArray<AWSCDK::BedrockAgentCore::ICredentialProviderConfig>? (readonly)

Note:

Default: - [GatewayCredentialProvider.fromIamRole()]

Credential providers for authentication Lambda targets only support IAM role authentication.



54
55
56
# File 'bedrock_agent_core/gateway_target_lambda_props.rb', line 54

def credential_provider_configurations
  @credential_provider_configurations
end

#descriptionString? (readonly)

Note:

Default: - No description

Optional description for the gateway target The description can have up to 200 characters.

Returns:

  • (String, nil)


32
33
34
# File 'bedrock_agent_core/gateway_target_lambda_props.rb', line 32

def description
  @description
end

#gatewayAWSCDK::BedrockAgentCore::IGateway (readonly)

The gateway this target belongs to.



41
42
43
# File 'bedrock_agent_core/gateway_target_lambda_props.rb', line 41

def gateway
  @gateway
end

#gateway_target_nameString? (readonly)

Note:

Default: - auto generate

The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?)1,100$.

Returns:

  • (String, nil)


37
38
39
# File 'bedrock_agent_core/gateway_target_lambda_props.rb', line 37

def gateway_target_name
  @gateway_target_name
end

#lambda_functionAWSCDK::Lambda::IFunction (readonly)

The Lambda function to associate with this target.



45
46
47
# File 'bedrock_agent_core/gateway_target_lambda_props.rb', line 45

def lambda_function
  @lambda_function
end

#tool_schemaAWSCDK::BedrockAgentCore::ToolSchema (readonly)

The tool schema defining the available tools.



49
50
51
# File 'bedrock_agent_core/gateway_target_lambda_props.rb', line 49

def tool_schema
  @tool_schema
end

Class Method Details

.jsii_propertiesObject



56
57
58
59
60
61
62
63
64
65
# File 'bedrock_agent_core/gateway_target_lambda_props.rb', line 56

def self.jsii_properties
  {
    :description => "description",
    :gateway_target_name => "gatewayTargetName",
    :gateway => "gateway",
    :lambda_function => "lambdaFunction",
    :tool_schema => "toolSchema",
    :credential_provider_configurations => "credentialProviderConfigurations",
  }
end

Instance Method Details

#to_jsiiObject



67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'bedrock_agent_core/gateway_target_lambda_props.rb', line 67

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "description" => @description,
    "gatewayTargetName" => @gateway_target_name,
    "gateway" => @gateway,
    "lambdaFunction" => @lambda_function,
    "toolSchema" => @tool_schema,
    "credentialProviderConfigurations" => @credential_provider_configurations,
  })
  result.compact
end