Resource: aws_bedrockagent_knowledge_base

Terraform resource for managing an AWS Agents for Amazon Bedrock Knowledge Base.

Example Usage

resource "aws_bedrockagent_knowledge_base" "test" {
  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-v1"
    }
    type = "VECTOR"
  }
  storage_configuration {
    type = "OPENSEARCH_SERVERLESS"
    opensearch_serverless_configuration {
      collection_arn    = "arn:aws:aoss:us-west-2:1234567890: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"
      }
    }
  }
}

Argument Reference

This resource supports the following arguments:

Knowledge Base Configuration supports the following:

Vector Knowledge Base Configuration supports the following:

Storage Configuration supports the following:

Pinecone Configuration supports the following:

Redis Enterprise Cloud Configuration supports the following:

Opensearch Serverless Configuration supports the following:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import Agents for Amazon Bedrock Knowledge Base using the example_id_arg. For example:

import {
  to = aws_bedrockagent_knowledge_base.example
  id = "Q1IYMH6GQG"
}

Using terraform import, import Agents for Amazon Bedrock Knowledge Base using the Q1IYMH6GQG. For example:

% terraform import aws_bedrockagent_knowledge_base.example Q1IYMH6GQG