import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Resource for managing an AWS Agents for Amazon Bedrock Knowledge Base. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.AgentKnowledgeBase("example", { * knowledgeBaseConfiguration: { * vectorKnowledgeBaseConfiguration: { * embeddingModelArn: "arn:aws:bedrock:us-west-2::foundation-model/amazon.titan-embed-text-v2:0", * }, * type: "VECTOR", * }, * storageConfiguration: { * opensearchServerlessConfiguration: { * fieldMapping: { * vectorField: "bedrock-knowledge-base-default-vector", * textField: "AMAZON_BEDROCK_TEXT_CHUNK", * metadataField: "AMAZON_BEDROCK_METADATA", * }, * collectionArn: "arn:aws:aoss:us-west-2:123456789012:collection/142bezjddq707i5stcrf", * vectorIndexName: "bedrock-knowledge-base-default-index", * }, * type: "OPENSEARCH_SERVERLESS", * }, * name: "example", * roleArn: exampleAwsIamRole.arn, * }); * ``` * * ### Kendra Knowledge Base * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const kendraExample = new aws.bedrock.AgentKnowledgeBase("kendra_example", { * knowledgeBaseConfiguration: { * kendraKnowledgeBaseConfiguration: { * kendraIndexArn: "arn:aws:kendra:us-east-1:123456789012:index/example-index-id", * }, * type: "KENDRA", * }, * name: "example-kendra-kb", * roleArn: example.arn, * }); * ``` * * ### Structured Data Store * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.AgentKnowledgeBase("example", { * knowledgeBaseConfiguration: { * sqlKnowledgeBaseConfiguration: { * redshiftConfiguration: { * queryEngineConfiguration: { * provisionedConfiguration: { * authConfiguration: { * type: "USERNAME", * databaseUser: exampleAwsRedshiftCluster.masterUsername, * }, * clusterIdentifier: exampleAwsRedshiftCluster.clusterIdentifier, * }, * type: "PROVISIONED", * }, * storageConfiguration: { * redshiftConfiguration: { * databaseName: exampleAwsRedshiftCluster.databaseName, * }, * type: "REDSHIFT", * }, * }, * type: "REDSHIFT", * }, * type: "SQL", * }, * name: "example-kb", * roleArn: exampleAwsIamRole.arn, * }); * ``` * * ### OpenSearch Managed Cluster Configuration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.AgentKnowledgeBase("example", { * knowledgeBaseConfiguration: { * vectorKnowledgeBaseConfiguration: { * embeddingModelArn: "arn:aws:bedrock:us-west-2::foundation-model/amazon.titan-embed-text-v2:0", * }, * type: "VECTOR", * }, * storageConfiguration: { * opensearchManagedClusterConfiguration: { * fieldMapping: { * metadataField: "metadata", * textField: "chunks", * vectorField: "embedding", * }, * domainArn: "arn:aws:es:us-west-2:123456789012:domain/example-domain", * domainEndpoint: "https://search-example-domain.us-west-2.es.amazonaws.com", * vectorIndexName: "example_index", * }, * type: "OPENSEARCH_MANAGED_CLUSTER", * }, * name: "example", * roleArn: exampleAwsIamRole.arn, * }); * ``` * * ### With Supplemental Data Storage Configuration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.AgentKnowledgeBase("example", { * knowledgeBaseConfiguration: { * vectorKnowledgeBaseConfiguration: { * embeddingModelConfiguration: { * bedrockEmbeddingModelConfiguration: { * audio: { * segmentationConfiguration: { * fixedLengthDuration: 60, * }, * }, * video: { * segmentationConfiguration: { * fixedLengthDuration: 60, * }, * }, * dimensions: 1024, * embeddingDataType: "FLOAT32", * }, * }, * supplementalDataStorageConfiguration: { * storageLocation: { * s3Location: { * uri: "s3://my-bucket/chunk-processor/", * }, * type: "S3", * }, * }, * embeddingModelArn: "arn:aws:bedrock:us-west-2::foundation-model/amazon.titan-embed-text-v2:0", * }, * type: "VECTOR", * }, * storageConfiguration: { * opensearchServerlessConfiguration: { * fieldMapping: { * vectorField: "bedrock-knowledge-base-default-vector", * textField: "AMAZON_BEDROCK_TEXT_CHUNK", * metadataField: "AMAZON_BEDROCK_METADATA", * }, * collectionArn: "arn:aws:aoss:us-west-2:123456789012:collection/142bezjddq707i5stcrf", * vectorIndexName: "bedrock-knowledge-base-default-index", * }, * type: "OPENSEARCH_SERVERLESS", * }, * name: "example", * roleArn: exampleAwsIamRole.arn, * }); * ``` * * ### S3 Vectors Configuration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.s3.VectorsVectorBucket("example", {vectorBucketName: "example-bucket"}); * const exampleVectorsIndex = new aws.s3.VectorsIndex("example", { * indexName: "example-index", * vectorBucketName: example.vectorBucketName, * dataType: "float32", * dimension: 256, * distanceMetric: "euclidean", * }); * const exampleAgentKnowledgeBase = new aws.bedrock.AgentKnowledgeBase("example", { * knowledgeBaseConfiguration: { * vectorKnowledgeBaseConfiguration: { * embeddingModelConfiguration: { * bedrockEmbeddingModelConfiguration: { * dimensions: 256, * embeddingDataType: "FLOAT32", * }, * }, * embeddingModelArn: "arn:aws:bedrock:us-west-2::foundation-model/amazon.titan-embed-text-v2:0", * }, * type: "VECTOR", * }, * storageConfiguration: { * s3VectorsConfiguration: { * indexArn: exampleVectorsIndex.indexArn, * }, * type: "S3_VECTORS", * }, * name: "example-s3vectors-kb", * roleArn: exampleAwsIamRole.arn, * }); * ``` * * ### Managed Knowledge Base * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.AgentKnowledgeBase("example", { * knowledgeBaseConfiguration: { * managedKnowledgeBaseConfiguration: { * embeddingModelType: "MANAGED", * }, * type: "MANAGED", * }, * name: "example-managed-kb", * roleArn: exampleAwsIamRole.arn, * }); * ``` * * ### Managed Knowledge Base with Custom Embedding Model * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.AgentKnowledgeBase("example", { * knowledgeBaseConfiguration: { * managedKnowledgeBaseConfiguration: { * embeddingModelConfiguration: { * bedrockEmbeddingModelConfiguration: { * dimensions: 1024, * }, * }, * embeddingModelType: "CUSTOM", * embeddingModelArn: "arn:aws:bedrock:us-east-1::foundation-model/cohere.embed-multilingual-v3", * }, * type: "MANAGED", * }, * name: "example-managed-multilingual-kb", * roleArn: exampleAwsIamRole.arn, * }); * ``` * * ## Import * * Using `pulumi import`, import Agents for Amazon Bedrock Knowledge Base using the knowledge base ID. For example: * * ```sh * $ pulumi import aws:bedrock/agentKnowledgeBase:AgentKnowledgeBase example EMDPPAYPZI * ``` */ export declare class AgentKnowledgeBase extends pulumi.CustomResource { /** * Get an existing AgentKnowledgeBase resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: AgentKnowledgeBaseState, opts?: pulumi.CustomResourceOptions): AgentKnowledgeBase; /** * Returns true if the given object is an instance of AgentKnowledgeBase. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is AgentKnowledgeBase; /** * ARN of the knowledge base. */ readonly arn: pulumi.Output; /** * Time at which the knowledge base was created. */ readonly createdAt: pulumi.Output; /** * Description of the knowledge base. */ readonly description: pulumi.Output; /** * List of failure reasons reported when the knowledge base is in a failed state. */ readonly failureReasons: pulumi.Output; /** * Details about the embeddings configuration of the knowledge base. See `knowledgeBaseConfiguration` Block for details. */ readonly knowledgeBaseConfiguration: pulumi.Output; /** * Name of the knowledge base. */ readonly name: pulumi.Output; /** * 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. */ readonly region: pulumi.Output; /** * ARN of the IAM role with permissions to invoke API operations on the knowledge base. * * The following arguments are optional: */ readonly roleArn: pulumi.Output; /** * Details about the storage configuration of the knowledge base. See `storageConfiguration` Block for details. */ readonly storageConfiguration: pulumi.Output; /** * Map of tags assigned to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ readonly tagsAll: pulumi.Output<{ [key: string]: string; }>; readonly timeouts: pulumi.Output; /** * Time at which the knowledge base was last updated. */ readonly updatedAt: pulumi.Output; /** * Create a AgentKnowledgeBase resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: AgentKnowledgeBaseArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AgentKnowledgeBase resources. */ export interface AgentKnowledgeBaseState { /** * ARN of the knowledge base. */ arn?: pulumi.Input; /** * Time at which the knowledge base was created. */ createdAt?: pulumi.Input; /** * Description of the knowledge base. */ description?: pulumi.Input; /** * List of failure reasons reported when the knowledge base is in a failed state. */ failureReasons?: pulumi.Input[] | undefined>; /** * Details about the embeddings configuration of the knowledge base. See `knowledgeBaseConfiguration` Block for details. */ knowledgeBaseConfiguration?: pulumi.Input; /** * Name of the knowledge base. */ name?: pulumi.Input; /** * 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. */ region?: pulumi.Input; /** * ARN of the IAM role with permissions to invoke API operations on the knowledge base. * * The following arguments are optional: */ roleArn?: pulumi.Input; /** * Details about the storage configuration of the knowledge base. See `storageConfiguration` Block for details. */ storageConfiguration?: pulumi.Input; /** * Map of tags assigned to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ tagsAll?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; timeouts?: pulumi.Input; /** * Time at which the knowledge base was last updated. */ updatedAt?: pulumi.Input; } /** * The set of arguments for constructing a AgentKnowledgeBase resource. */ export interface AgentKnowledgeBaseArgs { /** * Description of the knowledge base. */ description?: pulumi.Input; /** * Details about the embeddings configuration of the knowledge base. See `knowledgeBaseConfiguration` Block for details. */ knowledgeBaseConfiguration: pulumi.Input; /** * Name of the knowledge base. */ name?: pulumi.Input; /** * 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. */ region?: pulumi.Input; /** * ARN of the IAM role with permissions to invoke API operations on the knowledge base. * * The following arguments are optional: */ roleArn: pulumi.Input; /** * Details about the storage configuration of the knowledge base. See `storageConfiguration` Block for details. */ storageConfiguration?: pulumi.Input; /** * Map of tags assigned to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; timeouts?: pulumi.Input; } //# sourceMappingURL=agentKnowledgeBase.d.ts.map