

# Vector indexes


**Note**  
Choose your vector index configuration parameters carefully. After you create a vector index, you can't update the vector index name, dimension, distance metric, or non-filterable metadata keys. To change any of these values, you must create a new vector index.

Vector indexes are resources within vector buckets that store and organize vector data for efficient similarity search operations. When you create a vector index, you specify the distance metric (`Cosine` or `Euclidean`), the number of dimensions that a vector should have, and optionally a list of metadata fields that you want to exclude from filtering during similarity queries.

For more information about vector index limits per bucket, vector limits per index, and dimension limits per vector, see [Limitations and restrictions](s3-vectors-limitations.md).

Each vector index has a unique Amazon Resource Name (ARN). The ARNs of vector indexes follow the following format: 

```
arn:aws:s3vectors:region:account-id:bucket/bucket-name/index/index-name
```

## Vector index naming requirements

+ Vector index names must be unique within the vector bucket.
+ Vector index names must be between 3 and 63 characters long.
+ Valid characters are lowercase letters (a-z), numbers (0-9), hyphens (-), and dots (.).
+ Vector index names must begin and end with a letter or number.

## Dimension requirements


A dimension is the number of values in a vector. All vectors added to the index must have exactly this number of values.
+ A dimension must be an integer between 1 and 4096.
+ A larger dimension requires more storage space.

## Distance metric options


Distance metric specifies how similarity between vectors is calculated. When creating vector embeddings, choose your embedding model's recommended distance metric for more accurate results. 
+ **Cosine** – Measures the cosine of the angle between vectors. Best for normalized vectors and when direction matters more than magnitude.
+ **Euclidean** – Measures the straight-line distance between vectors. Best when both direction and magnitude are important.

## Non-filterable metadata keys


Metadata keys allow you to attach additional information to your vectors as key-value pairs during storage and retrieval. By default, all metadata is filterable, so you can use it to filter query results. However, you can designate specific metadata keys as non-filterable when you want to store information with vectors without using it for filtering.

Unlike default metadata keys, these keys can't be used as query filters. Non-filterable metadata keys can be retrieved but can't be searched, queried, or filtered. You can only access it after finding the index.

Non-filterable metadata keys allow you to enrich vectors with additional context that you want to retrieve with search results but don't need for filtering. A common example of a non-filterable metadata key is when you embed text into vectors and want to include the original text itself as non-filterable metadata. This allows you to return the source text alongside vector search results without increasing your filterable metadata size limits. Other examples include storing creation timestamps, source URLs, or descriptive information purely for reference. Non-filterable metadata keys can be accessed when retrieving vectors but, unlike default metadata keys, these keys can't be used as query filters.

Requirements for non-filterable metadata keys are as follows.
+ Non-filterable metadata keys must be unique within the vector index.
+ Non-filterable metadata keys must be 1 to 63 characters long.
+ Non-filterable metadata keys can't be modified after the vector index is created.
+ S3 Vectors support up to 10 non-filterable metadata keys per index.

