java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
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:
  • Field Details

    • PROPERTY_INJECTION_ID

      @Stability(Stable) public static final String 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

      @Stability(Stable) public Gateway(@NotNull software.constructs.Construct scope, @NotNull String id)
      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

      @Stability(Stable) public void addInterceptor(@NotNull IInterceptor interceptor)
      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

      @Stability(Stable) @NotNull public IGatewayAuthorizerConfig getAuthorizerConfiguration()
      The authorizer configuration for the gateway.
      Specified by:
      getAuthorizerConfiguration in interface IGateway
      Specified by:
      getAuthorizerConfiguration in class GatewayBase
    • getGatewayArn

      @Stability(Stable) @NotNull public String getGatewayArn()
      The ARN of the gateway.
      Specified by:
      getGatewayArn in interface IGateway
      Specified by:
      getGatewayArn in class GatewayBase
    • getGatewayId

      @Stability(Stable) @NotNull public String getGatewayId()
      The unique identifier of the gateway.
      Specified by:
      getGatewayId in interface IGateway
      Specified by:
      getGatewayId in class GatewayBase
    • getGatewayName

      @Stability(Stable) @NotNull public String getGatewayName()
      The name of the gateway.
      Specified by:
      getGatewayName in interface IGateway
      Specified by:
      getGatewayName in class GatewayBase
    • getProtocolConfiguration

      @Stability(Stable) @NotNull public IGatewayProtocolConfig getProtocolConfiguration()
      The protocol configuration for the gateway.
      Specified by:
      getProtocolConfiguration in interface IGateway
      Specified by:
      getProtocolConfiguration in class GatewayBase
    • getRole

      @Stability(Stable) @NotNull public IRole getRole()
      The IAM role for the gateway.
      Specified by:
      getRole in interface IGateway
      Specified by:
      getRole in class GatewayBase
    • getCreatedAt

      @Stability(Stable) @Nullable public String getCreatedAt()
      Timestamp when the gateway was created.
      Specified by:
      getCreatedAt in interface IGateway
      Specified by:
      getCreatedAt in class GatewayBase
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the gateway.
      Specified by:
      getDescription in interface IGateway
      Specified by:
      getDescription in class GatewayBase
    • getExceptionLevel

      @Stability(Stable) @Nullable public GatewayExceptionLevel getExceptionLevel()
      The exception level for the gateway.
      Specified by:
      getExceptionLevel in interface IGateway
      Specified by:
      getExceptionLevel in class GatewayBase
    • getGatewayUrl

      @Stability(Stable) @Nullable public String getGatewayUrl()
      The URL endpoint for the gateway.
      Specified by:
      getGatewayUrl in interface IGateway
      Specified by:
      getGatewayUrl in class GatewayBase
    • getKmsKey

      @Stability(Stable) @Nullable public IKey getKmsKey()
      The KMS key used for encryption.
      Specified by:
      getKmsKey in interface IGateway
      Specified by:
      getKmsKey in class GatewayBase
    • getOauthScopes

      @Stability(Stable) @Nullable public List<String> getOauthScopes()
      The OAuth2 scope strings for client credentials flow.

      Only available when using the default Cognito authorizer.

    • getStatus

      @Stability(Stable) @Nullable public String getStatus()
      The status of the gateway.
      Specified by:
      getStatus in interface IGateway
      Specified by:
      getStatus in class GatewayBase
    • getStatusReason

      @Stability(Stable) @Nullable public List<String> getStatusReason()
      The status reasons for the gateway.
      Specified by:
      getStatusReason in interface IGateway
      Specified by:
      getStatusReason in class GatewayBase
    • getTags

      @Stability(Stable) @Nullable public Map<String,String> getTags()
      Tags applied to the gateway.
    • getTokenEndpointUrl

      @Stability(Stable) @Nullable public String getTokenEndpointUrl()
      The OAuth2 token endpoint URL for client credentials flow.

      Only available when using the default Cognito authorizer.

    • getUpdatedAt

      @Stability(Stable) @Nullable public String getUpdatedAt()
      Timestamp when the gateway was last updated.
      Specified by:
      getUpdatedAt in interface IGateway
      Specified by:
      getUpdatedAt in class GatewayBase
    • getResourceServer

      @Stability(Stable) @Nullable public IUserPoolResourceServer getResourceServer()
      The Cognito Resource Server created for the gateway (if using default Cognito authorizer).
    • setResourceServer

      @Stability(Stable) public void setResourceServer(@Nullable IUserPoolResourceServer value)
      The Cognito Resource Server created for the gateway (if using default Cognito authorizer).
    • getUserPool

      @Stability(Stable) @Nullable public IUserPool getUserPool()
      The Cognito User Pool created for the gateway (if using default Cognito authorizer).
    • setUserPool

      @Stability(Stable) public void setUserPool(@Nullable IUserPool value)
      The Cognito User Pool created for the gateway (if using default Cognito authorizer).
    • getUserPoolClient

      @Stability(Stable) @Nullable public IUserPoolClient getUserPoolClient()
      The Cognito User Pool Client created for the gateway (if using default Cognito authorizer).
    • setUserPoolClient

      @Stability(Stable) public void setUserPoolClient(@Nullable IUserPoolClient value)
      The Cognito User Pool Client created for the gateway (if using default Cognito authorizer).
    • getUserPoolDomain

      @Stability(Stable) @Nullable public IUserPoolDomain getUserPoolDomain()
      The Cognito User Pool Domain created for the gateway (if using default Cognito authorizer).
    • setUserPoolDomain

      @Stability(Stable) public void setUserPoolDomain(@Nullable IUserPoolDomain value)
      The Cognito User Pool Domain created for the gateway (if using default Cognito authorizer).