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);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:
- Api
Id string The API identifier.
- Route
Key string The route key for the route.
- Api
Key boolRequired Boolean whether an API key is required for the route. Defaults to
false.- List<string>
The authorization scopes supported by this route. The scopes are used with a JWT authorizer to authorize the method invocation.
- string
The authorization type for the route. For WebSocket APIs, valid values are
NONEfor open access,AWS_IAMfor using AWS IAM permissions, andCUSTOMfor using a Lambda authorizer. For HTTP APIs, valid values areNONEfor open access, orJWTfor using JSON Web Tokens. Defaults toNONE.- string
The identifier of the
aws.apigatewayv2.Authorizerresource to be associated with this route, if the authorizationType isCUSTOM.- Model
Selection stringExpression The model selection expression for the route.
- Operation
Name string The operation name for the route.
- Request
Models Dictionary<string, string> The request models for the route.
- Route
Response stringSelection Expression The route response selection expression for the route.
- Target string
The target for the route.
- Api
Id string The API identifier.
- Route
Key string The route key for the route.
- Api
Key boolRequired Boolean whether an API key is required for the route. Defaults to
false.- []string
The authorization scopes supported by this route. The scopes are used with a JWT authorizer to authorize the method invocation.
- string
The authorization type for the route. For WebSocket APIs, valid values are
NONEfor open access,AWS_IAMfor using AWS IAM permissions, andCUSTOMfor using a Lambda authorizer. For HTTP APIs, valid values areNONEfor open access, orJWTfor using JSON Web Tokens. Defaults toNONE.- string
The identifier of the
aws.apigatewayv2.Authorizerresource to be associated with this route, if the authorizationType isCUSTOM.- Model
Selection stringExpression The model selection expression for the route.
- Operation
Name string The operation name for the route.
- Request
Models map[string]string The request models for the route.
- Route
Response stringSelection Expression The route response selection expression for the route.
- Target string
The target for the route.
- api
Id string The API identifier.
- route
Key string The route key for the route.
- api
Key booleanRequired Boolean whether an API key is required for the route. Defaults to
false.- string[]
The authorization scopes supported by this route. The scopes are used with a JWT authorizer to authorize the method invocation.
- string
The authorization type for the route. For WebSocket APIs, valid values are
NONEfor open access,AWS_IAMfor using AWS IAM permissions, andCUSTOMfor using a Lambda authorizer. For HTTP APIs, valid values areNONEfor open access, orJWTfor using JSON Web Tokens. Defaults toNONE.- string
The identifier of the
aws.apigatewayv2.Authorizerresource to be associated with this route, if the authorizationType isCUSTOM.- model
Selection stringExpression The model selection expression for the route.
- operation
Name string The operation name for the route.
- request
Models {[key: string]: string} The request models for the route.
- route
Response stringSelection Expression 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_ boolrequired Boolean whether an API key is required for the route. Defaults to
false.- List[str]
The authorization scopes supported by this route. The scopes are used with a JWT authorizer to authorize the method invocation.
- str
The authorization type for the route. For WebSocket APIs, valid values are
NONEfor open access,AWS_IAMfor using AWS IAM permissions, andCUSTOMfor using a Lambda authorizer. For HTTP APIs, valid values areNONEfor open access, orJWTfor using JSON Web Tokens. Defaults toNONE.- str
The identifier of the
aws.apigatewayv2.Authorizerresource to be associated with this route, if the authorizationType isCUSTOM.- model_
selection_ strexpression 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_ strselection_ expression 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:
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): Routestatic 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:
- Api
Id string The API identifier.
- Api
Key boolRequired Boolean whether an API key is required for the route. Defaults to
false.- List<string>
The authorization scopes supported by this route. The scopes are used with a JWT authorizer to authorize the method invocation.
- string
The authorization type for the route. For WebSocket APIs, valid values are
NONEfor open access,AWS_IAMfor using AWS IAM permissions, andCUSTOMfor using a Lambda authorizer. For HTTP APIs, valid values areNONEfor open access, orJWTfor using JSON Web Tokens. Defaults toNONE.- string
The identifier of the
aws.apigatewayv2.Authorizerresource to be associated with this route, if the authorizationType isCUSTOM.- Model
Selection stringExpression The model selection expression for the route.
- Operation
Name string The operation name for the route.
- Request
Models Dictionary<string, string> The request models for the route.
- Route
Key string The route key for the route.
- Route
Response stringSelection Expression The route response selection expression for the route.
- Target string
The target for the route.
- Api
Id string The API identifier.
- Api
Key boolRequired Boolean whether an API key is required for the route. Defaults to
false.- []string
The authorization scopes supported by this route. The scopes are used with a JWT authorizer to authorize the method invocation.
- string
The authorization type for the route. For WebSocket APIs, valid values are
NONEfor open access,AWS_IAMfor using AWS IAM permissions, andCUSTOMfor using a Lambda authorizer. For HTTP APIs, valid values areNONEfor open access, orJWTfor using JSON Web Tokens. Defaults toNONE.- string
The identifier of the
aws.apigatewayv2.Authorizerresource to be associated with this route, if the authorizationType isCUSTOM.- Model
Selection stringExpression The model selection expression for the route.
- Operation
Name string The operation name for the route.
- Request
Models map[string]string The request models for the route.
- Route
Key string The route key for the route.
- Route
Response stringSelection Expression The route response selection expression for the route.
- Target string
The target for the route.
- api
Id string The API identifier.
- api
Key booleanRequired Boolean whether an API key is required for the route. Defaults to
false.- string[]
The authorization scopes supported by this route. The scopes are used with a JWT authorizer to authorize the method invocation.
- string
The authorization type for the route. For WebSocket APIs, valid values are
NONEfor open access,AWS_IAMfor using AWS IAM permissions, andCUSTOMfor using a Lambda authorizer. For HTTP APIs, valid values areNONEfor open access, orJWTfor using JSON Web Tokens. Defaults toNONE.- string
The identifier of the
aws.apigatewayv2.Authorizerresource to be associated with this route, if the authorizationType isCUSTOM.- model
Selection stringExpression The model selection expression for the route.
- operation
Name string The operation name for the route.
- request
Models {[key: string]: string} The request models for the route.
- route
Key string The route key for the route.
- route
Response stringSelection Expression The route response selection expression for the route.
- target string
The target for the route.
- api_
id str The API identifier.
- api_
key_ boolrequired Boolean whether an API key is required for the route. Defaults to
false.- List[str]
The authorization scopes supported by this route. The scopes are used with a JWT authorizer to authorize the method invocation.
- str
The authorization type for the route. For WebSocket APIs, valid values are
NONEfor open access,AWS_IAMfor using AWS IAM permissions, andCUSTOMfor using a Lambda authorizer. For HTTP APIs, valid values areNONEfor open access, orJWTfor using JSON Web Tokens. Defaults toNONE.- str
The identifier of the
aws.apigatewayv2.Authorizerresource to be associated with this route, if the authorizationType isCUSTOM.- model_
selection_ strexpression 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_ strselection_ expression 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
awsTerraform Provider.