AgentcoreGateway class
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
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const assumeRole = aws.iam.getPolicyDocument({
statements: [{
principals: [{
type: "Service",
identifiers: ["bedrock-agentcore.amazonaws.com"],
}],
effect: "Allow",
actions: ["sts:AssumeRole"],
}],
});
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", {
authorizerConfiguration: {
customJwtAuthorizer: {
discoveryUrl: "https://accounts.google.com/.well-known/openid-configuration",
allowedAudiences: [
"test1",
"test2",
],
},
},
name: "example-gateway",
roleArn: example.arn,
authorizerType: "CUSTOM_JWT",
protocolType: "MCP",
});
import pulumi
import pulumi_aws as aws
assume_role = aws.iam.get_policy_document(statements=[{
"principals": [{
"type": "Service",
"identifiers": ["bedrock-agentcore.amazonaws.com"],
}],
"effect": "Allow",
"actions": ["sts:AssumeRole"],
}])
example = aws.iam.Role("example",
name="bedrock-agentcore-gateway-role",
assume_role_policy=assume_role.json)
example_agentcore_gateway = aws.bedrock.AgentcoreGateway("example",
authorizer_configuration={
"custom_jwt_authorizer": {
"discovery_url": "https://accounts.google.com/.well-known/openid-configuration",
"allowed_audiences": [
"test1",
"test2",
],
},
},
name="example-gateway",
role_arn=example.arn,
authorizer_type="CUSTOM_JWT",
protocol_type="MCP")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var assumeRole = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Principals = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
{
Type = "Service",
Identifiers = new[]
{
"bedrock-agentcore.amazonaws.com",
},
},
},
Effect = "Allow",
Actions = new[]
{
"sts:AssumeRole",
},
},
},
});
var example = new Aws.Iam.Role("example", new()
{
Name = "bedrock-agentcore-gateway-role",
AssumeRolePolicy = assumeRole.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
});
var exampleAgentcoreGateway = new Aws.Bedrock.AgentcoreGateway("example", new()
{
AuthorizerConfiguration = new Aws.Bedrock.Inputs.AgentcoreGatewayAuthorizerConfigurationArgs
{
CustomJwtAuthorizer = new Aws.Bedrock.Inputs.AgentcoreGatewayAuthorizerConfigurationCustomJwtAuthorizerArgs
{
DiscoveryUrl = "https://accounts.google.com/.well-known/openid-configuration",
AllowedAudiences = new[]
{
"test1",
"test2",
},
},
},
Name = "example-gateway",
RoleArn = example.Arn,
AuthorizerType = "CUSTOM_JWT",
ProtocolType = "MCP",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/bedrock"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
assumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
Statements: []iam.GetPolicyDocumentStatement{
{
Principals: []iam.GetPolicyDocumentStatementPrincipal{
{
Type: "Service",
Identifiers: []string{
"bedrock-agentcore.amazonaws.com",
},
},
},
Effect: pulumi.StringRef("Allow"),
Actions: []string{
"sts:AssumeRole",
},
},
},
}, nil)
if err != nil {
return err
}
example, err := iam.NewRole(ctx, "example", &iam.RoleArgs{
Name: pulumi.String("bedrock-agentcore-gateway-role"),
AssumeRolePolicy: pulumi.String(assumeRole.Json),
})
if err != nil {
return err
}
_, err = bedrock.NewAgentcoreGateway(ctx, "example", &bedrock.AgentcoreGatewayArgs{
AuthorizerConfiguration: &bedrock.AgentcoreGatewayAuthorizerConfigurationArgs{
CustomJwtAuthorizer: &bedrock.AgentcoreGatewayAuthorizerConfigurationCustomJwtAuthorizerArgs{
DiscoveryUrl: pulumi.String("https://accounts.google.com/.well-known/openid-configuration"),
AllowedAudiences: pulumi.StringArray{
pulumi.String("test1"),
pulumi.String("test2"),
},
},
},
Name: pulumi.String("example-gateway"),
RoleArn: example.Arn,
AuthorizerType: pulumi.String("CUSTOM_JWT"),
ProtocolType: pulumi.String("MCP"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
data "aws_iam_getpolicydocument" "assumeRole" {
statements {
principals {
type = "Service"
identifiers = ["bedrock-agentcore.amazonaws.com"]
}
effect = "Allow"
actions = ["sts:AssumeRole"]
}
}
resource "aws_iam_role" "example" {
name = "bedrock-agentcore-gateway-role"
assume_role_policy = data.aws_iam_getpolicydocument.assumeRole.json
}
resource "aws_bedrock_agentcoregateway" "example" {
authorizer_configuration = {
custom_jwt_authorizer = {
discovery_url = "https://accounts.google.com/.well-known/openid-configuration"
allowed_audiences = ["test1", "test2"]
}
}
name = "example-gateway"
role_arn = aws_iam_role.example.arn
authorizer_type = "CUSTOM_JWT"
protocol_type = "MCP"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementArgs;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementPrincipalArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.bedrock.AgentcoreGateway;
import com.pulumi.aws.bedrock.AgentcoreGatewayArgs;
import com.pulumi.aws.bedrock.inputs.AgentcoreGatewayAuthorizerConfigurationArgs;
import com.pulumi.aws.bedrock.inputs.AgentcoreGatewayAuthorizerConfigurationCustomJwtAuthorizerArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.type("Service")
.identifiers("bedrock-agentcore.amazonaws.com")
.build())
.effect("Allow")
.actions("sts:AssumeRole")
.build())
.build());
var example = new Role("example", RoleArgs.builder()
.name("bedrock-agentcore-gateway-role")
.assumeRolePolicy(assumeRole.json())
.build());
var exampleAgentcoreGateway = new AgentcoreGateway("exampleAgentcoreGateway", AgentcoreGatewayArgs.builder()
.authorizerConfiguration(AgentcoreGatewayAuthorizerConfigurationArgs.builder()
.customJwtAuthorizer(AgentcoreGatewayAuthorizerConfigurationCustomJwtAuthorizerArgs.builder()
.discoveryUrl("https://accounts.google.com/.well-known/openid-configuration")
.allowedAudiences(
"test1",
"test2")
.build())
.build())
.name("example-gateway")
.roleArn(example.arn())
.authorizerType("CUSTOM_JWT")
.protocolType("MCP")
.build());
}
}
resources:
example:
type: aws:iam:Role
properties:
name: bedrock-agentcore-gateway-role
assumeRolePolicy: ${assumeRole.json}
exampleAgentcoreGateway:
type: aws:bedrock:AgentcoreGateway
name: example
properties:
authorizerConfiguration:
customJwtAuthorizer:
discoveryUrl: https://accounts.google.com/.well-known/openid-configuration
allowedAudiences:
- test1
- test2
name: example-gateway
roleArn: ${example.arn}
authorizerType: CUSTOM_JWT
protocolType: MCP
variables:
assumeRole:
fn::invoke:
function: aws:iam:getPolicyDocument
arguments:
statements:
- principals:
- type: Service
identifiers:
- bedrock-agentcore.amazonaws.com
effect: Allow
actions:
- sts:AssumeRole
Gateway with advanced JWT Authorization and MCP Configuration
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.bedrock.AgentcoreGateway("example", {
authorizerConfiguration: {
customJwtAuthorizer: {
discoveryUrl: "https://auth.example.com/.well-known/openid-configuration",
allowedAudiences: [
"app-client",
"web-client",
],
allowedClients: [
"client-123",
"client-456",
],
allowedScopes: [
"openid",
"email",
],
},
},
protocolConfiguration: {
mcp: {
instructions: "Gateway for handling MCP requests",
searchType: "HYBRID",
supportedVersions: [
"2025-03-26",
"2025-06-18",
],
},
},
name: "mcp-gateway",
description: "Gateway for MCP communication",
roleArn: exampleAwsIamRole.arn,
authorizerType: "CUSTOM_JWT",
protocolType: "MCP",
});
import pulumi
import pulumi_aws as aws
example = aws.bedrock.AgentcoreGateway("example",
authorizer_configuration={
"custom_jwt_authorizer": {
"discovery_url": "https://auth.example.com/.well-known/openid-configuration",
"allowed_audiences": [
"app-client",
"web-client",
],
"allowed_clients": [
"client-123",
"client-456",
],
"allowed_scopes": [
"openid",
"email",
],
},
},
protocol_configuration={
"mcp": {
"instructions": "Gateway for handling MCP requests",
"search_type": "HYBRID",
"supported_versions": [
"2025-03-26",
"2025-06-18",
],
},
},
name="mcp-gateway",
description="Gateway for MCP communication",
role_arn=example_aws_iam_role["arn"],
authorizer_type="CUSTOM_JWT",
protocol_type="MCP")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Bedrock.AgentcoreGateway("example", new()
{
AuthorizerConfiguration = new Aws.Bedrock.Inputs.AgentcoreGatewayAuthorizerConfigurationArgs
{
CustomJwtAuthorizer = new Aws.Bedrock.Inputs.AgentcoreGatewayAuthorizerConfigurationCustomJwtAuthorizerArgs
{
DiscoveryUrl = "https://auth.example.com/.well-known/openid-configuration",
AllowedAudiences = new[]
{
"app-client",
"web-client",
},
AllowedClients = new[]
{
"client-123",
"client-456",
},
AllowedScopes = new[]
{
"openid",
"email",
},
},
},
ProtocolConfiguration = new Aws.Bedrock.Inputs.AgentcoreGatewayProtocolConfigurationArgs
{
Mcp = new Aws.Bedrock.Inputs.AgentcoreGatewayProtocolConfigurationMcpArgs
{
Instructions = "Gateway for handling MCP requests",
SearchType = "HYBRID",
SupportedVersions = new[]
{
"2025-03-26",
"2025-06-18",
},
},
},
Name = "mcp-gateway",
Description = "Gateway for MCP communication",
RoleArn = exampleAwsIamRole.Arn,
AuthorizerType = "CUSTOM_JWT",
ProtocolType = "MCP",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/bedrock"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := bedrock.NewAgentcoreGateway(ctx, "example", &bedrock.AgentcoreGatewayArgs{
AuthorizerConfiguration: &bedrock.AgentcoreGatewayAuthorizerConfigurationArgs{
CustomJwtAuthorizer: &bedrock.AgentcoreGatewayAuthorizerConfigurationCustomJwtAuthorizerArgs{
DiscoveryUrl: pulumi.String("https://auth.example.com/.well-known/openid-configuration"),
AllowedAudiences: pulumi.StringArray{
pulumi.String("app-client"),
pulumi.String("web-client"),
},
AllowedClients: pulumi.StringArray{
pulumi.String("client-123"),
pulumi.String("client-456"),
},
AllowedScopes: pulumi.StringArray{
pulumi.String("openid"),
pulumi.String("email"),
},
},
},
ProtocolConfiguration: &bedrock.AgentcoreGatewayProtocolConfigurationArgs{
Mcp: &bedrock.AgentcoreGatewayProtocolConfigurationMcpArgs{
Instructions: pulumi.String("Gateway for handling MCP requests"),
SearchType: pulumi.String("HYBRID"),
SupportedVersions: pulumi.StringArray{
pulumi.String("2025-03-26"),
pulumi.String("2025-06-18"),
},
},
},
Name: pulumi.String("mcp-gateway"),
Description: pulumi.String("Gateway for MCP communication"),
RoleArn: pulumi.Any(exampleAwsIamRole.Arn),
AuthorizerType: pulumi.String("CUSTOM_JWT"),
ProtocolType: pulumi.String("MCP"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_bedrock_agentcoregateway" "example" {
authorizer_configuration = {
custom_jwt_authorizer = {
discovery_url = "https://auth.example.com/.well-known/openid-configuration"
allowed_audiences = ["app-client", "web-client"]
allowed_clients = ["client-123", "client-456"]
allowed_scopes = ["openid", "email"]
}
}
protocol_configuration = {
mcp = {
instructions = "Gateway for handling MCP requests"
search_type = "HYBRID"
supported_versions = ["2025-03-26", "2025-06-18"]
}
}
name = "mcp-gateway"
description = "Gateway for MCP communication"
role_arn = exampleAwsIamRole.arn
authorizer_type = "CUSTOM_JWT"
protocol_type = "MCP"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.bedrock.AgentcoreGateway;
import com.pulumi.aws.bedrock.AgentcoreGatewayArgs;
import com.pulumi.aws.bedrock.inputs.AgentcoreGatewayAuthorizerConfigurationArgs;
import com.pulumi.aws.bedrock.inputs.AgentcoreGatewayAuthorizerConfigurationCustomJwtAuthorizerArgs;
import com.pulumi.aws.bedrock.inputs.AgentcoreGatewayProtocolConfigurationArgs;
import com.pulumi.aws.bedrock.inputs.AgentcoreGatewayProtocolConfigurationMcpArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new AgentcoreGateway("example", AgentcoreGatewayArgs.builder()
.authorizerConfiguration(AgentcoreGatewayAuthorizerConfigurationArgs.builder()
.customJwtAuthorizer(AgentcoreGatewayAuthorizerConfigurationCustomJwtAuthorizerArgs.builder()
.discoveryUrl("https://auth.example.com/.well-known/openid-configuration")
.allowedAudiences(
"app-client",
"web-client")
.allowedClients(
"client-123",
"client-456")
.allowedScopes(
"openid",
"email")
.build())
.build())
.protocolConfiguration(AgentcoreGatewayProtocolConfigurationArgs.builder()
.mcp(AgentcoreGatewayProtocolConfigurationMcpArgs.builder()
.instructions("Gateway for handling MCP requests")
.searchType("HYBRID")
.supportedVersions(
"2025-03-26",
"2025-06-18")
.build())
.build())
.name("mcp-gateway")
.description("Gateway for MCP communication")
.roleArn(exampleAwsIamRole.arn())
.authorizerType("CUSTOM_JWT")
.protocolType("MCP")
.build());
}
}
resources:
example:
type: aws:bedrock:AgentcoreGateway
properties:
authorizerConfiguration:
customJwtAuthorizer:
discoveryUrl: https://auth.example.com/.well-known/openid-configuration
allowedAudiences:
- app-client
- web-client
allowedClients:
- client-123
- client-456
allowedScopes:
- openid
- email
protocolConfiguration:
mcp:
instructions: Gateway for handling MCP requests
searchType: HYBRID
supportedVersions:
- 2025-03-26
- 2025-06-18
name: mcp-gateway
description: Gateway for MCP communication
roleArn: ${exampleAwsIamRole.arn}
authorizerType: CUSTOM_JWT
protocolType: MCP
Gateway with Interceptor Configuration
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const interceptor = new aws.lambda.Function("interceptor", {
code: new pulumi.asset.FileArchive("interceptor.zip"),
name: "gateway-interceptor",
role: lambda.arn,
handler: "index.handler",
runtime: aws.lambda.Runtime.Python3d12,
});
const example = new aws.bedrock.AgentcoreGateway("example", {
interceptorConfigurations: [{
interceptor: {
lambda: {
arn: interceptor.arn,
},
},
inputConfiguration: {
passRequestHeaders: true,
},
interceptionPoints: [
"REQUEST",
"RESPONSE",
],
}],
name: "gateway-with-interceptor",
roleArn: exampleAwsIamRole.arn,
authorizerType: "AWS_IAM",
protocolType: "MCP",
});
import pulumi
import pulumi_aws as aws
interceptor = aws.lambda_.Function("interceptor",
code=pulumi.FileArchive("interceptor.zip"),
name="gateway-interceptor",
role=lambda_["arn"],
handler="index.handler",
runtime=aws.lambda_.Runtime.PYTHON3D12)
example = aws.bedrock.AgentcoreGateway("example",
interceptor_configurations=[{
"interceptor": {
"lambda_": {
"arn": interceptor.arn,
},
},
"input_configuration": {
"pass_request_headers": True,
},
"interception_points": [
"REQUEST",
"RESPONSE",
],
}],
name="gateway-with-interceptor",
role_arn=example_aws_iam_role["arn"],
authorizer_type="AWS_IAM",
protocol_type="MCP")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var interceptor = new Aws.Lambda.Function("interceptor", new()
{
Code = new FileArchive("interceptor.zip"),
Name = "gateway-interceptor",
Role = lambda.Arn,
Handler = "index.handler",
Runtime = Aws.Lambda.Runtime.Python3d12,
});
var example = new Aws.Bedrock.AgentcoreGateway("example", new()
{
InterceptorConfigurations = new[]
{
new Aws.Bedrock.Inputs.AgentcoreGatewayInterceptorConfigurationArgs
{
Interceptor = new Aws.Bedrock.Inputs.AgentcoreGatewayInterceptorConfigurationInterceptorArgs
{
Lambda = new Aws.Bedrock.Inputs.AgentcoreGatewayInterceptorConfigurationInterceptorLambdaArgs
{
Arn = interceptor.Arn,
},
},
InputConfiguration = new Aws.Bedrock.Inputs.AgentcoreGatewayInterceptorConfigurationInputConfigurationArgs
{
PassRequestHeaders = true,
},
InterceptionPoints = new[]
{
"REQUEST",
"RESPONSE",
},
},
},
Name = "gateway-with-interceptor",
RoleArn = exampleAwsIamRole.Arn,
AuthorizerType = "AWS_IAM",
ProtocolType = "MCP",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/bedrock"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/lambda"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
interceptor, err := lambda.NewFunction(ctx, "interceptor", &lambda.FunctionArgs{
Code: pulumi.NewFileArchive("interceptor.zip"),
Name: pulumi.String("gateway-interceptor"),
Role: pulumi.Any(lambda.Arn),
Handler: pulumi.String("index.handler"),
Runtime: pulumi.String(lambda.RuntimePython3d12),
})
if err != nil {
return err
}
_, err = bedrock.NewAgentcoreGateway(ctx, "example", &bedrock.AgentcoreGatewayArgs{
InterceptorConfigurations: bedrock.AgentcoreGatewayInterceptorConfigurationArray{
&bedrock.AgentcoreGatewayInterceptorConfigurationArgs{
Interceptor: &bedrock.AgentcoreGatewayInterceptorConfigurationInterceptorArgs{
Lambda: &bedrock.AgentcoreGatewayInterceptorConfigurationInterceptorLambdaArgs{
Arn: interceptor.Arn,
},
},
InputConfiguration: &bedrock.AgentcoreGatewayInterceptorConfigurationInputConfigurationArgs{
PassRequestHeaders: pulumi.Bool(true),
},
InterceptionPoints: pulumi.StringArray{
pulumi.String("REQUEST"),
pulumi.String("RESPONSE"),
},
},
},
Name: pulumi.String("gateway-with-interceptor"),
RoleArn: pulumi.Any(exampleAwsIamRole.Arn),
AuthorizerType: pulumi.String("AWS_IAM"),
ProtocolType: pulumi.String("MCP"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_lambda_function" "interceptor" {
code = fileArchive("interceptor.zip")
name = "gateway-interceptor"
role = lambda.arn
handler = "index.handler"
runtime = "python3.12"
}
resource "aws_bedrock_agentcoregateway" "example" {
interceptor_configurations {
interceptor = {
lambda = {
arn = aws_lambda_function.interceptor.arn
}
}
input_configuration = {
pass_request_headers = true
}
interception_points = ["REQUEST", "RESPONSE"]
}
name = "gateway-with-interceptor"
role_arn = exampleAwsIamRole.arn
authorizer_type = "AWS_IAM"
protocol_type = "MCP"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lambda.Function;
import com.pulumi.aws.lambda.FunctionArgs;
import com.pulumi.aws.bedrock.AgentcoreGateway;
import com.pulumi.aws.bedrock.AgentcoreGatewayArgs;
import com.pulumi.aws.bedrock.inputs.AgentcoreGatewayInterceptorConfigurationArgs;
import com.pulumi.aws.bedrock.inputs.AgentcoreGatewayInterceptorConfigurationInterceptorArgs;
import com.pulumi.aws.bedrock.inputs.AgentcoreGatewayInterceptorConfigurationInterceptorLambdaArgs;
import com.pulumi.aws.bedrock.inputs.AgentcoreGatewayInterceptorConfigurationInputConfigurationArgs;
import com.pulumi.asset.FileArchive;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var interceptor = new Function("interceptor", FunctionArgs.builder()
.code(new FileArchive("interceptor.zip"))
.name("gateway-interceptor")
.role(lambda.arn())
.handler("index.handler")
.runtime("python3.12")
.build());
var example = new AgentcoreGateway("example", AgentcoreGatewayArgs.builder()
.interceptorConfigurations(AgentcoreGatewayInterceptorConfigurationArgs.builder()
.interceptor(AgentcoreGatewayInterceptorConfigurationInterceptorArgs.builder()
.lambda(AgentcoreGatewayInterceptorConfigurationInterceptorLambdaArgs.builder()
.arn(interceptor.arn())
.build())
.build())
.inputConfiguration(AgentcoreGatewayInterceptorConfigurationInputConfigurationArgs.builder()
.passRequestHeaders(true)
.build())
.interceptionPoints(
"REQUEST",
"RESPONSE")
.build())
.name("gateway-with-interceptor")
.roleArn(exampleAwsIamRole.arn())
.authorizerType("AWS_IAM")
.protocolType("MCP")
.build());
}
}
resources:
interceptor:
type: aws:lambda:Function
properties:
code:
fn::fileArchive: interceptor.zip
name: gateway-interceptor
role: ${lambda.arn}
handler: index.handler
runtime: python3.12
example:
type: aws:bedrock:AgentcoreGateway
properties:
interceptorConfigurations:
- interceptor:
lambda:
arn: ${interceptor.arn}
inputConfiguration:
passRequestHeaders: true
interceptionPoints:
- REQUEST
- RESPONSE
name: gateway-with-interceptor
roleArn: ${exampleAwsIamRole.arn}
authorizerType: AWS_IAM
protocolType: MCP
Import
Using pulumi import, import Bedrock AgentCore Gateway using the gateway ID. For example:
$ pulumi import aws:bedrock/agentcoreGateway:AgentcoreGateway example GATEWAY1234567890
Constructors
- AgentcoreGateway(String name, {AgentcoreGatewayArgs? args, CustomResourceOptions? options})
-
Creates a new AgentcoreGateway.
nameThe Pulumi resource name.argsArguments used to configure this AgentcoreGateway. The set of arguments for AgentcoreGateway.optionsResource options controlling this resource's behavior. - AgentcoreGateway.reference(String urn)
- Creates a typed reference to an existing AgentcoreGateway resource.
Properties
-
Configuration for request authorization. Required when
authorizerTypeis set toCUSTOM_JWT. SeeauthorizerConfigurationbelow.latefinal -
Type of authorizer to use. Valid values:
CUSTOM_JWT,AWS_IAM. When set toCUSTOM_JWT,authorizerConfigurationblock is required.latefinal -
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
description
↔ Output<
String?> -
Description of the gateway.
latefinal
-
exceptionLevel
↔ Output<
String?> -
Exception level for the gateway. Valid values:
DEBUG.latefinal -
gatewayArn
↔ Output<
String> -
ARN of the Gateway.
latefinal
-
gatewayId
↔ Output<
String> -
Unique identifier of the Gateway.
latefinal
-
gatewayUrl
↔ Output<
String> -
URL endpoint for the gateway.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
-
interceptorConfigurations
↔ Output<
List< AgentcoreGatewayInterceptorConfiguration> ?> -
List of interceptor configurations for the gateway. Minimum of 1, maximum of 2. See
interceptorConfigurationbelow.latefinal - isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
kmsKeyArn
↔ Output<
String?> -
ARN of the KMS key used to encrypt the gateway data.
latefinal
-
name
↔ Output<
String> -
Name of the gateway.
latefinal
-
policyEngineConfiguration
↔ Output<
AgentcoreGatewayPolicyEngineConfiguration?> -
Configuration for a policy engine associated with the gateway. A policy engine is a collection of policies that evaluates and authorizes agent tool calls. When associated with a gateway, the policy engine intercepts all agent requests and determines whether to allow or deny each action based on the defined policies. See
policyEngineConfigurationbelow.latefinal -
protocolConfiguration
↔ Output<
AgentcoreGatewayProtocolConfiguration?> -
Protocol-specific configuration for the gateway. See
protocolConfigurationbelow.latefinal -
protocolType
↔ Output<
String> -
Protocol type for the gateway. Valid values:
MCP. Omit this argument to create a gateway that routes traffic directly to HTTP targets such as AgentCore Runtime agents (seeaws.bedrock.AgentcoreGatewayTargettarget_configuration.http).latefinal -
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
-
roleArn
↔ Output<
String> -
ARN of the IAM role that the gateway assumes to access AWS services.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Key-value map of resource tags. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
A map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block.latefinal -
timeouts
↔ Output<
AgentcoreGatewayTimeouts?> -
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
-
workloadIdentityDetails
↔ Output<
List< AgentcoreGatewayWorkloadIdentityDetail> > -
Workload identity details for the gateway. See
workloadIdentityDetailsbelow.latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {AgentcoreGatewayState? state, CustomResourceOptions? options}) → AgentcoreGateway -
Gets an existing AgentcoreGateway resource's state with the given
nameandid.