@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
163 lines • 6.8 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.AgentKnowledgeBase = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* 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", {
* name: "example",
* roleArn: exampleAwsIamRole.arn,
* knowledgeBaseConfiguration: {
* vectorKnowledgeBaseConfiguration: {
* embeddingModelArn: "arn:aws:bedrock:us-west-2::foundation-model/amazon.titan-embed-text-v2:0",
* },
* type: "VECTOR",
* },
* storageConfiguration: {
* type: "OPENSEARCH_SERVERLESS",
* opensearchServerlessConfiguration: {
* collectionArn: "arn:aws:aoss:us-west-2:123456789012:collection/142bezjddq707i5stcrf",
* vectorIndexName: "bedrock-knowledge-base-default-index",
* fieldMapping: {
* vectorField: "bedrock-knowledge-base-default-vector",
* textField: "AMAZON_BEDROCK_TEXT_CHUNK",
* metadataField: "AMAZON_BEDROCK_METADATA",
* },
* },
* },
* });
* ```
*
* ### 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", {
* name: "example",
* roleArn: exampleAwsIamRole.arn,
* knowledgeBaseConfiguration: {
* vectorKnowledgeBaseConfiguration: {
* embeddingModelArn: "arn:aws:bedrock:us-west-2::foundation-model/amazon.titan-embed-text-v2:0",
* embeddingModelConfiguration: {
* bedrockEmbeddingModelConfiguration: {
* dimensions: 1024,
* embeddingDataType: "FLOAT32",
* },
* },
* supplementalDataStorageConfiguration: {
* storageLocations: [{
* type: "S3",
* s3Location: {
* uri: "s3://my-bucket/chunk-processor/",
* },
* }],
* },
* },
* type: "VECTOR",
* },
* storageConfiguration: {
* type: "OPENSEARCH_SERVERLESS",
* opensearchServerlessConfiguration: {
* collectionArn: "arn:aws:aoss:us-west-2:123456789012:collection/142bezjddq707i5stcrf",
* vectorIndexName: "bedrock-knowledge-base-default-index",
* fieldMapping: {
* vectorField: "bedrock-knowledge-base-default-vector",
* textField: "AMAZON_BEDROCK_TEXT_CHUNK",
* metadataField: "AMAZON_BEDROCK_METADATA",
* },
* },
* },
* });
* ```
*
* ## 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
* ```
*/
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, id, state, opts) {
return new AgentKnowledgeBase(name, state, { ...opts, id: id });
}
/**
* 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) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === AgentKnowledgeBase.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["description"] = state?.description;
resourceInputs["failureReasons"] = state?.failureReasons;
resourceInputs["knowledgeBaseConfiguration"] = state?.knowledgeBaseConfiguration;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["roleArn"] = state?.roleArn;
resourceInputs["storageConfiguration"] = state?.storageConfiguration;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["timeouts"] = state?.timeouts;
resourceInputs["updatedAt"] = state?.updatedAt;
}
else {
const args = argsOrState;
if (args?.roleArn === undefined && !opts.urn) {
throw new Error("Missing required property 'roleArn'");
}
resourceInputs["description"] = args?.description;
resourceInputs["knowledgeBaseConfiguration"] = args?.knowledgeBaseConfiguration;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["roleArn"] = args?.roleArn;
resourceInputs["storageConfiguration"] = args?.storageConfiguration;
resourceInputs["tags"] = args?.tags;
resourceInputs["timeouts"] = args?.timeouts;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["failureReasons"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AgentKnowledgeBase.__pulumiType, name, resourceInputs, opts);
}
}
exports.AgentKnowledgeBase = AgentKnowledgeBase;
/** @internal */
AgentKnowledgeBase.__pulumiType = 'aws:bedrock/agentKnowledgeBase:AgentKnowledgeBase';
//# sourceMappingURL=agentKnowledgeBase.js.map