Interface ApiGatewayProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable,TargetBaseProps
- All Known Implementing Classes:
ApiGatewayProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-17T14:40:52.681Z")
@Stability(Stable)
public interface ApiGatewayProps
extends software.amazon.jsii.JsiiSerializable, TargetBaseProps
Customize the API Gateway Event Target.
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 ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forApiGatewayPropsstatic final classAn implementation forApiGatewayProps -
Method Summary
Modifier and TypeMethodDescriptionstatic ApiGatewayProps.Builderbuilder()default IRoleThe role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered.The headers to be set when requesting API.default StringThe method for api resource invoked by the rule.default StringgetPath()The api resource invoked by the rule.The path parameter values to be used to populate to wildcards("*") of requesting api path.default RuleTargetInputThis will be the post request body send to the API.The query parameters to be set when requesting API.default StringgetStage()The deploy stage of api gateway invoked by the rule.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJsonMethods inherited from interface software.amazon.awscdk.services.events.targets.TargetBaseProps
getDeadLetterQueue, getMaxEventAge, getRetryAttempts
-
Method Details
-
getEventRole
The role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered.Default: - a new role will be created
-
getHeaderParameters
The headers to be set when requesting API.Default: no header parameters
-
getMethod
The method for api resource invoked by the rule.Default: '*' that treated as ANY
-
getPath
The api resource invoked by the rule.We can use wildcards('*') to specify the path. In that case, an equal number of real values must be specified for pathParameterValues.
Default: '/'
-
getPathParameterValues
The path parameter values to be used to populate to wildcards("*") of requesting api path.Default: no path parameters
-
getPostBody
This will be the post request body send to the API.Default: the entire EventBridge event
-
getQueryStringParameters
The query parameters to be set when requesting API.Default: no querystring parameters
-
getStage
The deploy stage of api gateway invoked by the rule.Default: the value of deploymentStage.stageName of target api gateway.
-
builder
- Returns:
- a
ApiGatewayProps.BuilderofApiGatewayProps
-