UNPKG

@pulumi/aws

Version:

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

198 lines • 8.26 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.AgentcoreAgentRuntime = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an AWS Bedrock AgentCore Agent Runtime. Agent Runtime provides a containerized execution environment for AI agents. * * ## 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 ecrPermissions = aws.iam.getPolicyDocument({ * statements: [ * { * actions: ["ecr:GetAuthorizationToken"], * effect: "Allow", * resources: ["*"], * }, * { * actions: [ * "ecr:BatchGetImage", * "ecr:GetDownloadUrlForLayer", * ], * effect: "Allow", * resources: [exampleAwsEcrRepository.arn], * }, * ], * }); * const example = new aws.iam.Role("example", { * name: "bedrock-agentcore-runtime-role", * assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json), * }); * const exampleRolePolicy = new aws.iam.RolePolicy("example", { * role: example.id, * policy: ecrPermissions.then(ecrPermissions => ecrPermissions.json), * }); * const exampleAgentcoreAgentRuntime = new aws.bedrock.AgentcoreAgentRuntime("example", { * agentRuntimeName: "example_agent_runtime", * roleArn: example.arn, * agentRuntimeArtifact: { * containerConfiguration: { * containerUri: `${exampleAwsEcrRepository.repositoryUrl}:latest`, * }, * }, * networkConfiguration: { * networkMode: "PUBLIC", * }, * }); * ``` * * ### MCP Server With Custom JWT Authorizer * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.AgentcoreAgentRuntime("example", { * agentRuntimeName: "example_agent_runtime", * description: "Agent runtime with JWT authorization", * roleArn: exampleAwsIamRole.arn, * agentRuntimeArtifact: { * containerConfiguration: { * containerUri: `${exampleAwsEcrRepository.repositoryUrl}:v1.0`, * }, * }, * environmentVariables: { * LOG_LEVEL: "INFO", * ENV: "production", * }, * authorizerConfiguration: { * customJwtAuthorizer: { * discoveryUrl: "https://accounts.google.com/.well-known/openid-configuration", * allowedAudiences: [ * "my-app", * "mobile-app", * ], * allowedClients: [ * "client-123", * "client-456", * ], * }, * }, * networkConfiguration: { * networkMode: "PUBLIC", * }, * protocolConfiguration: { * serverProtocol: "MCP", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Bedrock AgentCore Agent Runtime using `agent_runtime_id`. For example: * * ```sh * $ pulumi import aws:bedrock/agentcoreAgentRuntime:AgentcoreAgentRuntime example agent-runtime-12345 * ``` */ class AgentcoreAgentRuntime extends pulumi.CustomResource { /** * Get an existing AgentcoreAgentRuntime 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 AgentcoreAgentRuntime(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AgentcoreAgentRuntime. 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'] === AgentcoreAgentRuntime.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["agentRuntimeArn"] = state?.agentRuntimeArn; resourceInputs["agentRuntimeArtifact"] = state?.agentRuntimeArtifact; resourceInputs["agentRuntimeId"] = state?.agentRuntimeId; resourceInputs["agentRuntimeName"] = state?.agentRuntimeName; resourceInputs["agentRuntimeVersion"] = state?.agentRuntimeVersion; resourceInputs["authorizerConfiguration"] = state?.authorizerConfiguration; resourceInputs["description"] = state?.description; resourceInputs["environmentVariables"] = state?.environmentVariables; resourceInputs["lifecycleConfigurations"] = state?.lifecycleConfigurations; resourceInputs["networkConfiguration"] = state?.networkConfiguration; resourceInputs["protocolConfiguration"] = state?.protocolConfiguration; resourceInputs["region"] = state?.region; resourceInputs["requestHeaderConfiguration"] = state?.requestHeaderConfiguration; resourceInputs["roleArn"] = state?.roleArn; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["timeouts"] = state?.timeouts; resourceInputs["workloadIdentityDetails"] = state?.workloadIdentityDetails; } else { const args = argsOrState; if (args?.agentRuntimeName === undefined && !opts.urn) { throw new Error("Missing required property 'agentRuntimeName'"); } if (args?.roleArn === undefined && !opts.urn) { throw new Error("Missing required property 'roleArn'"); } resourceInputs["agentRuntimeArtifact"] = args?.agentRuntimeArtifact; resourceInputs["agentRuntimeName"] = args?.agentRuntimeName; resourceInputs["authorizerConfiguration"] = args?.authorizerConfiguration; resourceInputs["description"] = args?.description; resourceInputs["environmentVariables"] = args?.environmentVariables; resourceInputs["lifecycleConfigurations"] = args?.lifecycleConfigurations; resourceInputs["networkConfiguration"] = args?.networkConfiguration; resourceInputs["protocolConfiguration"] = args?.protocolConfiguration; resourceInputs["region"] = args?.region; resourceInputs["requestHeaderConfiguration"] = args?.requestHeaderConfiguration; resourceInputs["roleArn"] = args?.roleArn; resourceInputs["tags"] = args?.tags; resourceInputs["timeouts"] = args?.timeouts; resourceInputs["agentRuntimeArn"] = undefined /*out*/; resourceInputs["agentRuntimeId"] = undefined /*out*/; resourceInputs["agentRuntimeVersion"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["workloadIdentityDetails"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AgentcoreAgentRuntime.__pulumiType, name, resourceInputs, opts); } } exports.AgentcoreAgentRuntime = AgentcoreAgentRuntime; /** @internal */ AgentcoreAgentRuntime.__pulumiType = 'aws:bedrock/agentcoreAgentRuntime:AgentcoreAgentRuntime'; //# sourceMappingURL=agentcoreAgentRuntime.js.map