UNPKG

@pulumi/aws

Version:

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

125 lines 5.19 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.AgentcoreCodeInterpreter = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an AWS Bedrock AgentCore Code Interpreter. Code Interpreter provides a secure environment for AI agents to execute Python code, enabling data analysis, calculations, and file processing capabilities. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.AgentcoreCodeInterpreter("example", { * name: "example-code-interpreter", * description: "Code interpreter for data analysis", * networkConfiguration: { * networkMode: "PUBLIC", * }, * }); * ``` * * ### Code Interpreter with Execution Role * * ```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-code-interpreter-role", * assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json), * }); * const exampleAgentcoreCodeInterpreter = new aws.bedrock.AgentcoreCodeInterpreter("example", { * name: "example-code-interpreter", * description: "Code interpreter with custom execution role", * executionRoleArn: example.arn, * networkConfiguration: { * networkMode: "SANDBOX", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Bedrock AgentCore Code Interpreter using the code interpreter ID. For example: * * ```sh * $ pulumi import aws:bedrock/agentcoreCodeInterpreter:AgentcoreCodeInterpreter example CODEINTERPRETER1234567890 * ``` */ class AgentcoreCodeInterpreter extends pulumi.CustomResource { /** * Get an existing AgentcoreCodeInterpreter 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 AgentcoreCodeInterpreter(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AgentcoreCodeInterpreter. 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'] === AgentcoreCodeInterpreter.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["codeInterpreterArn"] = state?.codeInterpreterArn; resourceInputs["codeInterpreterId"] = state?.codeInterpreterId; resourceInputs["description"] = state?.description; resourceInputs["executionRoleArn"] = state?.executionRoleArn; resourceInputs["name"] = state?.name; resourceInputs["networkConfiguration"] = state?.networkConfiguration; resourceInputs["region"] = state?.region; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["timeouts"] = state?.timeouts; } else { const args = argsOrState; resourceInputs["description"] = args?.description; resourceInputs["executionRoleArn"] = args?.executionRoleArn; resourceInputs["name"] = args?.name; resourceInputs["networkConfiguration"] = args?.networkConfiguration; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["timeouts"] = args?.timeouts; resourceInputs["codeInterpreterArn"] = undefined /*out*/; resourceInputs["codeInterpreterId"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AgentcoreCodeInterpreter.__pulumiType, name, resourceInputs, opts); } } exports.AgentcoreCodeInterpreter = AgentcoreCodeInterpreter; /** @internal */ AgentcoreCodeInterpreter.__pulumiType = 'aws:bedrock/agentcoreCodeInterpreter:AgentcoreCodeInterpreter'; //# sourceMappingURL=agentcoreCodeInterpreter.js.map