Class: AWSCDK::S3Vectors::CfnIndexProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
s3_vectors/cfn_index_props.rb

Overview

Properties for defining a CfnIndex.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_type:, dimension:, distance_metric:, encryption_configuration: nil, index_name: nil, metadata_configuration: nil, tags: nil, vector_bucket_arn: nil, vector_bucket_name: nil) ⇒ CfnIndexProps

Returns a new instance of CfnIndexProps.

Parameters:

  • data_type (String)

    The data type of the vectors to be inserted into the vector index.

  • dimension (Numeric)

    The dimensions of the vectors to be inserted into the vector index.

  • distance_metric (String)

    The distance metric to be used for similarity search. Valid values are:.

  • encryption_configuration (AWSCDK::IResolvable, AWSCDK::S3Vectors::CfnIndex::EncryptionConfigurationProperty, nil) (defaults to: nil)

    The encryption configuration for a vector index.

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

    The name of the vector index to create.

  • metadata_configuration (AWSCDK::IResolvable, AWSCDK::S3Vectors::CfnIndex::MetadataConfigurationProperty, nil) (defaults to: nil)

    The metadata configuration for the vector index.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    User tags (key-value pairs) to associate with the index.

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

    The Amazon Resource Name (ARN) of the vector bucket that contains the vector index.

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

    The name of the vector bucket that contains the vector index.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 's3_vectors/cfn_index_props.rb', line 18

def initialize(data_type:, dimension:, distance_metric:, encryption_configuration: nil, index_name: nil, metadata_configuration: nil, tags: nil, vector_bucket_arn: nil, vector_bucket_name: nil)
  @data_type = data_type
  Jsii::Type.check_type(@data_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dataType")
  @dimension = dimension
  Jsii::Type.check_type(@dimension, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "dimension")
  @distance_metric = distance_metric
  Jsii::Type.check_type(@distance_metric, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "distanceMetric")
  @encryption_configuration = encryption_configuration.is_a?(Hash) ? ::AWSCDK::S3Vectors::CfnIndex::EncryptionConfigurationProperty.new(**encryption_configuration.transform_keys(&:to_sym)) : encryption_configuration
  Jsii::Type.check_type(@encryption_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zM3ZlY3RvcnMuQ2ZuSW5kZXguRW5jcnlwdGlvbkNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "encryptionConfiguration") unless @encryption_configuration.nil?
  @index_name = index_name
  Jsii::Type.check_type(@index_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "indexName") unless @index_name.nil?
  @metadata_configuration = .is_a?(Hash) ? ::AWSCDK::S3Vectors::CfnIndex::MetadataConfigurationProperty.new(**.transform_keys(&:to_sym)) : 
  Jsii::Type.check_type(@metadata_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zM3ZlY3RvcnMuQ2ZuSW5kZXguTWV0YWRhdGFDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "metadataConfiguration") unless @metadata_configuration.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @vector_bucket_arn = vector_bucket_arn
  Jsii::Type.check_type(@vector_bucket_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "vectorBucketArn") unless @vector_bucket_arn.nil?
  @vector_bucket_name = vector_bucket_name
  Jsii::Type.check_type(@vector_bucket_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "vectorBucketName") unless @vector_bucket_name.nil?
end

Instance Attribute Details

#data_typeString (readonly)

The data type of the vectors to be inserted into the vector index.

Currently, only float32 is supported, which represents 32-bit floating-point numbers.



45
46
47
# File 's3_vectors/cfn_index_props.rb', line 45

def data_type
  @data_type
end

#dimensionNumeric (readonly)

The dimensions of the vectors to be inserted into the vector index.

This value must be between 1 and 4096, inclusive. All vectors stored in the index must have the same number of dimensions.

The dimension value affects the storage requirements and search performance. Higher dimensions require more storage space and may impact search latency.



54
55
56
# File 's3_vectors/cfn_index_props.rb', line 54

def dimension
  @dimension
end

#distance_metricString (readonly)

The distance metric to be used for similarity search. Valid values are:.

  • cosine - Measures the cosine of the angle between two vectors.
  • euclidean - Measures the straight-line distance between two points in multi-dimensional space. Lower values indicate greater similarity.


62
63
64
# File 's3_vectors/cfn_index_props.rb', line 62

def distance_metric
  @distance_metric
end

#encryption_configurationAWSCDK::IResolvable, ... (readonly)

The encryption configuration for a vector index.

By default, if you don't specify, all new vectors in the vector index will use the encryption configuration of the vector bucket.



69
70
71
# File 's3_vectors/cfn_index_props.rb', line 69

def encryption_configuration
  @encryption_configuration
end

#index_nameString? (readonly)

The name of the vector index to create.

The index name must be between 3 and 63 characters long and can contain only lowercase letters, numbers, hyphens (-), and dots (.). The index name must be unique within the vector bucket.

If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the index name.

If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you need to replace the resource, specify a new name.



80
81
82
# File 's3_vectors/cfn_index_props.rb', line 80

def index_name
  @index_name
end

#metadata_configurationAWSCDK::IResolvable, ... (readonly)

The metadata configuration for the vector index.



85
86
87
# File 's3_vectors/cfn_index_props.rb', line 85

def 
  @metadata_configuration
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

User tags (key-value pairs) to associate with the index.



90
91
92
# File 's3_vectors/cfn_index_props.rb', line 90

def tags
  @tags
end

#vector_bucket_arnString? (readonly)

The Amazon Resource Name (ARN) of the vector bucket that contains the vector index.



95
96
97
# File 's3_vectors/cfn_index_props.rb', line 95

def vector_bucket_arn
  @vector_bucket_arn
end

#vector_bucket_nameString? (readonly)

The name of the vector bucket that contains the vector index.



100
101
102
# File 's3_vectors/cfn_index_props.rb', line 100

def vector_bucket_name
  @vector_bucket_name
end

Class Method Details

.jsii_propertiesObject



102
103
104
105
106
107
108
109
110
111
112
113
114
# File 's3_vectors/cfn_index_props.rb', line 102

def self.jsii_properties
  {
    :data_type => "dataType",
    :dimension => "dimension",
    :distance_metric => "distanceMetric",
    :encryption_configuration => "encryptionConfiguration",
    :index_name => "indexName",
    :metadata_configuration => "metadataConfiguration",
    :tags => "tags",
    :vector_bucket_arn => "vectorBucketArn",
    :vector_bucket_name => "vectorBucketName",
  }
end

Instance Method Details

#to_jsiiObject



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 's3_vectors/cfn_index_props.rb', line 116

def to_jsii
  result = {}
  result.merge!({
    "dataType" => @data_type,
    "dimension" => @dimension,
    "distanceMetric" => @distance_metric,
    "encryptionConfiguration" => @encryption_configuration,
    "indexName" => @index_name,
    "metadataConfiguration" => @metadata_configuration,
    "tags" => @tags,
    "vectorBucketArn" => @vector_bucket_arn,
    "vectorBucketName" => @vector_bucket_name,
  })
  result.compact
end