@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.318Z") @Stability(value=Stable) public interface ApiGatewayProps extends software.amazon.jsii.JsiiSerializable, TargetBaseProps
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 | Interface and Description |
|---|---|
static class |
ApiGatewayProps.Builder
A builder for
ApiGatewayProps |
static class |
ApiGatewayProps.Jsii$Proxy
An implementation for
ApiGatewayProps |
| Modifier and Type | Method and Description |
|---|---|
static ApiGatewayProps.Builder |
builder() |
default IRole |
getEventRole()
The role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered.
|
default Map<String,String> |
getHeaderParameters()
The headers to be set when requesting API.
|
default String |
getMethod()
The method for api resource invoked by the rule.
|
default String |
getPath()
The api resource invoked by the rule.
|
default List<String> |
getPathParameterValues()
The path parameter values to be used to populate to wildcards("*") of requesting api path.
|
default RuleTargetInput |
getPostBody()
This will be the post request body send to the API.
|
default Map<String,String> |
getQueryStringParameters()
The query parameters to be set when requesting API.
|
default String |
getStage()
The deploy stage of api gateway invoked by the rule.
|
getDeadLetterQueue, getMaxEventAge, getRetryAttempts@Stability(value=Stable) @Nullable default IRole getEventRole()
Default: - a new role will be created
@Stability(value=Stable) @Nullable default Map<String,String> getHeaderParameters()
Default: no header parameters
@Stability(value=Stable) @Nullable default String getMethod()
Default: '*' that treated as ANY
@Stability(value=Stable) @Nullable default String getPath()
We can use wildcards('*') to specify the path. In that case, an equal number of real values must be specified for pathParameterValues.
Default: '/'
@Stability(value=Stable) @Nullable default List<String> getPathParameterValues()
Default: no path parameters
@Stability(value=Stable) @Nullable default RuleTargetInput getPostBody()
Default: the entire EventBridge event
@Stability(value=Stable) @Nullable default Map<String,String> getQueryStringParameters()
Default: no querystring parameters
@Stability(value=Stable) @Nullable default String getStage()
Default: the value of deploymentStage.stageName of target api gateway.
@Stability(value=Stable) static ApiGatewayProps.Builder builder()
builder in interface TargetBasePropsApiGatewayProps.Builder of ApiGatewayPropsCopyright © 2022. All rights reserved.