Class ApiGateway
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.events.targets.ApiGateway
- All Implemented Interfaces:
IRuleTarget,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:38.945Z")
@Stability(Stable)
public class ApiGateway
extends software.amazon.jsii.JsiiObject
implements IRuleTarget
Use an API Gateway REST APIs as a target for Amazon EventBridge rules.
Example:
import software.amazon.awscdk.services.apigateway.*;
import software.amazon.awscdk.services.lambda.*;
Rule rule = Rule.Builder.create(this, "Rule")
.schedule(Schedule.rate(Duration.minutes(1)))
.build();
Function fn = Function.Builder.create(this, "MyFunc")
.handler("index.handler")
.runtime(Runtime.NODEJS_LATEST)
.code(Code.fromInline("exports.handler = e => {}"))
.build();
LambdaRestApi restApi = LambdaRestApi.Builder.create(this, "MyRestAPI").handler(fn).build();
Queue dlq = new Queue(this, "DeadLetterQueue");
rule.addTarget(
ApiGateway.Builder.create(restApi)
.path("/*/test")
.method("GET")
.stage("prod")
.pathParameterValues(List.of("path-value"))
.headerParameters(Map.of(
"Header1", "header1"))
.queryStringParameters(Map.of(
"QueryParam1", "query-param-1"))
.deadLetterQueue(dlq)
.build());
-
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.amazon.awscdk.services.events.IRuleTarget
IRuleTarget.Jsii$Default, IRuleTarget.Jsii$Proxy -
Constructor Summary
ConstructorsModifierConstructorDescriptionApiGateway(IRestApi restApi) ApiGateway(IRestApi restApi, ApiGatewayProps props) protectedApiGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedApiGateway(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionReturns a RuleTarget that can be used to trigger this API Gateway REST APIs as a result from an EventBridge event.Returns a RuleTarget that can be used to trigger this API Gateway REST APIs as a result from an EventBridge event.Returns the target IRestApi.Deprecated.Methods 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, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ApiGateway
protected ApiGateway(software.amazon.jsii.JsiiObjectRef objRef) -
ApiGateway
protected ApiGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ApiGateway
- Parameters:
restApi-- IRestApi implementation to use as event target.
props-- Properties to configure the APIGateway target.
-
ApiGateway
- Parameters:
restApi-- IRestApi implementation to use as event target.
-
-
Method Details
-
bind
Returns a RuleTarget that can be used to trigger this API Gateway REST APIs as a result from an EventBridge event.- Specified by:
bindin interfaceIRuleTarget- Parameters:
rule- This parameter is required._id-- See Also:
-
bind
Returns a RuleTarget that can be used to trigger this API Gateway REST APIs as a result from an EventBridge event.- Specified by:
bindin interfaceIRuleTarget- Parameters:
rule- This parameter is required.- See Also:
-
getIRestApi
Returns the target IRestApi. -
getRestApi
Deprecated.Use theiRestApigetter instead
-
iRestApigetter instead