Class Gateway
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.bedrock.agentcore.alpha.GatewayBase
software.amazon.awscdk.services.bedrock.agentcore.alpha.Gateway
- All Implemented Interfaces:
IGatewayRef,IEnvironmentAware,IResource,IGateway,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)",
date="2026-08-13T16:20:32.892Z")
@Stability(Experimental)
public class Gateway
extends GatewayBase
(experimental) Gateway resource for AWS Bedrock Agent Core.
Serves as an integration point between your agent and external services.
Example:
// Create a Policy engine
PolicyEngine policyEngine = PolicyEngine.Builder.create(this, "MyPolicyEngine")
.policyEngineName("my_policy_engine")
.description("Policy engine for access control")
.build();
Gateway gateway = Gateway.Builder.create(this, "MyGateway")
.gatewayName("my-gateway")
.policyEngineConfiguration(GatewayPolicyEngineConfig.builder()
.policyEngine(policyEngine)
.mode(PolicyEngineMode.ENFORCE)
.build())
.build();
// Add policy to policy engine
policyEngine.addPolicy("AllowAllActions", AddPolicyOptions.builder()
.definition(String.format("%n permit(%n principal,%n action,%n resource == AgentCore::Gateway::\"%s\"%n );%n ", gateway.getGatewayArn()))
.description("Allow all actions on specific gateway (development)")
.validationMode(PolicyValidationMode.IGNORE_ALL_FINDINGS)
.build());
// you can add multiple policies to the policy engine
policyEngine.addPolicy("SpecificToolPolicy", AddPolicyOptions.builder()
.definition(String.format("%n permit(%n principal is AgentCore::OAuthUser,%n action == AgentCore::Action::\"WeatherTool__get_forecast\",%n resource == AgentCore::Gateway::\"%s\"%n );%n ", gateway.getGatewayArn()))
.description("Allow specific weather tool access")
.validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
.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.bedrock.agentcore.alpha.IGateway
IGateway.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
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) (experimental) Add an API Gateway target to this gateway This is a convenience method that creates a GatewayTarget associated with this gateway.voidaddInterceptor(IInterceptor interceptor) (experimental) Add an interceptor to this gateway.addLambdaTarget(String id, AddLambdaTargetOptions props) (experimental) 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) (experimental) 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) (experimental) 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) (experimental) 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) (experimental) Import an existing Gateway using its attributes.(experimental) The authorizer configuration for the gateway.(experimental) Timestamp when the gateway was created.(experimental) The description of the gateway.(experimental) The exception level for the gateway.(experimental) The ARN of the gateway.(experimental) The unique identifier of the gateway.(experimental) The URL endpoint for the gateway.(experimental) The KMS key used for encryption.getName()(experimental) The name of the gateway.(experimental) The OAuth2 scope strings for client credentials flow.(experimental) The policy engine configuration associated with this gateway.(experimental) The protocol configuration for the gateway.(experimental) The Cognito Resource Server created for the gateway (if using default Cognito authorizer).getRole()(experimental) The IAM role for the gateway.(experimental) The status of the gateway.(experimental) The status reasons for the gateway.getTags()(experimental) Tags applied to the gateway.(experimental) The OAuth2 token endpoint URL for client credentials flow.(experimental) Timestamp when the gateway was last updated.(experimental) The Cognito User Pool created for the gateway (if using default Cognito authorizer).(experimental) The Cognito User Pool Client created for the gateway (if using default Cognito authorizer).(experimental) The Cognito User Pool Domain created for the gateway (if using default Cognito authorizer).void(experimental) The Cognito Resource Server created for the gateway (if using default Cognito authorizer).voidsetUserPool(IUserPool value) (experimental) The Cognito User Pool created for the gateway (if using default Cognito authorizer).voidsetUserPoolClient(IUserPoolClient value) (experimental) The Cognito User Pool Client created for the gateway (if using default Cognito authorizer).voidsetUserPoolDomain(IUserPoolDomain value) (experimental) The Cognito User Pool Domain created for the gateway (if using default Cognito authorizer).Methods inherited from class software.amazon.awscdk.services.bedrock.agentcore.alpha.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
applyCrossStackReferenceStrength, 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
(experimental) 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(Experimental) 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(Experimental) 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(Experimental) @NotNull public static IGateway fromGatewayAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull GatewayAttributes attrs) (experimental) 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(Experimental) @NotNull public GatewayTarget addApiGatewayTarget(@NotNull String id, @NotNull AddApiGatewayTargetOptions props) (experimental) 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
(experimental) 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(Experimental) @NotNull public GatewayTarget addLambdaTarget(@NotNull String id, @NotNull AddLambdaTargetOptions props) (experimental) 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(Experimental) @NotNull public GatewayTarget addMcpServerTarget(@NotNull String id, @NotNull AddMcpServerTargetOptions props) (experimental) 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(Experimental) @NotNull public GatewayTarget addOpenApiTarget(@NotNull String id, @NotNull AddOpenApiTargetOptions props) (experimental) 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(Experimental) @NotNull public GatewayTarget addSmithyTarget(@NotNull String id, @NotNull AddSmithyTargetOptions props) (experimental) 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
(experimental) The authorizer configuration for the gateway.- Specified by:
getAuthorizerConfigurationin interfaceIGateway- Specified by:
getAuthorizerConfigurationin classGatewayBase
-
getGatewayArn
(experimental) The ARN of the gateway.- Specified by:
getGatewayArnin interfaceIGateway- Specified by:
getGatewayArnin classGatewayBase
-
getGatewayId
(experimental) The unique identifier of the gateway.- Specified by:
getGatewayIdin interfaceIGateway- Specified by:
getGatewayIdin classGatewayBase
-
getName
(experimental) The name of the gateway.- Specified by:
getNamein interfaceIGateway- Specified by:
getNamein classGatewayBase
-
getProtocolConfiguration
(experimental) The protocol configuration for the gateway.- Specified by:
getProtocolConfigurationin interfaceIGateway- Specified by:
getProtocolConfigurationin classGatewayBase
-
getRole
(experimental) The IAM role for the gateway.- Specified by:
getRolein interfaceIGateway- Specified by:
getRolein classGatewayBase
-
getCreatedAt
(experimental) Timestamp when the gateway was created.- Specified by:
getCreatedAtin interfaceIGateway- Specified by:
getCreatedAtin classGatewayBase
-
getDescription
(experimental) The description of the gateway.- Specified by:
getDescriptionin interfaceIGateway- Specified by:
getDescriptionin classGatewayBase
-
getExceptionLevel
(experimental) The exception level for the gateway.- Specified by:
getExceptionLevelin interfaceIGateway- Specified by:
getExceptionLevelin classGatewayBase
-
getGatewayUrl
(experimental) The URL endpoint for the gateway.- Specified by:
getGatewayUrlin interfaceIGateway- Specified by:
getGatewayUrlin classGatewayBase
-
getKmsKey
(experimental) The KMS key used for encryption.- Specified by:
getKmsKeyin interfaceIGateway- Specified by:
getKmsKeyin classGatewayBase
-
getOauthScopes
(experimental) The OAuth2 scope strings for client credentials flow.Only available when using the default Cognito authorizer.
-
getPolicyEngineConfiguration
(experimental) The policy engine configuration associated with this gateway. -
getStatus
(experimental) The status of the gateway.- Specified by:
getStatusin interfaceIGateway- Specified by:
getStatusin classGatewayBase
-
getStatusReason
(experimental) The status reasons for the gateway.- Specified by:
getStatusReasonin interfaceIGateway- Specified by:
getStatusReasonin classGatewayBase
-
getTags
(experimental) Tags applied to the gateway. -
getTokenEndpointUrl
(experimental) The OAuth2 token endpoint URL for client credentials flow.Only available when using the default Cognito authorizer.
-
getUpdatedAt
(experimental) Timestamp when the gateway was last updated.- Specified by:
getUpdatedAtin interfaceIGateway- Specified by:
getUpdatedAtin classGatewayBase
-
getResourceServer
(experimental) The Cognito Resource Server created for the gateway (if using default Cognito authorizer). -
setResourceServer
(experimental) The Cognito Resource Server created for the gateway (if using default Cognito authorizer). -
getUserPool
(experimental) The Cognito User Pool created for the gateway (if using default Cognito authorizer). -
setUserPool
(experimental) The Cognito User Pool created for the gateway (if using default Cognito authorizer). -
getUserPoolClient
(experimental) The Cognito User Pool Client created for the gateway (if using default Cognito authorizer). -
setUserPoolClient
(experimental) The Cognito User Pool Client created for the gateway (if using default Cognito authorizer). -
getUserPoolDomain
(experimental) The Cognito User Pool Domain created for the gateway (if using default Cognito authorizer). -
setUserPoolDomain
(experimental) The Cognito User Pool Domain created for the gateway (if using default Cognito authorizer).
-