class GatewayAuthorizer
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.GatewayAuthorizer |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#GatewayAuthorizer |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.GatewayAuthorizer |
Python | aws_cdk.aws_bedrock_agentcore_alpha.GatewayAuthorizer |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป GatewayAuthorizer |
Factory class for creating Gateway Authorizers.
Example
// Create a KMS key for encryption
const encryptionKey = new kms.Key(this, "GatewayEncryptionKey", {
enableKeyRotation: true,
description: "KMS key for gateway encryption",
});
// Create gateway with KMS encryption
const gateway = new agentcore.Gateway(this, "MyGateway", {
gatewayName: "my-encrypted-gateway",
description: "Gateway with KMS encryption",
protocolConfiguration: new agentcore.McpProtocolConfiguration({
instructions: "Use this gateway to connect to external MCP tools",
searchType: agentcore.McpGatewaySearchType.SEMANTIC,
supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],
}),
authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({
discoveryUrl: "https://auth.example.com/.well-known/openid-configuration",
allowedAudience: ["my-app"],
allowedClients: ["my-client-id"],
}),
kmsKey: encryptionKey,
exceptionLevel: agentcore.GatewayExceptionLevel.DEBUG,
});
Initializer
new GatewayAuthorizer()
Methods
| Name | Description |
|---|---|
| static using | AWS IAM authorizer instance. |
| static using | Create a JWT authorizer from Cognito User Pool. |
| static using | Create a custom JWT authorizer. |
static usingAwsIam()
public static usingAwsIam(): IGatewayAuthorizerConfig
Returns
AWS IAM authorizer instance.
static usingCognito(props)
public static usingCognito(props: CognitoAuthorizerProps): IGatewayAuthorizerConfig
Parameters
- props
Cognitoโ - The Cognito configuration.Authorizer Props
Returns
Create a JWT authorizer from Cognito User Pool.
static usingCustomJwt(configuration)
public static usingCustomJwt(configuration: CustomJwtConfiguration): IGatewayAuthorizerConfig
Parameters
- configuration
Customโ - The JWT configuration.Jwt Configuration
Returns
Create a custom JWT authorizer.

.NET
Go
Java
Python
TypeScript (