Class: AWSCDK::Bedrock::CfnKnowledgeBase::MongoDBAtlasConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock/cfn_knowledge_base.rb

Overview

Contains details about the storage configuration of the knowledge base in MongoDB Atlas.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collection_name:, credentials_secret_arn:, database_name:, endpoint:, field_mapping:, vector_index_name:, endpoint_service_name: nil, text_index_name: nil) ⇒ MongoDBAtlasConfigurationProperty

Returns a new instance of MongoDBAtlasConfigurationProperty.

Parameters:

  • collection_name (String)

    The collection name of the knowledge base in MongoDB Atlas.

  • credentials_secret_arn (String)

    The Amazon Resource Name (ARN) of the secret that you created in AWS Secrets Manager that contains user credentials for your MongoDB Atlas cluster.

  • database_name (String)

    The database name in your MongoDB Atlas cluster for your knowledge base.

  • endpoint (String)

    The endpoint URL of your MongoDB Atlas cluster for your knowledge base.

  • field_mapping (AWSCDK::IResolvable, AWSCDK::Bedrock::CfnKnowledgeBase::MongoDBAtlasFieldMappingProperty)

    Contains the names of the fields to which to map information about the vector store.

  • vector_index_name (String)

    The name of the MongoDB Atlas vector search index.

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

    The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.

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

    The name of the text search index in the MongoDB collection.



1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
# File 'bedrock/cfn_knowledge_base.rb', line 1086

def initialize(collection_name:, credentials_secret_arn:, database_name:, endpoint:, field_mapping:, vector_index_name:, endpoint_service_name: nil, text_index_name: nil)
  @collection_name = collection_name
  Jsii::Type.check_type(@collection_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "collectionName")
  @credentials_secret_arn = credentials_secret_arn
  Jsii::Type.check_type(@credentials_secret_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "credentialsSecretArn")
  @database_name = database_name
  Jsii::Type.check_type(@database_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "databaseName")
  @endpoint = endpoint
  Jsii::Type.check_type(@endpoint, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "endpoint")
  @field_mapping = field_mapping.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnKnowledgeBase::MongoDBAtlasFieldMappingProperty.new(**field_mapping.transform_keys(&:to_sym)) : field_mapping
  Jsii::Type.check_type(@field_mapping, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbktub3dsZWRnZUJhc2UuTW9uZ29EYkF0bGFzRmllbGRNYXBwaW5nUHJvcGVydHkifV19fQ==")), "fieldMapping")
  @vector_index_name = vector_index_name
  Jsii::Type.check_type(@vector_index_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "vectorIndexName")
  @endpoint_service_name = endpoint_service_name
  Jsii::Type.check_type(@endpoint_service_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "endpointServiceName") unless @endpoint_service_name.nil?
  @text_index_name = text_index_name
  Jsii::Type.check_type(@text_index_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "textIndexName") unless @text_index_name.nil?
end

Instance Attribute Details

#collection_nameString (readonly)

The collection name of the knowledge base in MongoDB Atlas.



1109
1110
1111
# File 'bedrock/cfn_knowledge_base.rb', line 1109

def collection_name
  @collection_name
end

#credentials_secret_arnString (readonly)

The Amazon Resource Name (ARN) of the secret that you created in AWS Secrets Manager that contains user credentials for your MongoDB Atlas cluster.



1114
1115
1116
# File 'bedrock/cfn_knowledge_base.rb', line 1114

def credentials_secret_arn
  @credentials_secret_arn
end

#database_nameString (readonly)

The database name in your MongoDB Atlas cluster for your knowledge base.



1119
1120
1121
# File 'bedrock/cfn_knowledge_base.rb', line 1119

def database_name
  @database_name
end

#endpointString (readonly)

The endpoint URL of your MongoDB Atlas cluster for your knowledge base.



1124
1125
1126
# File 'bedrock/cfn_knowledge_base.rb', line 1124

def endpoint
  @endpoint
end

#endpoint_service_nameString? (readonly)

The name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster.



1139
1140
1141
# File 'bedrock/cfn_knowledge_base.rb', line 1139

def endpoint_service_name
  @endpoint_service_name
end

#field_mappingAWSCDK::IResolvable, AWSCDK::Bedrock::CfnKnowledgeBase::MongoDBAtlasFieldMappingProperty (readonly)

Contains the names of the fields to which to map information about the vector store.



1129
1130
1131
# File 'bedrock/cfn_knowledge_base.rb', line 1129

def field_mapping
  @field_mapping
end

#text_index_nameString? (readonly)

The name of the text search index in the MongoDB collection.

This is required for using the hybrid search feature.



1146
1147
1148
# File 'bedrock/cfn_knowledge_base.rb', line 1146

def text_index_name
  @text_index_name
end

#vector_index_nameString (readonly)

The name of the MongoDB Atlas vector search index.



1134
1135
1136
# File 'bedrock/cfn_knowledge_base.rb', line 1134

def vector_index_name
  @vector_index_name
end

Class Method Details

.jsii_propertiesObject



1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
# File 'bedrock/cfn_knowledge_base.rb', line 1148

def self.jsii_properties
  {
    :collection_name => "collectionName",
    :credentials_secret_arn => "credentialsSecretArn",
    :database_name => "databaseName",
    :endpoint => "endpoint",
    :field_mapping => "fieldMapping",
    :vector_index_name => "vectorIndexName",
    :endpoint_service_name => "endpointServiceName",
    :text_index_name => "textIndexName",
  }
end

Instance Method Details

#to_jsiiObject



1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
# File 'bedrock/cfn_knowledge_base.rb', line 1161

def to_jsii
  result = {}
  result.merge!({
    "collectionName" => @collection_name,
    "credentialsSecretArn" => @credentials_secret_arn,
    "databaseName" => @database_name,
    "endpoint" => @endpoint,
    "fieldMapping" => @field_mapping,
    "vectorIndexName" => @vector_index_name,
    "endpointServiceName" => @endpoint_service_name,
    "textIndexName" => @text_index_name,
  })
  result.compact
end