UNPKG

@pulumi/aws

Version:

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

178 lines 7.32 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.AgentcoreGateway = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an AWS Bedrock AgentCore Gateway. With Gateway, developers can convert APIs, Lambda functions, and existing services into Model Context Protocol (MCP)-compatible tools. * * ## Example Usage * * ### Gateway with JWT Authorization * * ```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-gateway-role", * assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json), * }); * const exampleAgentcoreGateway = new aws.bedrock.AgentcoreGateway("example", { * name: "example-gateway", * roleArn: example.arn, * authorizerType: "CUSTOM_JWT", * authorizerConfiguration: { * customJwtAuthorizer: { * discoveryUrl: "https://accounts.google.com/.well-known/openid-configuration", * allowedAudiences: [ * "test1", * "test2", * ], * }, * }, * protocolType: "MCP", * }); * ``` * * ### Gateway with advanced JWT Authorization and MCP Configuration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.AgentcoreGateway("example", { * name: "mcp-gateway", * description: "Gateway for MCP communication", * roleArn: exampleAwsIamRole.arn, * authorizerType: "CUSTOM_JWT", * authorizerConfiguration: { * customJwtAuthorizer: { * discoveryUrl: "https://auth.example.com/.well-known/openid-configuration", * allowedAudiences: [ * "app-client", * "web-client", * ], * allowedClients: [ * "client-123", * "client-456", * ], * }, * }, * protocolType: "MCP", * protocolConfiguration: { * mcp: { * instructions: "Gateway for handling MCP requests", * searchType: "HYBRID", * supportedVersions: [ * "2025-03-26", * "2025-06-18", * ], * }, * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Bedrock AgentCore Gateway using the gateway ID. For example: * * ```sh * $ pulumi import aws:bedrock/agentcoreGateway:AgentcoreGateway example GATEWAY1234567890 * ``` */ class AgentcoreGateway extends pulumi.CustomResource { /** * Get an existing AgentcoreGateway 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 AgentcoreGateway(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AgentcoreGateway. 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'] === AgentcoreGateway.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["authorizerConfiguration"] = state?.authorizerConfiguration; resourceInputs["authorizerType"] = state?.authorizerType; resourceInputs["description"] = state?.description; resourceInputs["exceptionLevel"] = state?.exceptionLevel; resourceInputs["gatewayArn"] = state?.gatewayArn; resourceInputs["gatewayId"] = state?.gatewayId; resourceInputs["gatewayUrl"] = state?.gatewayUrl; resourceInputs["kmsKeyArn"] = state?.kmsKeyArn; resourceInputs["name"] = state?.name; resourceInputs["protocolConfiguration"] = state?.protocolConfiguration; resourceInputs["protocolType"] = state?.protocolType; resourceInputs["region"] = state?.region; 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?.authorizerType === undefined && !opts.urn) { throw new Error("Missing required property 'authorizerType'"); } if (args?.protocolType === undefined && !opts.urn) { throw new Error("Missing required property 'protocolType'"); } if (args?.roleArn === undefined && !opts.urn) { throw new Error("Missing required property 'roleArn'"); } resourceInputs["authorizerConfiguration"] = args?.authorizerConfiguration; resourceInputs["authorizerType"] = args?.authorizerType; resourceInputs["description"] = args?.description; resourceInputs["exceptionLevel"] = args?.exceptionLevel; resourceInputs["kmsKeyArn"] = args?.kmsKeyArn; resourceInputs["name"] = args?.name; resourceInputs["protocolConfiguration"] = args?.protocolConfiguration; resourceInputs["protocolType"] = args?.protocolType; resourceInputs["region"] = args?.region; resourceInputs["roleArn"] = args?.roleArn; resourceInputs["tags"] = args?.tags; resourceInputs["timeouts"] = args?.timeouts; resourceInputs["gatewayArn"] = undefined /*out*/; resourceInputs["gatewayId"] = undefined /*out*/; resourceInputs["gatewayUrl"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["workloadIdentityDetails"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AgentcoreGateway.__pulumiType, name, resourceInputs, opts); } } exports.AgentcoreGateway = AgentcoreGateway; /** @internal */ AgentcoreGateway.__pulumiType = 'aws:bedrock/agentcoreGateway:AgentcoreGateway'; //# sourceMappingURL=agentcoreGateway.js.map