--- subcategory: "Bedrock Agents" layout: "aws" page_title: "AWS: aws_bedrockagent_knowledge_base" description: |- Manages an AWS Agents for Amazon Bedrock Knowledge Base. --- # Resource: aws_bedrockagent_knowledge_base Manages an AWS Agents for Amazon Bedrock Knowledge Base. ## Example Usage ### Basic Usage ```terraform resource "aws_bedrockagent_knowledge_base" "example" { name = "example" role_arn = aws_iam_role.example.arn knowledge_base_configuration { vector_knowledge_base_configuration { embedding_model_arn = "arn:aws:bedrock:us-west-2::foundation-model/amazon.titan-embed-text-v2:0" } type = "VECTOR" } storage_configuration { type = "OPENSEARCH_SERVERLESS" opensearch_serverless_configuration { collection_arn = "arn:aws:aoss:us-west-2:123456789012:collection/142bezjddq707i5stcrf" vector_index_name = "bedrock-knowledge-base-default-index" field_mapping { vector_field = "bedrock-knowledge-base-default-vector" text_field = "AMAZON_BEDROCK_TEXT_CHUNK" metadata_field = "AMAZON_BEDROCK_METADATA" } } } } ``` ### Kendra Knowledge Base ```terraform resource "aws_bedrockagent_knowledge_base" "kendra_example" { name = "example-kendra-kb" role_arn = aws_iam_role.example.arn knowledge_base_configuration { type = "KENDRA" kendra_knowledge_base_configuration { kendra_index_arn = "arn:aws:kendra:us-east-1:123456789012:index/example-index-id" } } } ``` ### Structured Data Store ```terraform resource "aws_bedrockagent_knowledge_base" "example" { name = "example-kb" role_arn = aws_iam_role.example.arn knowledge_base_configuration { type = "SQL" sql_knowledge_base_configuration { type = "REDSHIFT" redshift_configuration { query_engine_configuration { type = "PROVISIONED" provisioned_configuration { cluster_identifier = aws_redshift_cluster.example.cluster_identifier auth_configuration { type = "USERNAME" database_user = aws_redshift_cluster.example.master_username } } } storage_configuration { type = "REDSHIFT" redshift_configuration { database_name = aws_redshift_cluster.example.database_name } } } } } } ``` ### OpenSearch Managed Cluster Configuration ```terraform resource "aws_bedrockagent_knowledge_base" "example" { name = "example" role_arn = aws_iam_role.example.arn knowledge_base_configuration { vector_knowledge_base_configuration { embedding_model_arn = "arn:aws:bedrock:us-west-2::foundation-model/amazon.titan-embed-text-v2:0" } type = "VECTOR" } storage_configuration { type = "OPENSEARCH_MANAGED_CLUSTER" opensearch_managed_cluster_configuration { domain_arn = "arn:aws:es:us-west-2:123456789012:domain/example-domain" domain_endpoint = "https://search-example-domain.us-west-2.es.amazonaws.com" vector_index_name = "example_index" field_mapping { metadata_field = "metadata" text_field = "chunks" vector_field = "embedding" } } } } ``` ### With Supplemental Data Storage Configuration ```terraform resource "aws_bedrockagent_knowledge_base" "example" { name = "example" role_arn = aws_iam_role.example.arn knowledge_base_configuration { vector_knowledge_base_configuration { embedding_model_arn = "arn:aws:bedrock:us-west-2::foundation-model/amazon.titan-embed-text-v2:0" embedding_model_configuration { bedrock_embedding_model_configuration { dimensions = 1024 embedding_data_type = "FLOAT32" audio { segmentation_configuration { fixed_length_duration = 60 } } video { segmentation_configuration { fixed_length_duration = 60 } } } } supplemental_data_storage_configuration { storage_location { type = "S3" s3_location { uri = "s3://my-bucket/chunk-processor/" } } } } type = "VECTOR" } storage_configuration { type = "OPENSEARCH_SERVERLESS" opensearch_serverless_configuration { collection_arn = "arn:aws:aoss:us-west-2:123456789012:collection/142bezjddq707i5stcrf" vector_index_name = "bedrock-knowledge-base-default-index" field_mapping { vector_field = "bedrock-knowledge-base-default-vector" text_field = "AMAZON_BEDROCK_TEXT_CHUNK" metadata_field = "AMAZON_BEDROCK_METADATA" } } } } ``` ### S3 Vectors Configuration ```terraform resource "aws_s3vectors_vector_bucket" "example" { vector_bucket_name = "example-bucket" } resource "aws_s3vectors_index" "example" { index_name = "example-index" vector_bucket_name = aws_s3vectors_vector_bucket.example.vector_bucket_name data_type = "float32" dimension = 256 distance_metric = "euclidean" } resource "aws_bedrockagent_knowledge_base" "example" { name = "example-s3vectors-kb" role_arn = aws_iam_role.example.arn knowledge_base_configuration { vector_knowledge_base_configuration { embedding_model_arn = "arn:aws:bedrock:us-west-2::foundation-model/amazon.titan-embed-text-v2:0" embedding_model_configuration { bedrock_embedding_model_configuration { dimensions = 256 embedding_data_type = "FLOAT32" } } } type = "VECTOR" } storage_configuration { type = "S3_VECTORS" s3_vectors_configuration { index_arn = aws_s3vectors_index.example.index_arn } } } ``` ### Managed Knowledge Base ```terraform resource "aws_bedrockagent_knowledge_base" "example" { name = "example-managed-kb" role_arn = aws_iam_role.example.arn knowledge_base_configuration { type = "MANAGED" managed_knowledge_base_configuration { embedding_model_type = "MANAGED" } } } ``` ### Managed Knowledge Base with Custom Embedding Model ```terraform resource "aws_bedrockagent_knowledge_base" "example" { name = "example-managed-multilingual-kb" role_arn = aws_iam_role.example.arn knowledge_base_configuration { type = "MANAGED" managed_knowledge_base_configuration { embedding_model_type = "CUSTOM" embedding_model_arn = "arn:aws:bedrock:us-east-1::foundation-model/cohere.embed-multilingual-v3" embedding_model_configuration { bedrock_embedding_model_configuration { dimensions = 1024 } } } } } ``` ## Argument Reference The following arguments are required: * `knowledge_base_configuration` - (Required, Forces new resource) Details about the embeddings configuration of the knowledge base. See [`knowledge_base_configuration` Block](#knowledge_base_configuration-block) for details. * `name` - (Required) Name of the knowledge base. * `role_arn` - (Required) ARN of the IAM role with permissions to invoke API operations on the knowledge base. The following arguments are optional: * `description` - (Optional) Description of the knowledge base. * `region` - (Optional) Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the [provider configuration](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#aws-configuration-reference). * `storage_configuration` - (Optional, Forces new resource) Details about the storage configuration of the knowledge base. See [`storage_configuration` Block](#storage_configuration-block) for details. * `tags` - (Optional) Map of tags assigned to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ### `knowledge_base_configuration` Block The `knowledge_base_configuration` configuration block supports the following arguments: * `kendra_knowledge_base_configuration` - (Optional) Settings for an Amazon Kendra knowledge base. See [`kendra_knowledge_base_configuration` Block](#kendra_knowledge_base_configuration-block) for details. * `managed_knowledge_base_configuration` - (Optional) Settings for a managed knowledge base where Amazon Bedrock manages the vector store. See [`managed_knowledge_base_configuration` Block](#managed_knowledge_base_configuration-block) for details. * `sql_knowledge_base_configuration` - (Optional) Configurations for a knowledge base connected to an SQL database. See [`sql_knowledge_base_configuration` Block](#sql_knowledge_base_configuration-block) for details. * `type` - (Required) Type of data that the data source is converted into for the knowledge base. Valid Values: `VECTOR`, `KENDRA`, `SQL`, `MANAGED`. * `vector_knowledge_base_configuration` - (Optional) Details about the model that's used to convert the data source into vector embeddings. See [`vector_knowledge_base_configuration` Block](#vector_knowledge_base_configuration-block) for details. ### `kendra_knowledge_base_configuration` Block The `kendra_knowledge_base_configuration` configuration block supports the following arguments: * `kendra_index_arn` - (Required) ARN of the Amazon Kendra index. ### `managed_knowledge_base_configuration` Block The `managed_knowledge_base_configuration` configuration block supports the following arguments: * `embedding_model_arn` - (Optional) ARN of the embedding model. Required when `embedding_model_type` is `CUSTOM`. * `embedding_model_configuration` - (Optional) Configuration for the embedding model. Required when `embedding_model_type` is `CUSTOM`. See [`embedding_model_configuration` Block](#embedding_model_configuration-block) for details. * `embedding_model_type` - (Optional) Type of embedding model. Valid values: `MANAGED`, `CUSTOM`. When `MANAGED`, no model selection or configuration is required. When `CUSTOM`, `embedding_model_arn` and `embedding_model_configuration` are required. Defaults to `MANAGED`. * `server_side_encryption_configuration` - (Optional) Server-side encryption configuration for the managed knowledge base. See [`server_side_encryption_configuration` Block](#server_side_encryption_configuration-block) for details. ### `server_side_encryption_configuration` Block The `server_side_encryption_configuration` configuration block supports the following arguments: * `kms_key_arn` - (Optional) ARN of the KMS key used to encrypt the managed knowledge base. ~> **Note:** `storage_configuration` is not required when `knowledge_base_configuration.type` is `MANAGED`. Amazon Bedrock manages the vector store automatically for managed knowledge bases. ### `sql_knowledge_base_configuration` Block The `sql_knowledge_base_configuration` configuration block supports the following arguments: * `redshift_configuration` - (Required) Configurations for a knowledge base connected to an Amazon Redshift database. See [`knowledge_base_configuration.sql_knowledge_base_configuration.redshift_configuration` Block](#knowledge_base_configurationsql_knowledge_base_configurationredshift_configuration-block) for details. * `type` - (Required) Type of SQL database to connect to the knowledge base. Valid values: `REDSHIFT`. ### `knowledge_base_configuration.sql_knowledge_base_configuration.redshift_configuration` Block The `redshift_configuration` configuration block supports the following arguments: * `query_engine_configuration` - (Required) Configurations for an Amazon Redshift query engine. See [`query_engine_configuration` Block](#query_engine_configuration-block) for details. * `query_generation_configuration` - (Optional) Configurations for generating queries. See [`query_generation_configuration` Block](#query_generation_configuration-block) for details. * `storage_configuration` - (Required) Configurations for Amazon Redshift database storage. See [`knowledge_base_configuration.sql_knowledge_base_configuration.redshift_configuration.storage_configuration` Block](#knowledge_base_configurationsql_knowledge_base_configurationredshift_configurationstorage_configuration-block) for details. ### `query_engine_configuration` Block The `query_engine_configuration` configuration block supports the following arguments: * `provisioned_configuration` - (Optional) Configurations for a provisioned Amazon Redshift query engine. See [`provisioned_configuration` Block](#provisioned_configuration-block) for details. * `serverless_configuration` - (Optional) Configurations for a serverless Amazon Redshift query engine. See [`serverless_configuration` Block](#serverless_configuration-block) for details. * `type` - (Required) Type of query engine. Valid values: `SERVERLESS`, `PROVISIONED`. ### `provisioned_configuration` Block The `provisioned_configuration` configuration block supports the following arguments: * `auth_configuration` - (Required) Configurations for authentication to Amazon Redshift. See [`knowledge_base_configuration.sql_knowledge_base_configuration.redshift_configuration.query_engine_configuration.provisioned_configuration.auth_configuration` Block](#knowledge_base_configurationsql_knowledge_base_configurationredshift_configurationquery_engine_configurationprovisioned_configurationauth_configuration-block) for details. * `cluster_identifier` - (Required) ID of the Amazon Redshift cluster. ### `knowledge_base_configuration.sql_knowledge_base_configuration.redshift_configuration.query_engine_configuration.provisioned_configuration.auth_configuration` Block The `auth_configuration` configuration block supports the following arguments: * `database_user` - (Optional) Database username for authentication to an Amazon Redshift provisioned data warehouse. * `type` - (Required) Type of authentication to use. Valid values: `IAM`, `USERNAME_PASSWORD`, `USERNAME`. * `username_password_secret_arn` - (Optional) ARN of a Secrets Manager secret for authentication. ### `serverless_configuration` Block The `serverless_configuration` configuration block supports the following arguments: * `auth_configuration` - (Required) Configurations for authentication to Amazon Redshift Serverless. See [`knowledge_base_configuration.sql_knowledge_base_configuration.redshift_configuration.query_engine_configuration.serverless_configuration.auth_configuration` Block](#knowledge_base_configurationsql_knowledge_base_configurationredshift_configurationquery_engine_configurationserverless_configurationauth_configuration-block) for details. * `workgroup_arn` - (Required) ARN of the Amazon Redshift workgroup. ### `knowledge_base_configuration.sql_knowledge_base_configuration.redshift_configuration.query_engine_configuration.serverless_configuration.auth_configuration` Block The `auth_configuration` configuration block supports the following arguments: * `type` - (Required) Type of authentication to use. Valid values: `IAM`, `USERNAME_PASSWORD`. * `username_password_secret_arn` - (Optional) ARN of a Secrets Manager secret for authentication. ### `query_generation_configuration` Block The `query_generation_configuration` configuration block supports the following arguments: * `execution_timeout_seconds` - (Optional) Time after which query generation will time out. * `generation_context` - (Optional) Configurations for context to use during query generation. See [`generation_context` Block](#generation_context-block) for details. ### `generation_context` Block The `generation_context` configuration block supports the following arguments: * `curated_query` - (Optional) Information about example queries to help the query engine generate appropriate SQL queries. See [`curated_query` Block](#curated_query-block) for details. * `table` - (Optional) Information about a table in the database. See [`table` Block](#table-block) for details. ### `curated_query` Block The `curated_query` configuration block supports the following arguments: * `natural_language` - (Required) Example natural language query. * `sql` - (Required) SQL equivalent of `natural_language`. ### `table` Block The `table` configuration block supports the following arguments: * `column` - (Optional) Information about a column in the table. See [`column` Block](#column-block) for details. * `description` - (Optional) Description of the table that helps the query engine understand the contents of the table. * `inclusion` - (Optional) Whether to include or exclude the table during query generation. Valid values `INCLUDE`, `EXCLUDE`. * `name` - (Required) Name of the table for which the other fields in this object apply. ### `column` Block The `column` configuration block supports the following arguments: * `description` - (Optional) Description of the column that helps the query engine understand the contents of the column. * `inclusion` - (Optional) Whether to include or exclude the column during query generation. Valid values `INCLUDE`, `EXCLUDE`. * `name` - (Optional) Name of the column for which the other fields in this object apply. ### `knowledge_base_configuration.sql_knowledge_base_configuration.redshift_configuration.storage_configuration` Block The `storage_configuration` configuration block supports the following arguments: * `aws_data_catalog_configuration` - (Optional) Configurations for storage in AWS Glue Data Catalog. See [`aws_data_catalog_configuration` Block](#aws_data_catalog_configuration-block) for details. * `redshift_configuration` - (Optional) Configurations for storage in Amazon Redshift. See [`knowledge_base_configuration.sql_knowledge_base_configuration.redshift_configuration.storage_configuration.redshift_configuration` Block](#knowledge_base_configurationsql_knowledge_base_configurationredshift_configurationstorage_configurationredshift_configuration-block) for details. * `type` - (Required) Data storage service to use. Valid values: `REDSHIFT`, `AWS_DATA_CATALOG`. ### `aws_data_catalog_configuration` Block The `aws_data_catalog_configuration` configuration block supports the following arguments: * `table_names` - (Required) List of names of the tables to use. ### `knowledge_base_configuration.sql_knowledge_base_configuration.redshift_configuration.storage_configuration.redshift_configuration` Block The `redshift_configuration` configuration block supports the following arguments: * `database_name` - (Required) Name of the Amazon Redshift database. ### `vector_knowledge_base_configuration` Block The `vector_knowledge_base_configuration` configuration block supports the following arguments: * `embedding_model_arn` - (Required) ARN of the model used to create vector embeddings for the knowledge base. * `embedding_model_configuration` - (Optional) Embeddings model configuration details for the vector model used in the knowledge base. See [`embedding_model_configuration` Block](#embedding_model_configuration-block) for details. * `supplemental_data_storage_configuration` - (Optional) Supplemental data storage configuration for images extracted from multimodal documents. See [`supplemental_data_storage_configuration` Block](#supplemental_data_storage_configuration-block) for details. ### `embedding_model_configuration` Block The `embedding_model_configuration` configuration block supports the following arguments: * `bedrock_embedding_model_configuration` - (Optional) Vector configuration details for the Bedrock embeddings model. See [`bedrock_embedding_model_configuration` Block](#bedrock_embedding_model_configuration-block) for details. ### `bedrock_embedding_model_configuration` Block The `bedrock_embedding_model_configuration` configuration block supports the following arguments: * `audio` - (Optional) Configuration for processing audio content in multimodal knowledge bases. See [`audio` Block](#audio-block) for details. * `dimensions` - (Optional) Dimension details for the vector configuration used on the Bedrock embeddings model. * `embedding_data_type` - (Optional) Data type for the vectors when using a model to convert text into vector embeddings. The model must support the specified data type for vector embeddings. Valid values are `FLOAT32` and `BINARY`. * `video` - (Optional) Configuration for processing video content in multimodal knowledge bases. See [`video` Block](#video-block) for details. ### `audio` Block The `audio` configuration block supports the following arguments: * `segmentation_configuration` - (Required) Configuration for segmenting audio content during processing. See [`segmentation_configuration` Block](#segmentation_configuration-block) for details. ### `video` Block The `video` configuration block supports the following arguments: * `segmentation_configuration` - (Required) Configuration for segmenting video content during processing. See [`segmentation_configuration` Block](#segmentation_configuration-block) for details. ### `segmentation_configuration` Block The `segmentation_configuration` configuration block supports the following arguments: * `fixed_length_duration` - (Required) Duration in seconds for each audio or video segment. ### `supplemental_data_storage_configuration` Block The `supplemental_data_storage_configuration` configuration block supports the following arguments: * `storage_location` - (Required) Storage location specification for images extracted from multimodal documents in your data source. See [`storage_location` Block](#storage_location-block) for details. ### `storage_location` Block The `storage_location` configuration block supports the following arguments: * `s3_location` - (Required) Information about the Amazon S3 location for the extracted images. See [`s3_location` Block](#s3_location-block) for details. * `type` - (Required) Storage service used for this location. `S3` is the only valid value. ### `s3_location` Block The `s3_location` configuration block supports the following arguments: * `uri` - (Required) URI of the location. ### `storage_configuration` Block The `storage_configuration` configuration block supports the following arguments: * `mongo_db_atlas_configuration` - (Optional) Storage configuration of the knowledge base in MongoDB Atlas. See [`mongo_db_atlas_configuration` Block](#mongo_db_atlas_configuration-block) for details. * `neptune_analytics_configuration` - (Optional) Storage configuration of the knowledge base in Amazon Neptune Analytics. See [`neptune_analytics_configuration` Block](#neptune_analytics_configuration-block) for details. * `opensearch_managed_cluster_configuration` - (Optional) Storage configuration of the knowledge base in Amazon OpenSearch Service Managed Cluster. See [`opensearch_managed_cluster_configuration` Block](#opensearch_managed_cluster_configuration-block) for details. * `opensearch_serverless_configuration` - (Optional) Storage configuration of the knowledge base in Amazon OpenSearch Service Serverless. See [`opensearch_serverless_configuration` Block](#opensearch_serverless_configuration-block) for details. * `pinecone_configuration` - (Optional) Storage configuration of the knowledge base in Pinecone. See [`pinecone_configuration` Block](#pinecone_configuration-block) for details. * `rds_configuration` - (Optional) Details about the storage configuration of the knowledge base in Amazon RDS. For more information, see [Create a vector index in Amazon RDS](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup.html). See [`rds_configuration` Block](#rds_configuration-block) for details. * `redis_enterprise_cloud_configuration` - (Optional) Storage configuration of the knowledge base in Redis Enterprise Cloud. See [`redis_enterprise_cloud_configuration` Block](#redis_enterprise_cloud_configuration-block) for details. * `s3_vectors_configuration` - (Optional) Storage configuration of the knowledge base in Amazon S3 Vectors. See [`s3_vectors_configuration` Block](#s3_vectors_configuration-block) for details. * `type` - (Required) Vector store service in which the knowledge base is stored. Valid Values: `MONGO_DB_ATLAS`, `OPENSEARCH_SERVERLESS`, `OPENSEARCH_MANAGED_CLUSTER`, `PINECONE`, `REDIS_ENTERPRISE_CLOUD`, `RDS`, `S3_VECTORS`, `NEPTUNE_ANALYTICS`. ### `mongo_db_atlas_configuration` Block The `mongo_db_atlas_configuration` configuration block supports the following arguments: * `collection_name` - (Required) Name of the collection in the MongoDB Atlas database. * `credentials_secret_arn` - (Required) ARN of the secret that you created in AWS Secrets Manager that is linked to your MongoDB Atlas database. * `database_name` - (Required) Name of the database in the MongoDB Atlas database. * `endpoint` - (Required) Endpoint URL of the MongoDB Atlas database. * `endpoint_service_name` - (Optional) Name of the VPC endpoint service in your account that is connected to your MongoDB Atlas cluster. * `field_mapping` - (Required) Names of the fields to which to map information about the vector store. See [`storage_configuration.mongo_db_atlas_configuration.field_mapping` Block](#storage_configurationmongo_db_atlas_configurationfield_mapping-block) for details. * `text_index_name` - (Optional) Name of the text search index in the MongoDB collection. Required for hybrid search. * `vector_index_name` - (Required) Name of the vector index. ### `storage_configuration.mongo_db_atlas_configuration.field_mapping` Block The `field_mapping` configuration block supports the following arguments: * `metadata_field` - (Required) Name of the field in which Amazon Bedrock stores metadata about the vector store. * `text_field` - (Required) Name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose. * `vector_field` - (Required) Name of the field in which Amazon Bedrock stores the vector embeddings for your data sources. ### `neptune_analytics_configuration` Block The `neptune_analytics_configuration` configuration block supports the following arguments: * `field_mapping` - (Required) Names of the fields to which to map information about the vector store. See [`storage_configuration.neptune_analytics_configuration.field_mapping` Block](#storage_configurationneptune_analytics_configurationfield_mapping-block) for details. * `graph_arn` - (Required) ARN of the Neptune Analytics vector store. ### `storage_configuration.neptune_analytics_configuration.field_mapping` Block The `field_mapping` configuration block supports the following arguments: * `metadata_field` - (Required) Name of the field in which Amazon Bedrock stores metadata about the vector store. * `text_field` - (Required) Name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose. ### `opensearch_managed_cluster_configuration` Block The `opensearch_managed_cluster_configuration` configuration block supports the following arguments: * `domain_arn` - (Required) ARN of the OpenSearch domain. * `domain_endpoint` - (Required) Endpoint URL of the OpenSearch domain. * `field_mapping` - (Required) Names of the fields to which to map information about the vector store. See [`storage_configuration.opensearch_managed_cluster_configuration.field_mapping` Block](#storage_configurationopensearch_managed_cluster_configurationfield_mapping-block) for details. * `vector_index_name` - (Required) Name of the vector store. ### `storage_configuration.opensearch_managed_cluster_configuration.field_mapping` Block The `field_mapping` configuration block supports the following arguments: * `metadata_field` - (Required) Name of the field in which Amazon Bedrock stores metadata about the vector store. * `text_field` - (Required) Name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose. * `vector_field` - (Required) Name of the field in which Amazon Bedrock stores the vector embeddings for your data sources. ### `opensearch_serverless_configuration` Block The `opensearch_serverless_configuration` configuration block supports the following arguments: * `collection_arn` - (Required) ARN of the OpenSearch Service vector store. * `field_mapping` - (Required) Names of the fields to which to map information about the vector store. See [`storage_configuration.opensearch_serverless_configuration.field_mapping` Block](#storage_configurationopensearch_serverless_configurationfield_mapping-block) for details. * `vector_index_name` - (Required) Name of the vector store. ### `storage_configuration.opensearch_serverless_configuration.field_mapping` Block The `field_mapping` configuration block supports the following arguments: * `metadata_field` - (Required) Name of the field in which Amazon Bedrock stores metadata about the vector store. * `text_field` - (Required) Name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose. * `vector_field` - (Required) Name of the field in which Amazon Bedrock stores the vector embeddings for your data sources. ### `pinecone_configuration` Block The `pinecone_configuration` configuration block supports the following arguments: * `connection_string` - (Required) Endpoint URL for your index management page. * `credentials_secret_arn` - (Required) ARN of the secret that you created in AWS Secrets Manager that is linked to your Pinecone API key. * `field_mapping` - (Required) Names of the fields to which to map information about the vector store. See [`storage_configuration.pinecone_configuration.field_mapping` Block](#storage_configurationpinecone_configurationfield_mapping-block) for details. * `namespace` - (Optional) Namespace to be used to write new data to your database. ### `storage_configuration.pinecone_configuration.field_mapping` Block The `field_mapping` configuration block supports the following arguments: * `metadata_field` - (Required) Name of the field in which Amazon Bedrock stores metadata about the vector store. * `text_field` - (Required) Name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose. ### `rds_configuration` Block The `rds_configuration` configuration block supports the following arguments: * `credentials_secret_arn` - (Required) ARN of the secret that you created in AWS Secrets Manager that is linked to your Amazon RDS database. * `database_name` - (Required) Name of your Amazon RDS database. * `field_mapping` - (Required) Names of the fields to which to map information about the vector store. See [`storage_configuration.rds_configuration.field_mapping` Block](#storage_configurationrds_configurationfield_mapping-block) for details. * `resource_arn` - (Required) ARN of the vector store. * `table_name` - (Required) Name of the table in the database. ### `storage_configuration.rds_configuration.field_mapping` Block The `field_mapping` configuration block supports the following arguments: * `custom_metadata_field` - (Optional) Name for the universal metadata field where Amazon Bedrock will store any custom metadata from your data source. * `metadata_field` - (Required) Name of the field in which Amazon Bedrock stores metadata about the vector store. * `primary_key_field` - (Required) Name of the field in which Amazon Bedrock stores the ID for each entry. * `text_field` - (Required) Name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose. * `vector_field` - (Required) Name of the field in which Amazon Bedrock stores the vector embeddings for your data sources. ### `redis_enterprise_cloud_configuration` Block The `redis_enterprise_cloud_configuration` configuration block supports the following arguments: * `credentials_secret_arn` - (Required) ARN of the secret that you created in AWS Secrets Manager that is linked to your Redis Enterprise Cloud database. * `endpoint` - (Required) Endpoint URL of the Redis Enterprise Cloud database. * `field_mapping` - (Required) Names of the fields to which to map information about the vector store. See [`storage_configuration.redis_enterprise_cloud_configuration.field_mapping` Block](#storage_configurationredis_enterprise_cloud_configurationfield_mapping-block) for details. * `vector_index_name` - (Required) Name of the vector index. ### `storage_configuration.redis_enterprise_cloud_configuration.field_mapping` Block The `field_mapping` configuration block supports the following arguments: * `metadata_field` - (Optional) Name of the field in which Amazon Bedrock stores metadata about the vector store. * `text_field` - (Optional) Name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose. * `vector_field` - (Optional) Name of the field in which Amazon Bedrock stores the vector embeddings for your data sources. ### `s3_vectors_configuration` Block The `s3_vectors_configuration` configuration block supports the following arguments. Either `index_arn`, or both `index_name` and `vector_bucket_arn` must be specified. * `index_arn` - (Optional) ARN of the S3 Vectors index. Conflicts with `index_name` and `vector_bucket_arn`. * `index_name` - (Optional) Name of the S3 Vectors index. Must be specified with `vector_bucket_arn`. Conflicts with `index_arn`. * `vector_bucket_arn` - (Optional) ARN of the S3 Vectors vector bucket. Must be specified with `index_name`. Conflicts with `index_arn`. ## Attribute Reference This resource exports the following attributes in addition to the arguments above: * `arn` - ARN of the knowledge base. * `created_at` - Time at which the knowledge base was created. * `failure_reasons` - List of failure reasons reported when the knowledge base is in a failed state. * `id` - Unique identifier of the knowledge base. * `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). * `updated_at` - Time at which the knowledge base was last updated. ## Timeouts [Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): * `create` - (Default `30m`) * `update` - (Default `30m`) * `delete` - (Default `30m`) ## Import In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Agents for Amazon Bedrock Knowledge Base using the knowledge base ID. For example: ```terraform import { to = aws_bedrockagent_knowledge_base.example id = "EMDPPAYPZI" } ``` Using `terraform import`, import Agents for Amazon Bedrock Knowledge Base using the knowledge base ID. For example: ```console % terraform import aws_bedrockagent_knowledge_base.example EMDPPAYPZI ```