Class Gateway
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.bedrockagentcore.GatewayBase
software.amazon.awscdk.services.bedrockagentcore.Gateway
- All Implemented Interfaces:
IGatewayRef,IEnvironmentAware,IResource,IGateway,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.129.0 (build eaca441)",
date="2026-05-19T08:18:44.405Z")
@Stability(Stable)
public class Gateway
extends GatewayBase
Gateway resource for AWS Bedrock Agent Core.
Serves as an integration point between your agent and external services.
Example:
Gateway gateway = Gateway.Builder.create(this, "MyGateway")
.gatewayName("my-gateway")
.build();
Function lambdaFunction = Function.Builder.create(this, "MyFunction")
.runtime(Runtime.NODEJS_22_X)
.handler("index.handler")
.code(Code.fromInline("\n exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify({ message: 'Hello from Lambda!' })\n };\n };\n "))
.build();
// Create a gateway target with Lambda and tool schema
GatewayTarget target = GatewayTarget.forLambda(this, "MyLambdaTarget", GatewayTargetLambdaProps.builder()
.gatewayTargetName("my-lambda-target")
.description("Target for Lambda function integration")
.gateway(gateway)
.lambdaFunction(lambdaFunction)
.toolSchema(ToolSchema.fromLocalAsset(path.join(__dirname, "schemas", "my-tool-schema.json")))
.build());
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.bedrockagentcore.IGateway
IGateway.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedGateway(software.amazon.jsii.JsiiObjectRef objRef) Gateway(software.constructs.Construct scope, String id, GatewayProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddApiGatewayTarget(String id, AddApiGatewayTargetOptions props) Add an API Gateway target to this gateway This is a convenience method that creates a GatewayTarget associated with this gateway.voidaddInterceptor(IInterceptor interceptor) Add an interceptor to this gateway.addLambdaTarget(String id, AddLambdaTargetOptions props) Add a Lambda target to this gateway This is a convenience method that creates a GatewayTarget associated with this gateway.addMcpServerTarget(String id, AddMcpServerTargetOptions props) Add an MCP server target to this gateway This is a convenience method that creates a GatewayTarget associated with this gateway.addOpenApiTarget(String id, AddOpenApiTargetOptions props) Add an OpenAPI target to this gateway This is a convenience method that creates a GatewayTarget associated with this gateway.addSmithyTarget(String id, AddSmithyTargetOptions props) Add a Smithy target to this gateway This is a convenience method that creates a GatewayTarget associated with this gateway.static IGatewayfromGatewayAttributes(software.constructs.Construct scope, String id, GatewayAttributes attrs) Import an existing Gateway using its attributes.The authorizer configuration for the gateway.Timestamp when the gateway was created.The description of the gateway.The exception level for the gateway.The ARN of the gateway.The unique identifier of the gateway.The name of the gateway.The URL endpoint for the gateway.The KMS key used for encryption.The OAuth2 scope strings for client credentials flow.The protocol configuration for the gateway.The Cognito Resource Server created for the gateway (if using default Cognito authorizer).getRole()The IAM role for the gateway.The status of the gateway.The status reasons for the gateway.getTags()Tags applied to the gateway.The OAuth2 token endpoint URL for client credentials flow.Timestamp when the gateway was last updated.The Cognito User Pool created for the gateway (if using default Cognito authorizer).The Cognito User Pool Client created for the gateway (if using default Cognito authorizer).The Cognito User Pool Domain created for the gateway (if using default Cognito authorizer).voidThe Cognito Resource Server created for the gateway (if using default Cognito authorizer).voidsetUserPool(IUserPool value) The Cognito User Pool created for the gateway (if using default Cognito authorizer).voidsetUserPoolClient(IUserPoolClient value) The Cognito User Pool Client created for the gateway (if using default Cognito authorizer).voidsetUserPoolDomain(IUserPoolDomain value) The Cognito User Pool Domain created for the gateway (if using default Cognito authorizer).Methods inherited from class software.amazon.awscdk.services.bedrockagentcore.GatewayBase
getGatewayRef, grant, grantInvoke, grantManage, grantRead, metric, metric, metricDuration, metricDuration, metricInvocations, metricInvocations, metricLatency, metricLatency, metricSystemErrors, metricSystemErrors, metricTargetExecutionTime, metricTargetExecutionTime, metricTargetType, metricTargetType, metricThrottles, metricThrottles, metricUserErrors, metricUserErrorsMethods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource, withMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNode, withMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
Gateway
protected Gateway(software.amazon.jsii.JsiiObjectRef objRef) -
Gateway
protected Gateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Gateway
@Stability(Stable) public Gateway(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable GatewayProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
Gateway
- Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
fromGatewayAttributes
@Stability(Stable) @NotNull public static IGateway fromGatewayAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull GatewayAttributes attrs) Import an existing Gateway using its attributes.- Parameters:
scope- The construct scope. This parameter is required.id- The construct id. This parameter is required.attrs- The attributes of the existing Gateway. This parameter is required.- Returns:
- An IGateway instance representing the imported gateway
-
addApiGatewayTarget
@Stability(Stable) @NotNull public GatewayTarget addApiGatewayTarget(@NotNull String id, @NotNull AddApiGatewayTargetOptions props) Add an API Gateway target to this gateway This is a convenience method that creates a GatewayTarget associated with this gateway.- Parameters:
id- The construct id for the target. This parameter is required.props- Properties for the API Gateway target. This parameter is required.- Returns:
- The created GatewayTarget
- See Also:
-
addInterceptor
Add an interceptor to this gateway.Interceptors allow you to run custom code at specific points in the gateway request/response flow:
- REQUEST interceptors execute before the gateway calls the target
- RESPONSE interceptors execute after the target responds
A gateway can have at most one REQUEST interceptor and one RESPONSE interceptor.
- Parameters:
interceptor- The interceptor to add (use LambdaInterceptor factory methods). This parameter is required.
-
addLambdaTarget
@Stability(Stable) @NotNull public GatewayTarget addLambdaTarget(@NotNull String id, @NotNull AddLambdaTargetOptions props) Add a Lambda target to this gateway This is a convenience method that creates a GatewayTarget associated with this gateway.- Parameters:
id- The construct id for the target. This parameter is required.props- Properties for the Lambda target. This parameter is required.- Returns:
- The created GatewayTarget
-
addMcpServerTarget
@Stability(Stable) @NotNull public GatewayTarget addMcpServerTarget(@NotNull String id, @NotNull AddMcpServerTargetOptions props) Add an MCP server target to this gateway This is a convenience method that creates a GatewayTarget associated with this gateway.- Parameters:
id- The construct id for the target. This parameter is required.props- Properties for the MCP server target. This parameter is required.- Returns:
- The created GatewayTarget
- See Also:
-
addOpenApiTarget
@Stability(Stable) @NotNull public GatewayTarget addOpenApiTarget(@NotNull String id, @NotNull AddOpenApiTargetOptions props) Add an OpenAPI target to this gateway This is a convenience method that creates a GatewayTarget associated with this gateway.- Parameters:
id- The construct id for the target. This parameter is required.props- Properties for the OpenAPI target. This parameter is required.- Returns:
- The created GatewayTarget
-
addSmithyTarget
@Stability(Stable) @NotNull public GatewayTarget addSmithyTarget(@NotNull String id, @NotNull AddSmithyTargetOptions props) Add a Smithy target to this gateway This is a convenience method that creates a GatewayTarget associated with this gateway.- Parameters:
id- The construct id for the target. This parameter is required.props- Properties for the Smithy target. This parameter is required.- Returns:
- The created GatewayTarget
-
getAuthorizerConfiguration
The authorizer configuration for the gateway.- Specified by:
getAuthorizerConfigurationin interfaceIGateway- Specified by:
getAuthorizerConfigurationin classGatewayBase
-
getGatewayArn
The ARN of the gateway.- Specified by:
getGatewayArnin interfaceIGateway- Specified by:
getGatewayArnin classGatewayBase
-
getGatewayId
The unique identifier of the gateway.- Specified by:
getGatewayIdin interfaceIGateway- Specified by:
getGatewayIdin classGatewayBase
-
getGatewayName
The name of the gateway.- Specified by:
getGatewayNamein interfaceIGateway- Specified by:
getGatewayNamein classGatewayBase
-
getProtocolConfiguration
The protocol configuration for the gateway.- Specified by:
getProtocolConfigurationin interfaceIGateway- Specified by:
getProtocolConfigurationin classGatewayBase
-
getRole
The IAM role for the gateway.- Specified by:
getRolein interfaceIGateway- Specified by:
getRolein classGatewayBase
-
getCreatedAt
Timestamp when the gateway was created.- Specified by:
getCreatedAtin interfaceIGateway- Specified by:
getCreatedAtin classGatewayBase
-
getDescription
The description of the gateway.- Specified by:
getDescriptionin interfaceIGateway- Specified by:
getDescriptionin classGatewayBase
-
getExceptionLevel
The exception level for the gateway.- Specified by:
getExceptionLevelin interfaceIGateway- Specified by:
getExceptionLevelin classGatewayBase
-
getGatewayUrl
The URL endpoint for the gateway.- Specified by:
getGatewayUrlin interfaceIGateway- Specified by:
getGatewayUrlin classGatewayBase
-
getKmsKey
The KMS key used for encryption.- Specified by:
getKmsKeyin interfaceIGateway- Specified by:
getKmsKeyin classGatewayBase
-
getOauthScopes
The OAuth2 scope strings for client credentials flow.Only available when using the default Cognito authorizer.
-
getStatus
The status of the gateway.- Specified by:
getStatusin interfaceIGateway- Specified by:
getStatusin classGatewayBase
-
getStatusReason
The status reasons for the gateway.- Specified by:
getStatusReasonin interfaceIGateway- Specified by:
getStatusReasonin classGatewayBase
-
getTags
Tags applied to the gateway. -
getTokenEndpointUrl
The OAuth2 token endpoint URL for client credentials flow.Only available when using the default Cognito authorizer.
-
getUpdatedAt
Timestamp when the gateway was last updated.- Specified by:
getUpdatedAtin interfaceIGateway- Specified by:
getUpdatedAtin classGatewayBase
-
getResourceServer
The Cognito Resource Server created for the gateway (if using default Cognito authorizer). -
setResourceServer
The Cognito Resource Server created for the gateway (if using default Cognito authorizer). -
getUserPool
The Cognito User Pool created for the gateway (if using default Cognito authorizer). -
setUserPool
The Cognito User Pool created for the gateway (if using default Cognito authorizer). -
getUserPoolClient
The Cognito User Pool Client created for the gateway (if using default Cognito authorizer). -
setUserPoolClient
The Cognito User Pool Client created for the gateway (if using default Cognito authorizer). -
getUserPoolDomain
The Cognito User Pool Domain created for the gateway (if using default Cognito authorizer). -
setUserPoolDomain
The Cognito User Pool Domain created for the gateway (if using default Cognito authorizer).
-