GatewayProps

class aws_cdk.aws_bedrock_agentcore_alpha.GatewayProps(*, gateway_name, authorizer_configuration=None, description=None, exception_level=None, kms_key=None, protocol_configuration=None, role=None, tags=None)

Bases: object

(experimental) Properties for defining a Gateway.

Parameters:
  • gateway_name (str) – (experimental) The name of the gateway Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen) The name must be unique within your account.

  • authorizer_configuration (Optional[IGatewayAuthorizerConfig]) – (experimental) The authorizer configuration for the gateway. Default: - A default authorizer will be created using Cognito

  • description (Optional[str]) – (experimental) Optional description for the gateway Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces The description can have up to 200 characters. Default: - No description

  • exception_level (Optional[GatewayExceptionLevel]) – (experimental) The verbosity of exception messages Use DEBUG mode to see granular exception messages from a Gateway. Default: - Exception messages are sanitized for presentation to end users

  • kms_key (Optional[IKey]) – (experimental) The AWS KMS key used to encrypt data associated with the gateway. Default: - No encryption

  • protocol_configuration (Optional[IGatewayProtocolConfig]) – (experimental) The protocol configuration for the gateway. Default: - A default protocol configuration will be created using MCP with following params supportedVersions: [MCPProtocolVersion.MCP_2025_03_26], searchType: McpGatewaySearchType.SEMANTIC, instructions: “Default gateway to connect to external MCP tools”,

  • role (Optional[IRole]) – (experimental) The IAM role that provides permissions for the gateway to access AWS services. Default: - A new role will be created

  • tags (Optional[Mapping[str, str]]) – (experimental) Tags for the gateway A list of key:value pairs of tags to apply to this Gateway resource. Default: - No tags

Stability:

experimental

ExampleMetadata:

fixture=default infused

Example:

gateway = agentcore.Gateway(self, "MyGateway",
    gateway_name="my-gateway"
)

lambda_function = lambda_.Function(self, "MyFunction",
    runtime=lambda_.Runtime.NODEJS_22_X,
    handler="index.handler",
    code=lambda_.Code.from_inline("""
                exports.handler = async (event) => {
                    return {
                        statusCode: 200,
                        body: JSON.stringify({ message: 'Hello from Lambda!' })
                    };
                };
            """)
)

# Create a gateway target with Lambda and tool schema
target = agentcore.GatewayTarget.for_lambda(self, "MyLambdaTarget",
    gateway_target_name="my-lambda-target",
    description="Target for Lambda function integration",
    gateway=gateway,
    lambda_function=lambda_function,
    tool_schema=agentcore.ToolSchema.from_local_asset(
        path.join(__dirname, "schemas", "my-tool-schema.json"))
)

Attributes

authorizer_configuration

(experimental) The authorizer configuration for the gateway.

Default:
  • A default authorizer will be created using Cognito

Stability:

experimental

description

(experimental) Optional description for the gateway Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces The description can have up to 200 characters.

Default:
  • No description

Stability:

experimental

exception_level

(experimental) The verbosity of exception messages Use DEBUG mode to see granular exception messages from a Gateway.

Default:
  • Exception messages are sanitized for presentation to end users

Stability:

experimental

gateway_name

(experimental) The name of the gateway Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen) The name must be unique within your account.

Stability:

experimental

kms_key

(experimental) The AWS KMS key used to encrypt data associated with the gateway.

Default:
  • No encryption

Stability:

experimental

protocol_configuration

(experimental) The protocol configuration for the gateway.

Default:

  • A default protocol configuration will be created using MCP with following params

supportedVersions: [MCPProtocolVersion.MCP_2025_03_26], searchType: McpGatewaySearchType.SEMANTIC, instructions: “Default gateway to connect to external MCP tools”,

Stability:

experimental

role

(experimental) The IAM role that provides permissions for the gateway to access AWS services.

Default:
  • A new role will be created

Stability:

experimental

tags

value pairs of tags to apply to this Gateway resource.

Default:
  • No tags

Stability:

experimental

Type:

(experimental) Tags for the gateway A list of key