Interface ApiGatewayProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
,TargetBaseProps
- All Known Implementing Classes:
ApiGatewayProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-12-17T21:37:31.504Z")
@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
Modifier and TypeInterfaceDescriptionstatic final class
A builder forApiGatewayProps
static final class
An implementation forApiGatewayProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic ApiGatewayProps.Builder
builder()
default IRole
The 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 String
The method for api resource invoked by the rule.default String
getPath()
The api resource invoked by the rule.The path parameter values to be used to populate to wildcards("*") of requesting api path.default RuleTargetInput
This will be the post request body send to the API.The query parameters to be set when requesting API.default String
getStage()
The deploy stage of api gateway invoked by the rule.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
Methods 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.Builder
ofApiGatewayProps
-