@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
195 lines • 7.71 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.AgentFlow = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS Bedrock Agents Flow.
*
* ## Example Usage
*
* The default definition:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.bedrock.AgentFlow("example", {
* name: "example",
* executionRoleArn: exampleAwsIamRole.arn,
* definition: {
* connections: [
* {
* name: "FlowInputNodeFlowInputNode0ToPrompt_1PromptsNode0",
* source: "FlowInputNode",
* target: "Prompt_1",
* type: "Data",
* configuration: {
* data: {
* sourceOutput: "document",
* targetInput: "topic",
* },
* },
* },
* {
* name: "Prompt_1PromptsNode0ToFlowOutputNodeFlowOutputNode0",
* source: "Prompt_1",
* target: "FlowOutputNode",
* type: "Data",
* configuration: {
* data: {
* sourceOutput: "modelCompletion",
* targetInput: "document",
* },
* },
* },
* ],
* nodes: [
* {
* name: "FlowInputNode",
* type: "Input",
* configuration: {
* input: {},
* },
* outputs: [{
* name: "document",
* type: "String",
* }],
* },
* {
* name: "Prompt_1",
* type: "Prompt",
* configuration: {
* prompt: {
* sourceConfiguration: {
* inline: {
* modelId: "amazon.titan-text-express-v1",
* templateType: "TEXT",
* inferenceConfiguration: {
* text: {
* maxTokens: 2048,
* stopSequences: ["User:"],
* temperature: 0,
* topP: 0.8999999761581421,
* },
* },
* templateConfiguration: {
* text: {
* text: "Write a paragraph about {{topic}}.",
* inputVariables: [{
* name: "topic",
* }],
* },
* },
* },
* },
* },
* },
* inputs: [{
* expression: "$.data",
* name: "topic",
* type: "String",
* }],
* outputs: [{
* name: "modelCompletion",
* type: "String",
* }],
* },
* {
* name: "FlowOutputNode",
* type: "Output",
* configuration: {
* output: {},
* },
* inputs: [{
* expression: "$.data",
* name: "document",
* type: "String",
* }],
* },
* ],
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Bedrock Agents Flow using the `id`. For example:
*
* ```sh
* $ pulumi import aws:bedrock/agentFlow:AgentFlow example ABCDEFGHIJ
* ```
*/
class AgentFlow extends pulumi.CustomResource {
/**
* Get an existing AgentFlow 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 AgentFlow(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of AgentFlow. 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'] === AgentFlow.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["customerEncryptionKeyArn"] = state?.customerEncryptionKeyArn;
resourceInputs["definition"] = state?.definition;
resourceInputs["description"] = state?.description;
resourceInputs["executionRoleArn"] = state?.executionRoleArn;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["status"] = state?.status;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["timeouts"] = state?.timeouts;
resourceInputs["updatedAt"] = state?.updatedAt;
resourceInputs["version"] = state?.version;
}
else {
const args = argsOrState;
if (args?.executionRoleArn === undefined && !opts.urn) {
throw new Error("Missing required property 'executionRoleArn'");
}
resourceInputs["customerEncryptionKeyArn"] = args?.customerEncryptionKeyArn;
resourceInputs["definition"] = args?.definition;
resourceInputs["description"] = args?.description;
resourceInputs["executionRoleArn"] = args?.executionRoleArn;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["timeouts"] = args?.timeouts;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AgentFlow.__pulumiType, name, resourceInputs, opts);
}
}
exports.AgentFlow = AgentFlow;
/** @internal */
AgentFlow.__pulumiType = 'aws:bedrock/agentFlow:AgentFlow';
//# sourceMappingURL=agentFlow.js.map