import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages an Amazon API Gateway Version 2 route. * More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html) for [WebSocket](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-develop-routes.html) and [HTTP](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html) APIs. * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.apigatewayv2.Api("example", { * name: "example-websocket-api", * protocolType: "WEBSOCKET", * routeSelectionExpression: "$request.body.action", * }); * const exampleRoute = new aws.apigatewayv2.Route("example", { * apiId: example.id, * routeKey: "$default", * }); * ``` * * ### HTTP Proxy Integration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.apigatewayv2.Api("example", { * name: "example-http-api", * protocolType: "HTTP", * }); * const exampleIntegration = new aws.apigatewayv2.Integration("example", { * apiId: example.id, * integrationType: "HTTP_PROXY", * integrationMethod: "ANY", * integrationUri: "https://example.com/{proxy}", * }); * const exampleRoute = new aws.apigatewayv2.Route("example", { * apiId: example.id, * routeKey: "ANY /example/{proxy+}", * target: pulumi.interpolate`integrations/${exampleIntegration.id}`, * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * * `apiId` (String) API identifier. * * `id` (String) Route identifier. * * #### Optional * * * `accountId` (String) AWS Account where this resource is managed. * * `region` (String) Region where this resource is managed. * * Using `pulumi import`, import `aws.apigatewayv2.Route` using `apiId` and `id` (route identifier), delimited by a `/`. For example: * * ```sh * $ pulumi import aws:apigatewayv2/route:Route example aabbccddee/1122334 * ``` * * > **Note:** The API Gateway managed route created as part of [*quick_create*](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-basic-concept.html#apigateway-definition-quick-create) cannot be imported. */ export declare class Route extends pulumi.CustomResource { /** * Get an existing Route resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: RouteState, opts?: pulumi.CustomResourceOptions): Route; /** * Returns true if the given object is an instance of Route. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Route; /** * API identifier. */ readonly apiId: pulumi.Output; /** * Whether an API key is required for the route. Defaults to `false`. Supported only for WebSocket APIs. */ readonly apiKeyRequired: pulumi.Output; /** * Authorization scopes supported by this route. The scopes are used with a JWT authorizer to authorize the method invocation. */ readonly authorizationScopes: pulumi.Output; /** * 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`. */ readonly authorizationType: pulumi.Output; /** * Identifier of the `aws.apigatewayv2.Authorizer` resource to be associated with this route. */ readonly authorizerId: pulumi.Output; /** * [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. Supported only for WebSocket APIs. */ readonly modelSelectionExpression: pulumi.Output; /** * Operation name for the route. Must be between 1 and 64 characters in length. */ readonly operationName: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; /** * Request models for the route. Supported only for WebSocket APIs. */ readonly requestModels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Request parameters for the route. Supported only for WebSocket APIs. See `requestParameter` Block below. */ readonly requestParameters: pulumi.Output; /** * 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`. */ readonly routeKey: pulumi.Output; /** * [Route response selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-response-selection-expressions) for the route. Supported only for WebSocket APIs. */ readonly routeResponseSelectionExpression: pulumi.Output; /** * Target for the route, of the form `integrations/`*`IntegrationID`*, where *`IntegrationID`* is the identifier of an `aws.apigatewayv2.Integration` resource. */ readonly target: pulumi.Output; /** * Create a Route resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: RouteArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Route resources. */ export interface RouteState { /** * API identifier. */ apiId?: pulumi.Input; /** * Whether an API key is required for the route. Defaults to `false`. Supported only for WebSocket APIs. */ apiKeyRequired?: pulumi.Input; /** * Authorization scopes supported by this route. The scopes are used with a JWT authorizer to authorize the method invocation. */ authorizationScopes?: pulumi.Input[] | undefined>; /** * 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`. */ authorizationType?: pulumi.Input; /** * Identifier of the `aws.apigatewayv2.Authorizer` resource to be associated with this route. */ authorizerId?: pulumi.Input; /** * [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. Supported only for WebSocket APIs. */ modelSelectionExpression?: pulumi.Input; /** * Operation name for the route. Must be between 1 and 64 characters in length. */ operationName?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * Request models for the route. Supported only for WebSocket APIs. */ requestModels?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Request parameters for the route. Supported only for WebSocket APIs. See `requestParameter` Block below. */ requestParameters?: pulumi.Input[] | undefined>; /** * 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`. */ routeKey?: pulumi.Input; /** * [Route response selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-response-selection-expressions) for the route. Supported only for WebSocket APIs. */ routeResponseSelectionExpression?: pulumi.Input; /** * Target for the route, of the form `integrations/`*`IntegrationID`*, where *`IntegrationID`* is the identifier of an `aws.apigatewayv2.Integration` resource. */ target?: pulumi.Input; } /** * The set of arguments for constructing a Route resource. */ export interface RouteArgs { /** * API identifier. */ apiId: pulumi.Input; /** * Whether an API key is required for the route. Defaults to `false`. Supported only for WebSocket APIs. */ apiKeyRequired?: pulumi.Input; /** * Authorization scopes supported by this route. The scopes are used with a JWT authorizer to authorize the method invocation. */ authorizationScopes?: pulumi.Input[] | undefined>; /** * 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`. */ authorizationType?: pulumi.Input; /** * Identifier of the `aws.apigatewayv2.Authorizer` resource to be associated with this route. */ authorizerId?: pulumi.Input; /** * [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. Supported only for WebSocket APIs. */ modelSelectionExpression?: pulumi.Input; /** * Operation name for the route. Must be between 1 and 64 characters in length. */ operationName?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * Request models for the route. Supported only for WebSocket APIs. */ requestModels?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Request parameters for the route. Supported only for WebSocket APIs. See `requestParameter` Block below. */ requestParameters?: pulumi.Input[] | undefined>; /** * 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`. */ routeKey: pulumi.Input; /** * [Route response selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-response-selection-expressions) for the route. Supported only for WebSocket APIs. */ routeResponseSelectionExpression?: pulumi.Input; /** * Target for the route, of the form `integrations/`*`IntegrationID`*, where *`IntegrationID`* is the identifier of an `aws.apigatewayv2.Integration` resource. */ target?: pulumi.Input; } //# sourceMappingURL=route.d.ts.map