UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

130 lines 5.37 kB
"use strict"; // *** 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.AgentcoreMemory = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an AWS Bedrock AgentCore Memory. Memory provides persistent storage for AI agent interactions, allowing agents to retain context across conversations and sessions. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const assumeRole = aws.iam.getPolicyDocument({ * statements: [{ * effect: "Allow", * actions: ["sts:AssumeRole"], * principals: [{ * type: "Service", * identifiers: ["bedrock-agentcore.amazonaws.com"], * }], * }], * }); * const example = new aws.iam.Role("example", { * name: "bedrock-agentcore-memory-role", * assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json), * }); * const exampleRolePolicyAttachment = new aws.iam.RolePolicyAttachment("example", { * role: example.name, * policyArn: "arn:aws:iam::aws:policy/AmazonBedrockAgentCoreMemoryBedrockModelInferenceExecutionRolePolicy", * }); * const exampleAgentcoreMemory = new aws.bedrock.AgentcoreMemory("example", { * name: "example_memory", * eventExpiryDuration: 30, * }); * ``` * * ### Memory with Custom Encryption and Role * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.kms.Key("example", {description: "KMS key for Bedrock AgentCore Memory"}); * const exampleAgentcoreMemory = new aws.bedrock.AgentcoreMemory("example", { * name: "example_memory", * description: "Memory for customer service agent", * eventExpiryDuration: 60, * encryptionKeyArn: example.arn, * memoryExecutionRoleArn: exampleAwsIamRole.arn, * clientToken: "unique-client-token", * }); * ``` * * ## Import * * Using `pulumi import`, import Bedrock AgentCore Memory using the memory ID. For example: * * ```sh * $ pulumi import aws:bedrock/agentcoreMemory:AgentcoreMemory example MEMORY1234567890 * ``` */ class AgentcoreMemory extends pulumi.CustomResource { /** * Get an existing AgentcoreMemory 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 AgentcoreMemory(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AgentcoreMemory. 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'] === AgentcoreMemory.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["description"] = state?.description; resourceInputs["encryptionKeyArn"] = state?.encryptionKeyArn; resourceInputs["eventExpiryDuration"] = state?.eventExpiryDuration; resourceInputs["memoryExecutionRoleArn"] = state?.memoryExecutionRoleArn; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["timeouts"] = state?.timeouts; } else { const args = argsOrState; if (args?.eventExpiryDuration === undefined && !opts.urn) { throw new Error("Missing required property 'eventExpiryDuration'"); } resourceInputs["description"] = args?.description; resourceInputs["encryptionKeyArn"] = args?.encryptionKeyArn; resourceInputs["eventExpiryDuration"] = args?.eventExpiryDuration; resourceInputs["memoryExecutionRoleArn"] = args?.memoryExecutionRoleArn; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["timeouts"] = args?.timeouts; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AgentcoreMemory.__pulumiType, name, resourceInputs, opts); } } exports.AgentcoreMemory = AgentcoreMemory; /** @internal */ AgentcoreMemory.__pulumiType = 'aws:bedrock/agentcoreMemory:AgentcoreMemory'; //# sourceMappingURL=agentcoreMemory.js.map