com.pulumi.aws.apigatewayv2.kotlin.RouteResponseArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.apigatewayv2.kotlin
import com.pulumi.aws.apigatewayv2.RouteResponseArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Manages an Amazon API Gateway Version 2 route response.
* More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html).
* ## Example Usage
* ### Basic
*
* ```typescript
* 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",
* });
* ```
* ```python
* 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")
* ```
* ```csharp
* 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",
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html).
* 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](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-integration-responses.html#apigateway-websocket-api-integration-response-overview).
* ## Import
* Using `pulumi import`, import `aws_apigatewayv2_route_response` using the API identifier, route identifier and route response identifier. For example:
* ```sh
* $ pulumi import aws:apigatewayv2/routeResponse:RouteResponse example aabbccddee/1122334/998877
* ```
* @property apiId API identifier.
* @property modelSelectionExpression The [model selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-model-selection-expressions) for the route response.
* @property responseModels Response models for the route response.
* @property routeId Identifier of the `aws.apigatewayv2.Route`.
* @property routeResponseKey Route response key.
*/
public data class RouteResponseArgs(
public val apiId: Output? = null,
public val modelSelectionExpression: Output? = null,
public val responseModels: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy