@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.318Z") @Stability(value=Stable) public class ApiGateway extends software.amazon.jsii.JsiiObject implements IRuleTarget
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_14_X)
.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());
| Modifier and Type | Class and Description |
|---|---|
static class |
ApiGateway.Builder
A fluent builder for
ApiGateway. |
software.amazon.jsii.JsiiObject.InitializationModeIRuleTarget.Jsii$Default, IRuleTarget.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
protected |
ApiGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
ApiGateway(software.amazon.jsii.JsiiObjectRef objRef) |
|
ApiGateway(RestApi restApi) |
|
ApiGateway(RestApi restApi,
ApiGatewayProps props) |
| Modifier and Type | Method and Description |
|---|---|
RuleTargetConfig |
bind(IRule rule)
Returns a RuleTarget that can be used to trigger this API Gateway REST APIs as a result from an EventBridge event.
|
RuleTargetConfig |
bind(IRule rule,
String _id)
Returns a RuleTarget that can be used to trigger this API Gateway REST APIs as a result from an EventBridge event.
|
RestApi |
getRestApi() |
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected ApiGateway(software.amazon.jsii.JsiiObjectRef objRef)
protected ApiGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public ApiGateway(@NotNull
RestApi restApi,
@Nullable
ApiGatewayProps props)
restApi - This parameter is required.props - @Stability(value=Stable)
public ApiGateway(@NotNull
RestApi restApi)
restApi - This parameter is required.@Stability(value=Stable) @NotNull public RuleTargetConfig bind(@NotNull IRule rule, @Nullable String _id)
bind in interface IRuleTargetrule - This parameter is required._id - @Stability(value=Stable) @NotNull public RuleTargetConfig bind(@NotNull IRule rule)
bind in interface IRuleTargetrule - This parameter is required.@Stability(value=Stable) @NotNull public RestApi getRestApi()
Copyright © 2022. All rights reserved.