RouteArgs

data class RouteArgs(val apiId: Output<String>? = null, val apiKeyRequired: Output<Boolean>? = null, val authorizationScopes: Output<List<String>>? = null, val authorizationType: Output<String>? = null, val authorizerId: Output<String>? = null, val modelSelectionExpression: Output<String>? = null, val operationName: Output<String>? = null, val requestModels: Output<Map<String, String>>? = null, val requestParameters: Output<List<RouteRequestParameterArgs>>? = null, val routeKey: Output<String>? = null, val routeResponseSelectionExpression: Output<String>? = null, val target: Output<String>? = null) : ConvertibleToJava<RouteArgs>

Manages an Amazon API Gateway Version 2 route. More information can be found in the Amazon API Gateway Developer Guide for WebSocket and HTTP APIs.

Example Usage

Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigatewayv2.Api;
import com.pulumi.aws.apigatewayv2.ApiArgs;
import com.pulumi.aws.apigatewayv2.Route;
import com.pulumi.aws.apigatewayv2.RouteArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleApi = new Api("exampleApi", ApiArgs.builder()
.protocolType("WEBSOCKET")
.routeSelectionExpression("$request.body.action")
.build());
var exampleRoute = new Route("exampleRoute", RouteArgs.builder()
.apiId(exampleApi.id())
.routeKey("$default")
.build());
}
}

HTTP Proxy Integration

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigatewayv2.Api;
import com.pulumi.aws.apigatewayv2.ApiArgs;
import com.pulumi.aws.apigatewayv2.Integration;
import com.pulumi.aws.apigatewayv2.IntegrationArgs;
import com.pulumi.aws.apigatewayv2.Route;
import com.pulumi.aws.apigatewayv2.RouteArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleApi = new Api("exampleApi", ApiArgs.builder()
.protocolType("HTTP")
.build());
var exampleIntegration = new Integration("exampleIntegration", IntegrationArgs.builder()
.apiId(exampleApi.id())
.integrationType("HTTP_PROXY")
.integrationMethod("ANY")
.integrationUri("https://example.com/{proxy}")
.build());
var exampleRoute = new Route("exampleRoute", RouteArgs.builder()
.apiId(exampleApi.id())
.routeKey("ANY /example/{proxy+}")
.target(exampleIntegration.id().applyValue(id -> String.format("integrations/%s", id)))
.build());
}
}

Import

aws_apigatewayv2_route can be imported by using the API identifier and route identifier, e.g.,

$ pulumi import aws:apigatewayv2/route:Route example aabbccddee/1122334

Constructors

Link copied to clipboard
constructor(apiId: Output<String>? = null, apiKeyRequired: Output<Boolean>? = null, authorizationScopes: Output<List<String>>? = null, authorizationType: Output<String>? = null, authorizerId: Output<String>? = null, modelSelectionExpression: Output<String>? = null, operationName: Output<String>? = null, requestModels: Output<Map<String, String>>? = null, requestParameters: Output<List<RouteRequestParameterArgs>>? = null, routeKey: Output<String>? = null, routeResponseSelectionExpression: Output<String>? = null, target: Output<String>? = null)

Properties

Link copied to clipboard
val apiId: Output<String>? = null

API identifier.

Link copied to clipboard
val apiKeyRequired: Output<Boolean>? = null

Boolean whether an API key is required for the route. Defaults to false. Supported only for WebSocket APIs.

Link copied to clipboard
val authorizationScopes: Output<List<String>>? = null

Authorization scopes supported by this route. The scopes are used with a JWT authorizer to authorize the method invocation.

Link copied to clipboard
val authorizationType: Output<String>? = null

Authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer. For HTTP APIs, valid values are NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer. Defaults to NONE.

Link copied to clipboard
val authorizerId: Output<String>? = null

Identifier of the aws.apigatewayv2.Authorizer resource to be associated with this route.

Link copied to clipboard
val modelSelectionExpression: Output<String>? = null

The model selection expression for the route. Supported only for WebSocket APIs.

Link copied to clipboard
val operationName: Output<String>? = null

Operation name for the route. Must be between 1 and 64 characters in length.

Link copied to clipboard
val requestModels: Output<Map<String, String>>? = null

Request models for the route. Supported only for WebSocket APIs.

Link copied to clipboard

Request parameters for the route. Supported only for WebSocket APIs.

Link copied to clipboard
val routeKey: Output<String>? = null

Route key for the route. For HTTP APIs, the route key can be either $default, or a combination of an HTTP method and resource path, for example, GET /pets.

Link copied to clipboard

The route response selection expression for the route. Supported only for WebSocket APIs.

Link copied to clipboard
val target: Output<String>? = null

Target for the route, of the form integrations/IntegrationID, where IntegrationID is the identifier of an aws.apigatewayv2.Integration resource.

Functions

Link copied to clipboard
open override fun toJava(): RouteArgs