create_index
¶
create_index(
index_name: IndexName,
data_type: DataType,
dimension: Dimension,
distance_metric: DistanceMetric,
*,
config_overrides: Optional[S3VectorsClientConfig] = None,
vector_bucket_name: Optional[VectorBucketName] = None,
vector_bucket_arn: Optional[VectorBucketArn] = None,
metadata_configuration: Optional[MetadataConfiguration] = None,
encryption_configuration: Optional[EncryptionConfiguration] = None,
tags: Optional[TagsMap] = None,
) -> CreateIndexOutput
Creates a vector index within a vector bucket. To specify the vector bucket, you must use either the vector bucket name or the vector bucket Amazon Resource Name (ARN).
- Permissions
-
You must have the
s3vectors:CreateIndexpermission to use this operation.You must have the
s3vectors:TagResourcepermission in addition tos3vectors:CreateIndexpermission to create a vector index with tags.
Parameters:
-
vector_bucket_name(Optional[VectorBucketName], default:None) –The name of the vector bucket to create the vector index in.
-
vector_bucket_arn(Optional[VectorBucketArn], default:None) –The Amazon Resource Name (ARN) of the vector bucket to create the vector index in.
-
index_name(IndexName) –The name of the vector index to create.
-
data_type(DataType) –The data type of the vectors to be inserted into the vector index.
-
dimension(Dimension) –The dimensions of the vectors to be inserted into the vector index.
-
distance_metric(DistanceMetric) –The distance metric to be used for similarity search.
-
metadata_configuration(Optional[MetadataConfiguration], default:None) –The metadata configuration for the vector index.
-
encryption_configuration(Optional[EncryptionConfiguration], default:None) –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.
-
tags(Optional[TagsMap], default:None) –An array of user-defined tags that you would like to apply to the vector index that you are creating. A tag is a key-value pair that you apply to your resources. Tags can help you organize, track costs, and control access to resources. For more information, see Tagging for cost allocation or attribute-based access control (ABAC).
You must have the
s3vectors:TagResourcepermission in addition tos3vectors:CreateIndexpermission to create a vector index with tags.
Raises:
-
AccessDeniedException–Access denied.
-
InternalServerException–The request failed due to an internal server error.
-
RequestTimeoutException–The request timed out. Retry your request.
-
TooManyRequestsException–The request was denied due to request throttling.
-
ValidationException–The requested action isn't valid.
-
ConflictException–The request failed because a vector bucket name or a vector index name already exists. Vector bucket names must be unique within your Amazon Web Services account for each Amazon Web Services Region. Vector index names must be unique within your vector bucket. Choose a different vector bucket name or vector index name, and try again.
-
NotFoundException–The request was rejected because the specified resource can't be found.
-
ServiceQuotaExceededException–Your request exceeds a service quota.
-
ServiceUnavailableException–The service is unavailable. Wait briefly and retry your request. If it continues to fail, increase your waiting time between retries.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_s3vectors/_services/s3_vectors.py
899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 | |