Route

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

Example Usage

Basic

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.ApiGatewayV2.Route("example", new Aws.ApiGatewayV2.RouteArgs
        {
            ApiId = aws_apigatewayv2_api.Example.Id,
            RouteKey = "$default",
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/apigatewayv2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := apigatewayv2.NewRoute(ctx, "example", &apigatewayv2.RouteArgs{
            ApiId:    pulumi.String(aws_apigatewayv2_api.Example.Id),
            RouteKey: pulumi.String(fmt.Sprintf("%v%v", "$", "default")),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.apigatewayv2.Route("example",
    api_id=aws_apigatewayv2_api["example"]["id"],
    route_key="$default")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.apigatewayv2.Route("example", {
    apiId: aws_apigatewayv2_api_example.id,
    routeKey: "$default",
});

Create a Route Resource

new Route(name: string, args: RouteArgs, opts?: CustomResourceOptions);
def Route(resource_name, opts=None, api_id=None, api_key_required=None, authorization_scopes=None, authorization_type=None, authorizer_id=None, model_selection_expression=None, operation_name=None, request_models=None, route_key=None, route_response_selection_expression=None, target=None, __props__=None);
func NewRoute(ctx *Context, name string, args RouteArgs, opts ...ResourceOption) (*Route, error)
public Route(string name, RouteArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RouteArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args RouteArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RouteArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Route Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Route resource accepts the following input properties:

ApiId string

The API identifier.

RouteKey string

The route key for the route.

ApiKeyRequired bool

Boolean whether an API key is required for the route. Defaults to false.

AuthorizationScopes List<string>

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

AuthorizationType string

The 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, or JWT for using JSON Web Tokens. Defaults to NONE.

AuthorizerId string

The identifier of the aws.apigatewayv2.Authorizer resource to be associated with this route, if the authorizationType is CUSTOM.

ModelSelectionExpression string

The model selection expression for the route.

OperationName string

The operation name for the route.

RequestModels Dictionary<string, string>

The request models for the route.

RouteResponseSelectionExpression string

The route response selection expression for the route.

Target string

The target for the route.

ApiId string

The API identifier.

RouteKey string

The route key for the route.

ApiKeyRequired bool

Boolean whether an API key is required for the route. Defaults to false.

AuthorizationScopes []string

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

AuthorizationType string

The 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, or JWT for using JSON Web Tokens. Defaults to NONE.

AuthorizerId string

The identifier of the aws.apigatewayv2.Authorizer resource to be associated with this route, if the authorizationType is CUSTOM.

ModelSelectionExpression string

The model selection expression for the route.

OperationName string

The operation name for the route.

RequestModels map[string]string

The request models for the route.

RouteResponseSelectionExpression string

The route response selection expression for the route.

Target string

The target for the route.

apiId string

The API identifier.

routeKey string

The route key for the route.

apiKeyRequired boolean

Boolean whether an API key is required for the route. Defaults to false.

authorizationScopes string[]

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

authorizationType string

The 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, or JWT for using JSON Web Tokens. Defaults to NONE.

authorizerId string

The identifier of the aws.apigatewayv2.Authorizer resource to be associated with this route, if the authorizationType is CUSTOM.

modelSelectionExpression string

The model selection expression for the route.

operationName string

The operation name for the route.

requestModels {[key: string]: string}

The request models for the route.

routeResponseSelectionExpression string

The route response selection expression for the route.

target string

The target for the route.

api_id str

The API identifier.

route_key str

The route key for the route.

api_key_required bool

Boolean whether an API key is required for the route. Defaults to false.

authorization_scopes List[str]

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

authorization_type str

The 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, or JWT for using JSON Web Tokens. Defaults to NONE.

authorizer_id str

The identifier of the aws.apigatewayv2.Authorizer resource to be associated with this route, if the authorizationType is CUSTOM.

model_selection_expression str

The model selection expression for the route.

operation_name str

The operation name for the route.

request_models Dict[str, str]

The request models for the route.

route_response_selection_expression str

The route response selection expression for the route.

target str

The target for the route.

Outputs

All input properties are implicitly available as output properties. Additionally, the Route resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Route Resource

Get an existing Route resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RouteState, opts?: CustomResourceOptions): Route
static get(resource_name, id, opts=None, api_id=None, api_key_required=None, authorization_scopes=None, authorization_type=None, authorizer_id=None, model_selection_expression=None, operation_name=None, request_models=None, route_key=None, route_response_selection_expression=None, target=None, __props__=None);
func GetRoute(ctx *Context, name string, id IDInput, state *RouteState, opts ...ResourceOption) (*Route, error)
public static Route Get(string name, Input<string> id, RouteState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

ApiId string

The API identifier.

ApiKeyRequired bool

Boolean whether an API key is required for the route. Defaults to false.

AuthorizationScopes List<string>

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

AuthorizationType string

The 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, or JWT for using JSON Web Tokens. Defaults to NONE.

AuthorizerId string

The identifier of the aws.apigatewayv2.Authorizer resource to be associated with this route, if the authorizationType is CUSTOM.

ModelSelectionExpression string

The model selection expression for the route.

OperationName string

The operation name for the route.

RequestModels Dictionary<string, string>

The request models for the route.

RouteKey string

The route key for the route.

RouteResponseSelectionExpression string

The route response selection expression for the route.

Target string

The target for the route.

ApiId string

The API identifier.

ApiKeyRequired bool

Boolean whether an API key is required for the route. Defaults to false.

AuthorizationScopes []string

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

AuthorizationType string

The 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, or JWT for using JSON Web Tokens. Defaults to NONE.

AuthorizerId string

The identifier of the aws.apigatewayv2.Authorizer resource to be associated with this route, if the authorizationType is CUSTOM.

ModelSelectionExpression string

The model selection expression for the route.

OperationName string

The operation name for the route.

RequestModels map[string]string

The request models for the route.

RouteKey string

The route key for the route.

RouteResponseSelectionExpression string

The route response selection expression for the route.

Target string

The target for the route.

apiId string

The API identifier.

apiKeyRequired boolean

Boolean whether an API key is required for the route. Defaults to false.

authorizationScopes string[]

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

authorizationType string

The 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, or JWT for using JSON Web Tokens. Defaults to NONE.

authorizerId string

The identifier of the aws.apigatewayv2.Authorizer resource to be associated with this route, if the authorizationType is CUSTOM.

modelSelectionExpression string

The model selection expression for the route.

operationName string

The operation name for the route.

requestModels {[key: string]: string}

The request models for the route.

routeKey string

The route key for the route.

routeResponseSelectionExpression string

The route response selection expression for the route.

target string

The target for the route.

api_id str

The API identifier.

api_key_required bool

Boolean whether an API key is required for the route. Defaults to false.

authorization_scopes List[str]

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

authorization_type str

The 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, or JWT for using JSON Web Tokens. Defaults to NONE.

authorizer_id str

The identifier of the aws.apigatewayv2.Authorizer resource to be associated with this route, if the authorizationType is CUSTOM.

model_selection_expression str

The model selection expression for the route.

operation_name str

The operation name for the route.

request_models Dict[str, str]

The request models for the route.

route_key str

The route key for the route.

route_response_selection_expression str

The route response selection expression for the route.

target str

The target for the route.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.