RouteResponseArgs

data class RouteResponseArgs(val apiId: Output<String>? = null, val modelSelectionExpression: Output<String>? = null, val responseModels: Output<Map<String, String>>? = null, val routeId: Output<String>? = null, val routeResponseKey: Output<String>? = null) : ConvertibleToJava<RouteResponseArgs>

Manages an Amazon API Gateway Version 2 route response. More information can be found in the Amazon API Gateway Developer Guide.

Example Usage

Basic

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.apigatewayv2.RouteResponse("example", {
apiId: exampleAwsApigatewayv2Api.id,
routeId: exampleAwsApigatewayv2Route.id,
routeResponseKey: "$default",
});
import pulumi
import pulumi_aws as aws
example = aws.apigatewayv2.RouteResponse("example",
api_id=example_aws_apigatewayv2_api["id"],
route_id=example_aws_apigatewayv2_route["id"],
route_response_key="$default")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.ApiGatewayV2.RouteResponse("example", new()
{
ApiId = exampleAwsApigatewayv2Api.Id,
RouteId = exampleAwsApigatewayv2Route.Id,
RouteResponseKey = "$default",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apigatewayv2.NewRouteResponse(ctx, "example", &apigatewayv2.RouteResponseArgs{
ApiId: pulumi.Any(exampleAwsApigatewayv2Api.Id),
RouteId: pulumi.Any(exampleAwsApigatewayv2Route.Id),
RouteResponseKey: pulumi.String("$default"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigatewayv2.RouteResponse;
import com.pulumi.aws.apigatewayv2.RouteResponseArgs;
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 example = new RouteResponse("example", RouteResponseArgs.builder()
.apiId(exampleAwsApigatewayv2Api.id())
.routeId(exampleAwsApigatewayv2Route.id())
.routeResponseKey("$default")
.build());
}
}
resources:
example:
type: aws:apigatewayv2:RouteResponse
properties:
apiId: ${exampleAwsApigatewayv2Api.id}
routeId: ${exampleAwsApigatewayv2Route.id}
routeResponseKey: $default

Enabling Two-Way Communication

For websocket routes that require two-way communication enabled, an aws.apigatewayv2.RouteResponse needs to be added to the route with route_response_key = "$default". More information available is available in Amazon API Gateway Developer Guide. You can only define the $default route response for WebSocket APIs. You can use an integration response to manipulate the response from a backend service. For more information, see Overview of integration responses.

Import

Using pulumi import, import aws_apigatewayv2_route_response using the API identifier, route identifier and route response identifier. For example:

$ pulumi import aws:apigatewayv2/routeResponse:RouteResponse example aabbccddee/1122334/998877

Constructors

Link copied to clipboard
constructor(apiId: Output<String>? = null, modelSelectionExpression: Output<String>? = null, responseModels: Output<Map<String, String>>? = null, routeId: Output<String>? = null, routeResponseKey: Output<String>? = null)

Properties

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

API identifier.

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

The model selection expression for the route response.

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

Response models for the route response.

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

Identifier of the aws.apigatewayv2.Route.

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

Route response key.

Functions

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