@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)", date="2022-08-08T20:48:13.552Z") @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.InitializationMode
IRuleTarget.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, jsiiStaticSet
protected 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 IRuleTarget
rule
- This parameter is required._id
- @Stability(value=Stable) @NotNull public RuleTargetConfig bind(@NotNull IRule rule)
bind
in interface IRuleTarget
rule
- This parameter is required.@Stability(value=Stable) @NotNull public RestApi getRestApi()
Copyright © 2022. All rights reserved.