For more information about non-filterable metadata keys, see [Non-filterable metadata](s3-vectors-metadata-filtering.md#s3-vectors-metadata-filtering-non-filterable).

**Topics**
+ [

## Vector index naming requirements
](#s3-vectors-indexes-naming)
+ [

## Dimension requirements
](#s3-vectors-indexes-dimensions)
+ [

## Distance metric options
](#s3-vectors-indexes-distance-metrics)
+ [

## Non-filterable metadata keys
](#s3-vectors-indexes-metadata)
+ [

# Creating a vector index in a vector bucket
](s3-vectors-create-index.md)
+ [

# Listing vector indexes
](s3-vectors-index-list.md)
+ [

# Deleting a vector index
](s3-vectors-index-delete.md)
+ [

# Using tags with S3 vector indexes
](vector-index-tagging.md)

# Creating a vector index in a vector bucket


**Note**  
Choose your vector index configuration parameters carefully. After you create a vector index, you can't update the vector index name, dimension, distance metric, or non-filterable metadata keys. To change any of these values, you must create a new vector index.

A vector index is a resource within a vector bucket that stores and organizes vector data for efficient similarity search. When you create a vector index, you define the characteristics that all vectors in that index must share, such as the dimension, the distance metric used for similarity calculations, and optionally non-filterable metadata keys. You can also optionally configure dedicated encryption settings and tags for the vector index at the time of index creation. For more information about vector index naming requirements, dimension requirements, distance metric options, and non-filterable metadata keys, see [Limitations and restrictions](s3-vectors-limitations.md). For more information about setting encryption configuration for vector indexes, see [Data protection and encryption in S3 Vectors](s3-vectors-data-encryption.md). For more information about setting tags, see [Using tags with S3 vector buckets](s3-vectors-tags.md).

 Vector indexes must be created within an existing vector bucket and require specific configuration parameters that can't be modified after creation. 

## Using the S3 console


**To create a vector index**

1. Open the Amazon S3 console at [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/).

1. In the navigation pane, choose **Vector buckets**.

1. In the list of vector buckets, choose the name of the bucket where you want to create a vector index.

1. Choose **Create vector index**.

1. For **Vector index name**, enter a name for your vector index.

   Vector index names must be unique within the vector bucket. Index name must be between 3 and 63 characters. Valid characters are lowercase letters (a-z), numbers (0-9), hyphens (-), and dots (.). For more information about the vector index naming requirements, see [Limitations and restrictions](s3-vectors-limitations.md).

1. For **Dimension**, enter the number of values in each vector.
**Note**  
The value for **Dimension** determines how many numerical values each vector will contain.
All vectors added to this index must have exactly this number of values.
Dimension must be between 1 and 4096.
A larger dimension requires more storage space.
Choose based on your embedding model's output dimensions.

   For more information about the dimension requirements, see [Limitations and restrictions](s3-vectors-limitations.md).

1. For **Distance metric**, choose one of the following options:
   + **Cosine** – Measures the cosine of the angle between vectors. Best for normalized vectors and when direction matters more than magnitude
   + **Euclidean** – Measures the straight-line distance between vectors. Best when both direction and magnitude are important.

1. (Optional) Under **Non-filterable metadata**, configure metadata keys that will be stored but not used for filtering:

   To add non-filterable metadata keys:

   1. Choose **Add key**.

   1. Enter a key name (1-63 characters and unique within this vector index).

   1. Repeat to add additional keys (maximum 10 keys).
**Note**  
You can attach filterable metadata as key-value pairs to each vector when you insert vector data after you create a vector index. By default, all metadata keys that are attached to vectors are filterable and can be used as filters in a similarity query. Only metadata keys that are specified as non-filterable during vector index creation are excluded from filtering. For more information about metadata size limits per vector, including both total and filterable metadata constraints, see [Limitations and restrictions](s3-vectors-limitations.md).

1. Review your configuration carefully.
**Note**  
These settings can't be changed after creation.

1. Under **Encryption**, choose **Specify encryption type**. You have the option to **Use bucket settings for encryption** or override the encryption settings for the vector index. If you override the bucket-level settings, you have the option to specify encryption type for the vector index as **Server-side encryption with Amazon Key Management Service keys (SSE-KMS)** or the **Server-side encryption with Amazon S3 managed keys (SSE-S3)**. For more information about setting encryption configuration for vector indexes, see [Data protection and encryption in S3 Vectors](s3-vectors-data-encryption.md).

1. Under **Tags (Optional)**, you can add tags as key-value pairs to help track and organize vector index costs using Amazon Billing and Cost Management. Enter a **Key** and a **Value**. To add another tag, choose **Add Tag**. You can enter up to 50 tags for a vector index. For more information, see [Using tags with S3 vector buckets](s3-vectors-tags.md).

1. Choose **Create vector index**.

## Using the Amazon CLI


To create a vector index in a vector bucket, use the following example commands and replace the `user input placeholders` with your own information.

**Example 1: Creating a vector index with non-filterable metadata keys**

```
aws s3vectors create-index \
  --vector-bucket-name "amzn-s3-demo-vector-bucket" \
  --index-name "idx" \
  --data-type "float32" \
  --dimension 1 \
  --distance-metric "cosine" \
  --metadata-configuration '{"nonFilterableMetadataKeys":["nonFilterableKey1"]}'
```

**Example 2: Creating a vector index without non-filterable metadata keys**

```
aws s3vectors create-index \
  --vector-bucket-name "amzn-s3-demo-vector-bucket" \
  --index-name "idx2" \
  --data-type "float32" \
  --dimension 4096 \
  --distance-metric "euclidean"
```

In addition, all metadata (both filterable and non-filterable) is retrieved the same way by using the `GetVectors`, `ListVectors`, or `QueryVectors` API operations. The following CLI command shows how to retrieve vectors with metadata (including non-filterable metadata).

Example request:

```
aws s3vectors get-vectors \
  --vector-bucket-name "amzn-s3-demo-vector-bucket" \
  --index-name "idx" \
  --keys '["vec1", "vec3"]' \
  --return-data \
  --return-metadata \
```

Example response: 

```
{
    "vectors": [
        {
            "key": "vec1",
            "data": {
                "float32": [
                    0.10000000149011612,
                    0.20000000298023224,
                    0.30000001192092896,
                    0.4000000059604645,
                    0.5
                ]
            },
            "metadata": {
                "category": "test",
                "text": "First vector"
            }
        },
        {
            "key": "vec3",
            "data": {
                "float32": [
                    0.6000000238418579,
                    0.699999988079071,
                    0.800000011920929,
                    0.8999999761581421,
                    1.0
                ]
            },
            "metadata": {
                "text": "Third vector",
                "category": "test"
            }
        }
    ]
}
```

The response will include all metadata associated with the vector, regardless of whether it was specified as filterable or non-filterable during index creation.

## Using the Amazon SDKs


------
#### [ SDK for Python ]

```
import boto3

# Create a S3 Vectors client in the AWS Region of your choice. 
s3vectors = boto3.client("s3vectors", region_name="us-west-2")

#Create a vector index "movies" in the vector bucket "media-embeddings" without non-filterable metadata keys
s3vectors.create_index(
    vectorBucketName="media-embeddings",
    indexName="movies",
    dimension=3,
    distanceMetric="cosine",
    dataType = "float32"
)


#Create a vector index "movies" in the vector bucket "media-embeddings" with non-filterable metadata keys
s3vectors.create_index(
    vectorBucketName="media-embeddings",
    indexName="movies",
    dimension=3,
    distanceMetric="cosine",
    dataType = "float32",
    metadataConfiguration= {"nonFilterableMetadataKeys": ["nonFilterableMetadataKey1"]}
)
```

------

# Listing vector indexes


You can view all vector indexes within a vector bucket. The listing operation supports prefix-based filtering to help you find specific indexes when you have many indexes in a bucket. For more information about `ListIndexes`, prefix limits, and response limits, see [ListIndexes](https://docs.amazonaws.cn/AmazonS3/latest/API/API_S3VectorBuckets_ListIndexes.html) in the Amazon Simple Storage Service API Reference. 

## Prefix search capability


Prefix search allows you to list indexes that start with a specific prefix, making it easier to organize and find related vector indexes. This is particularly useful when you use naming conventions that group related indexes together:
+ **By data type:** `text-embeddings-`, `image-features-`, `audio-vectors-`
+ **By model:** `model1-embeddings-`, `model2-vectors-`, `custom-model-`
+ **By use case:** `search-index-`, `recommendation-`, `similarity-`
+ **By environment:** `prod-vectors-`, `staging-vectors-`, `dev-vectors-`

### Using the S3 console


**To list vector indexes**

1. Sign in to the Amazon Web Services Management Console and open the Amazon S3 console at [https://console.amazonaws.cn/s3/](https://console.amazonaws.cn/s3/).

1. In the left navigation pane, choose **Vector buckets**.

1. In the list of vector buckets, choose the name of the bucket containing the indexes you want to view.

1. The console displays a comprehensive list of all vector indexes in the bucket, including:
   + **Name** – The name for each index.
   + **Create date** – When the index was created.
   + **Amazon Resource Name (ARN)** – Full ARN for each index.

**To filter the list**

1. Enter an index name or prefix in the search box above the index list. Use prefixes to find groups of related indexes.

1. The list updates in real-time as you type.

### Using the Amazon CLI


Use the following example commands and replace the *user input placeholders* with your own information.

**To list indexes with a specific prefix in a vector bucket**

Example request:

```
aws s3vectors list-indexes \
  --vector-bucket-name "amzn-s3-demo-bucket" \
  --prefix "idx" \
  --max-results 1
```

Example response:

```
{
    "nextToken": "lObb29ZkzxMGtBXs97Rkbs26xdtKemu4brsnq2jX8DCocADkILv5cRphemXS3PXXFnQBihQBmESgEeKaGA",
    "indexes": [
        {
            "vectorBucketName": "amzn-s3-demo-bucket",
            "indexName": "idx",
            "indexArn": "arn:aws:s3vectors:aws-region:111122223333:bucket/amzn-s3-demo-vector-bucket/index/idx",
            "creationTime": "2025-06-12T15:50:23+00:00"
        }
    ]
}
```

**To list indexes with pagination**

Example request:

```
aws s3vectors list-indexes \
  --vector-bucket-name "amzn-s3-demo-bucket" \
  --prefix "idx" \
  --next-token "lObb29ZkzxMGtBXs97Rkbs26xdtKemu4brsnq2jX8DCocADkILv5cRphemXS3PXXFnQBihQBmESgEeKaGA"
```

Example response: 

```
{
    "indexes": [
        {
            "vectorBucketName": "amzn-s3-demo-bucket",
            "indexName": "idx2",
            "indexArn": "arn:aws:s3vectors:aws-region:111122223333:bucket/amzn-s3-demo-vector-bucket/index/idx2",
            "creationTime": "2025-06-12T15:45:37+00:00"
        }
    ]
}
```

### Using the Amazon SDKs


------
#### [ SDK for Python ]

```
import boto3

# Create a S3 Vectors client in the AWS Region of your choice. 
s3vectors = boto3.client("s3vectors", region_name="us-west-2")

#List vector indexes in your vector bucket
response = s3vectors.list_indexes(vectorBucketName="media-embeddings")
indexes = response["indexes"]
print(indexes)
```

------

# Deleting a vector index


You can delete a vector index when you no longer need it. This operation permanently removes the index and all vectors that are stored within it.

**Important**  
When you delete a vector index, you need to know the following:  
You can delete vector indexes even when the indexes contain vectors.
All vectors stored in the index are permanently deleted
All metadata associated with those vectors is permanently lost
The operation can't be undone or reversed
Any ongoing operations on the index will fail immediately
Applications querying the index will receive errors
The index name becomes available for reuse within the bucket

## Using the Amazon CLI


Before you delete a vector index, verify the vector index. For more information about how to check the index details, see [GetIndex](https://docs.amazonaws.cn/AmazonS3/latest/API/API_GetIndex.html) in the *Amazon S3 API Reference*. For more information about how to list vectors inside the index to see what will be deleted, see [Listing vector indexes](s3-vectors-index-list.md).

To delete a vector index, use the following example commands. Replace the *user input placeholders* with your own information.

```
aws s3vectors delete-index --vector-bucket-name "amzn-s3-demo-vector-bucket" \
          --index-name "idx2"
```

For more information about how to verify whether the index is deleted, see [Listing vector indexes](s3-vectors-index-list.md).

## Using the Amazon SDKs


------
#### [ SDK for Python ]

```
import boto3

# Create a S3 Vectors client in the AWS Region of your choice. 
s3vectors = boto3.client("s3vectors", region_name="us-west-2")

#Delete a vector index
response = s3vectors.delete_index(
    vectorBucketName="media-embeddings",
    indexName="movies")
```

------

# Using tags with S3 vector indexes
Tagging vector indexes

An Amazon tag is a key-value pair that holds metadata about resources, in this case Amazon S3 vector indexes. You can tag S3 vector indexes when you create them or manage tags on existing vector indexes. For general information about tags, see [Tagging for cost allocation or attribute-based access control (ABAC)](tagging.md).

**Note**  
There is no additional charge for using tags on vector indexes beyond the standard S3 API request rates. For more information, see [Amazon S3 pricing](https://www.amazonaws.cn/s3/pricing/).

## Common ways to use tags with vector indexes


Use tags on your S3 vector indexes for:
+ **Cost allocation** – Track storage costs by vector index tag in Amazon Billing and Cost Management. For more information, see [Using tags for cost allocation](tagging.md#using-tags-for-cost-allocation).
+ **Attribute-based access control (ABAC)** – Scale access permissions and grant access to S3 vector indexes based on their tags. For more information, see [Using tags for attribute-based access control (ABAC)](tagging.md#using-tags-for-abac).

**Note**  
You can use the same tags for both cost allocation and access control.

### ABAC for S3 vector indexes


Amazon S3 vector indexes support attribute-based access control (ABAC) using tags. Use tag-based condition keys in your Amazon organizations, IAM, and S3 vector index policies. For enterprises, ABAC inAmazon S3 supports authorization across multiple Amazon accounts.

In your IAM policies, you can control access to S3 vector indexes based on the vector index's tags by using the following global condition keys:

`aws:ResourceTag/key-name`  
Use this key to compare the tag key-value pair that you specify in the policy with the key-value pair attached to the resource. For example, you could require that access to a resource is allowed only if the resource has the attached tag key `Dept` with the value `Marketing`. For more information, see [Controlling access to Amazon resources](https://docs.amazonaws.cn/IAM/latest/UserGuide/access_tags.html#access_tags_control-resources).

`aws:RequestTag/key-name`  
Use this key to compare the tag key-value pair that was passed in the request with the tag pair that you specify in the policy. For example, you could check whether the request includes the tag key `Dept` and that it has the value `Accounting`. For more information, see [Controlling access during Amazon requests](https://docs.amazonaws.cn/IAM/latest/UserGuide/access_tags.html#access_tags_control-requests). You can use this condition key to restrict which tag key-value pairs can be passed during the `TagResource` and `CreateIndex` API operations.

`aws:TagKeys`  
Use this key to compare the tag keys in a request with the keys that you specify in the policy. We recommend that when you use policies to control access using tags, use the `aws:TagKeys` condition key to define what tag keys are allowed. For example policies and more information, see [Controlling access based on tag keys](https://docs.amazonaws.cn/IAM/latest/UserGuide/access_tags.html#access_tags_control-tag-keys). You can create an S3 vector index with tags. To allow tagging during the `CreateVectorBucket` API operation, you must create a policy that includes both the `s3vectors:TagResource` and `s3vectors:CreateVectorBucket` actions. You can then use the `aws:TagKeys` condition key to enforce using specific tags in the `CreateVectorBucket` request.

### Example ABAC policies for vector indexes


See the following example ABAC policies for Amazon S3 vector indexes.

#### 1.1 - IAM policy to create or modify vector indexes with specific tags


In this IAM policy, users or roles with this policy can only create S3 vector indexes if they tag the vector index with the tag key `project` and tag value `Trinity` in the vector index creation request. They can also add or modify tags on existing S3 vector indexes as long as the `TagResource` request includes the tag key-value pair `project:Trinity`. This policy does not grant read, write, or delete permissions on the vector indexes or its objects.

```
{
  "Version": "2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "CreateVectorIndexWithTags",
      "Effect": "Allow",
      "Action": [
        "s3vectors:CreateIndex",
        "s3vectors:TagResource"
      ],
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "aws:RequestTag/project": [
            "Trinity"
          ]
        }
      }
    }
  ]
}
```

#### 1.2 - IAM policy to modify tags on existing resources maintaining tagging governance


In this IAM policy, IAM principals (users or roles) can modify tags on a vector index only if the value of the vector index's `project` tag matches the value of the principal's `project` tag. Only the four tags `project`, `environment`, `owner`, and `cost-center` specified in the `aws:TagKeys` condition keys are permitted for these vector indexes. This helps enforce tag governance, prevents unauthorized tag modifications, and keeps the tagging schema consistent across your vector indexes.

```
{
  "Version": "2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "EnforceTaggingRulesOnModification",
      "Effect": "Allow",
      "Action": [
        "s3vectors:TagResource"
      ],
      "Resource": "arn:aws::s3vectors:us-west-2:111122223333:bucket/*",
      "Condition": {
        "StringEquals": {
          "aws:ResourceTag/project": "${aws:PrincipalTag/project}"
        },
        "ForAllValues:StringEquals": {
          "aws:TagKeys": [
            "project",
            "environment",
            "owner",
            "cost-center"
          ]
        }
      }
    }
  ]
}
```

# Managing tags for vector indexes


You can add or manage tags for S3 vector indexes using the Amazon S3 Console, the Amazon Command Line Interface (Amazon CLI), the Amazon SDKs, or using the S3 APIs: [TagResource](https://docs.amazonaws.cn/), [UntagResource](https://docs.amazonaws.cn/), and [ListTagsForResource](https://docs.amazonaws.cn/). For more information, see:

**Topics**
+ [

# Creating vector indexes with tags
](creating-vector-indexes-with-tags.md)
+ [

# Adding a tag to a vector index
](adding-tag-vector-index.md)
+ [

# Viewing vector index tags
](viewing-vector-index-tags.md)
+ [

# Deleting a tag from a vector index
](deleting-tag-vector-index.md)

# Creating vector indexes with tags


You can tag Amazon S3 vector indexes when you create them. There is no additional charge for using tags on vector indexes beyond the standard S3 API request rates. For more information, see [Amazon S3 pricing](https://docs.amazonaws.cn/s3/pricing/). For more information about tagging vector indexes, see [Using tags with S3 vector indexes](vector-index-tagging.md).

## Permissions


To create a vector index with tags, you must have the following permissions:
+ `s3vectors:CreateIndex`
+ `s3vectors:TagResource`

## Troubleshooting errors


If you encounter an error when attempting to create a vector index with tags, you can do the following:
+ Verify that you have the required [Permissions](#index-tags-permissions) to create the vector index and add a tag to it.
+ Check your IAM user policy for any attribute-based access control (ABAC) conditions. You may be required to label your vector indexes only with specific tag keys and values. For more information, see [Using tags for attribute-based access control (ABAC)](tagging.md#using-tags-for-abac).

## Steps


You can create a vector index with tags applied by using the Amazon S3 console, the Amazon Command Line Interface (Amazon CLI), the Amazon S3 REST API, and Amazon SDKs.

### Using the S3 console


**To create a vector index with tags using the Amazon S3 console**

1. Sign in to the Amazon Web Services Management Console and open the Amazon S3 console at [https://console.amazonaws.cn/s3/](https://console.amazonaws.cn/s3/).

1. In the left navigation pane, choose **vector indexes**.

1. Choose **create vector index** to create a new vector index.

1. Create a vector index as you normally would; see [Creating a vector index in a vector bucket](s3-vectors-create-index.md).

1. On the **Create vector index** page, **Tags** is an option when creating a new vector index.

1. Enter a name for the vector index.

1. Choose **Add new Tag** to open the Tags editor and enter a tag key-value pair. The tag key is required, but the value is optional.

1. To add another tag, select **Add new Tag** again. You can enter up to 50 tag key-value pairs.

1. After you complete specifying the options for your new vector index, choose **Create vector index**.

### Using the REST API


For information about the Amazon S3 REST API support for creating a vector index with tags, see the following section in the *Amazon S3 Vectors API Reference*:

[CreateIndex](https://docs.amazonaws.cn/AmazonS3/latest/API/API_S3VectorBuckets_CreateIndex.html)

### Using the Amazon CLI


To install the Amazon CLI, see [Installing the Amazon CLI](https://docs.amazonaws.cn/cli/latest/userguide/getting-started-install.html) in the *Amazon Command Line Interface User Guide*.

The following CLI example shows you how to create a vector index with tags by using the Amazon CLI. To use the command replace the *user input placeholders* with your own information.

When you create a vector index you must provide configuration details and use the following naming convention: `example-vector-index`

```
aws s3vectors create-index --vector-bucket-name acc-bucket --data-type "float32" \
 --index-name accounts-index --dimension 1024 --distance-metric euclidean \
 --tags Department=Accounting,Stage=Prod
```

# Adding a tag to a vector index


You can add tags to Amazon S3 vector indexes and modify these tags. There is no additional charge for using tags on vector indexes beyond the standard S3 API request rates. For more information, see [Amazon S3 pricing](https://docs.amazonaws.cn/s3/pricing/). For more information about tagging vector indexes, see [Using tags with S3 vector indexes](vector-index-tagging.md).

## Permissions


To add a tag to a vector index, you must have the following permission:
+ `s3vectors:TagResource`

## Troubleshooting errors


If you encounter an error when attempting to add a tag to a vector index, you can do the following:
+ Verify that you have the required [Permissions](#add-index-tag-permissions) to add a tag to a vector index.
+ If you attempted to add a tag key that starts with the Amazon reserved prefix `aws:`, change the tag key and try again.

## Steps


You can add tags to vector indexes by using the Amazon S3 console, the Amazon Command Line Interface (Amazon CLI), the Amazon S3 REST API, and AmazonSDKs.

### Using the S3 console


**To add tags to a vector index using the Amazon S3 console**

1. Sign in to the Amazon Web Services Management Console and open the Amazon S3 console at [https://console.amazonaws.cn/s3/](https://console.amazonaws.cn/s3/).

1. In the left navigation pane, choose **vector indexes**.

1. Choose the vector index name.

1. Choose the **Properties** tab.

1. Scroll to the **Tags** section and choose **Add new Tag**.

1. This opens the **Add Tags** page. You can enter up to 50 tag key value pairs.

1. If you add a new tag with the same key name as an existing tag, the value of the new tag overrides the value of the existing tag.

1. You can also edit the values of existing tags on this page.

1. After you have added the tag(s), choose **Save changes**.

### Using the REST API


For information about the Amazon S3 REST API support for adding tags to a vector index, see the following section in the *Amazon S3 Vectors API Reference*:

[TagResource](https://docs.amazonaws.cn/AmazonS3/latest/API/API_S3VectorBuckets_TagResource.html)

### Using the Amazon CLI


To install the Amazon CLI, see [Installing the Amazon CLI](https://docs.amazonaws.cn/cli/latest/userguide/getting-started-install.html) in the *Amazon Command Line Interface User Guide*.

The following CLI example shows you how to add tags to a vector index by using the Amazon CLI. To use the command replace the *user input placeholders* with your own information.

```
aws s3vectors tag-resource \
--resource-arn arn:aws:s3vectors:us-east-1:012345678900:bucket/acc-bucket/index/accounts-index \
--tags Stage=Prod,CostCenter=Marketing
```

# Viewing vector index tags


You can view or list tags applied to Amazon S3 vector indexes. For more information about tagging vector indexes, see [Using tags with S3 vector indexes](vector-index-tagging.md).

## Permissions


To view tags applied to a vector index, you must have the following permission:
+ `s3vectors:ListTagsForResource`

## Troubleshooting errors


If you encounter an error when attempting to list or view the tags of a vector index, you can do the following:
+ Verify that you have the required [Permissions](#view-index-tag-permissions) to view or list the tags of the vector index.

## Steps


You can view tags applied to vector indexes by using the Amazon S3 console, the Amazon Command Line Interface (Amazon CLI), the Amazon S3 REST API, and Amazon SDKs.

### Using the S3 console


**To view tags applied to a vector index using the Amazon S3 console**

1. Sign in to the Amazon Web Services Management Console and open the Amazon S3 console at [https://console.amazonaws.cn/s3/](https://console.amazonaws.cn/s3/).

1. In the left navigation pane, choose **vector indexes**.

1. Choose the vector index name.

1. Choose the **Properties** tab.

1. Scroll to the **Tags** section to view all of the tags applied to the vector index.

1. The **Tags** section shows the User-defined tags by default. You can select the Amazon-generated tags tab to view tags applied to your vector index by Amazon services.

### Using the REST API


For information about the Amazon S3 REST API support for viewing the tags applied to a vector index, see the following section in the Amazon Simple Vectors API Reference:

[ListTagsforResource](https://docs.amazonaws.cn/AmazonS3/latest/API/API_S3VectorBuckets_ListTagsForResource.html)

### Using the Amazon CLI


To install the Amazon CLI, see [Installing the Amazon CLI](https://docs.amazonaws.cn/cli/latest/userguide/getting-started-install.html) in the *Amazon Command Line Interface User Guide*.

The following CLI example shows you how to view tags applied to a vector index. To use the command replace the *user input placeholders* with your own information.

```
aws s3vectors list-tags-for-resource \ 
  --resource-arn arn:aws:s3vectors:us-east-1:012345678900:bucket/acc-bucket/index/accounts-index
```

# Deleting a tag from a vector index


You can remove tags from S3 vector indexes. An Amazon tag is a key-value pair that holds metadata about resources, in this case Amazon S3 vector indexes. For more information about tagging vector indexes, see [Using tags with S3 vector indexes](vector-index-tagging.md).

**Note**  
If you delete a tag and later learn that it was being used to track costs or for access control, you can add the tag back to the vector index.

## Permissions


To delete a tag from a vector index, you must have the following permission:
+ `s3vectors:UntagResource`

## Troubleshooting errors


If you encounter an error when attempting to delete a tag from a vector index, you can do the following:
+ Verify that you have the required [Permissions](#delete-index-tag-permissions) to delete a tag from a vector index.

## Steps


You can delete tags from vector indexes by using the Amazon S3 console, the Amazon Command Line Interface (Amazon CLI), the Amazon S3 REST API, and Amazon SDKs.

### Using the S3 console


**To delete tags from a vector index using the Amazon S3 console**

1. Sign in to the Amazon Web Services Management Console and open the Amazon S3 console at [https://console.amazonaws.cn/s3/](https://console.amazonaws.cn/s3/).

1. In the left navigation pane, choose **vector indexes**.

1. Choose the vector index name.

1. Choose the **Properties** tab.

1. Scroll to the **Tags** section and select the checkbox next to the tag or tags that you would like to delete.

1. Choose **Delete**.

1. The **Delete user-defined tags** pop-up appears and asks you to confirm the deletion of the tag or tags you selected.

1. Choose **Delete** to confirm.

### Using the REST API


For information about the Amazon S3 REST API support for deleting tags from a vector index, see the following section in the *Amazon S3 Vectors API Reference*:

[UntagResource](https://docs.amazonaws.cn/AmazonS3/latest/API/API_S3VectorBuckets_UntagResource.html)

### Using the Amazon CLI


To install the Amazon CLI, see [Installing the Amazon CLI](https://docs.amazonaws.cn/cli/latest/userguide/getting-started-install.html) in the *Amazon Command Line Interface User Guide*.

The following CLI example shows you how to delete tags from a vector index by using the Amazon CLI. To use the command replace the *user input placeholders* with your own information.

```
aws s3vectors untag-resource \
--resource-arn arn:aws:s3vectors:us-east-1:012345678900:bucket/acc-bucket/index/accounts-index \
--tag-keys CostCenter Department
```