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 authorizer. * 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 WebSocket API * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.apigatewayv2.Authorizer("example", { * apiId: exampleAwsApigatewayv2Api.id, * authorizerType: "REQUEST", * authorizerUri: exampleAwsLambdaFunction.invokeArn, * identitySources: ["route.request.header.Auth"], * name: "example-authorizer", * }); * ``` * * ### Basic HTTP API * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.apigatewayv2.Authorizer("example", { * apiId: exampleAwsApigatewayv2Api.id, * authorizerType: "REQUEST", * authorizerUri: exampleAwsLambdaFunction.invokeArn, * identitySources: ["$request.header.Authorization"], * name: "example-authorizer", * authorizerPayloadFormatVersion: "2.0", * }); * ``` * * ## Import * * Using `pulumi import`, import `aws.apigatewayv2.Authorizer` using the API identifier and authorizer identifier. For example: * * ```sh * $ pulumi import aws:apigatewayv2/authorizer:Authorizer example aabbccddee/1122334 * ``` */ export declare class Authorizer extends pulumi.CustomResource { /** * Get an existing Authorizer 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?: AuthorizerState, opts?: pulumi.CustomResourceOptions): Authorizer; /** * Returns true if the given object is an instance of Authorizer. 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 Authorizer; /** * API identifier. */ readonly apiId: pulumi.Output; /** * Required credentials as an IAM role for API Gateway to invoke the authorizer. Supported only for `REQUEST` authorizers. */ readonly authorizerCredentialsArn: pulumi.Output; /** * Format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. Valid values: `1.0`, `2.0`. */ readonly authorizerPayloadFormatVersion: pulumi.Output; /** * Time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Defaults to `300`. Supported only for HTTP API Lambda authorizers. */ readonly authorizerResultTtlInSeconds: pulumi.Output; /** * Authorizer type. Valid values: `JWT`, `REQUEST`. Specify `REQUEST` for a Lambda function using incoming request parameters. For HTTP APIs, specify `JWT` to use JSON Web Tokens. */ readonly authorizerType: pulumi.Output; /** * Authorizer's URI. For `REQUEST` authorizers this must be a well-formed Lambda function URI, such as the `invokeArn` attribute of the `aws.lambda.Function` resource. Supported only for `REQUEST` authorizers. Must be between 1 and 2048 characters in length. */ readonly authorizerUri: pulumi.Output; /** * Whether a Lambda authorizer returns a response in a simple format. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. Supported only for HTTP APIs. */ readonly enableSimpleResponses: pulumi.Output; /** * Identity sources for which authorization is requested. For `REQUEST` authorizers the value is a list of one or more mapping expressions of the specified request parameters. For `JWT` authorizers the single entry specifies where to extract the JSON Web Token (JWT) from inbound requests. */ readonly identitySources: pulumi.Output; /** * Configuration of a JWT authorizer. Required for the `JWT` authorizer type. Supported only for HTTP APIs. See `jwtConfiguration` Block below. */ readonly jwtConfiguration: pulumi.Output; /** * Name of the authorizer. Must be between 1 and 128 characters in length. */ readonly name: 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; /** * Create a Authorizer 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: AuthorizerArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Authorizer resources. */ export interface AuthorizerState { /** * API identifier. */ apiId?: pulumi.Input; /** * Required credentials as an IAM role for API Gateway to invoke the authorizer. Supported only for `REQUEST` authorizers. */ authorizerCredentialsArn?: pulumi.Input; /** * Format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. Valid values: `1.0`, `2.0`. */ authorizerPayloadFormatVersion?: pulumi.Input; /** * Time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Defaults to `300`. Supported only for HTTP API Lambda authorizers. */ authorizerResultTtlInSeconds?: pulumi.Input; /** * Authorizer type. Valid values: `JWT`, `REQUEST`. Specify `REQUEST` for a Lambda function using incoming request parameters. For HTTP APIs, specify `JWT` to use JSON Web Tokens. */ authorizerType?: pulumi.Input; /** * Authorizer's URI. For `REQUEST` authorizers this must be a well-formed Lambda function URI, such as the `invokeArn` attribute of the `aws.lambda.Function` resource. Supported only for `REQUEST` authorizers. Must be between 1 and 2048 characters in length. */ authorizerUri?: pulumi.Input; /** * Whether a Lambda authorizer returns a response in a simple format. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. Supported only for HTTP APIs. */ enableSimpleResponses?: pulumi.Input; /** * Identity sources for which authorization is requested. For `REQUEST` authorizers the value is a list of one or more mapping expressions of the specified request parameters. For `JWT` authorizers the single entry specifies where to extract the JSON Web Token (JWT) from inbound requests. */ identitySources?: pulumi.Input[] | undefined>; /** * Configuration of a JWT authorizer. Required for the `JWT` authorizer type. Supported only for HTTP APIs. See `jwtConfiguration` Block below. */ jwtConfiguration?: pulumi.Input; /** * Name of the authorizer. Must be between 1 and 128 characters in length. */ name?: 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; } /** * The set of arguments for constructing a Authorizer resource. */ export interface AuthorizerArgs { /** * API identifier. */ apiId: pulumi.Input; /** * Required credentials as an IAM role for API Gateway to invoke the authorizer. Supported only for `REQUEST` authorizers. */ authorizerCredentialsArn?: pulumi.Input; /** * Format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. Valid values: `1.0`, `2.0`. */ authorizerPayloadFormatVersion?: pulumi.Input; /** * Time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Defaults to `300`. Supported only for HTTP API Lambda authorizers. */ authorizerResultTtlInSeconds?: pulumi.Input; /** * Authorizer type. Valid values: `JWT`, `REQUEST`. Specify `REQUEST` for a Lambda function using incoming request parameters. For HTTP APIs, specify `JWT` to use JSON Web Tokens. */ authorizerType: pulumi.Input; /** * Authorizer's URI. For `REQUEST` authorizers this must be a well-formed Lambda function URI, such as the `invokeArn` attribute of the `aws.lambda.Function` resource. Supported only for `REQUEST` authorizers. Must be between 1 and 2048 characters in length. */ authorizerUri?: pulumi.Input; /** * Whether a Lambda authorizer returns a response in a simple format. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. Supported only for HTTP APIs. */ enableSimpleResponses?: pulumi.Input; /** * Identity sources for which authorization is requested. For `REQUEST` authorizers the value is a list of one or more mapping expressions of the specified request parameters. For `JWT` authorizers the single entry specifies where to extract the JSON Web Token (JWT) from inbound requests. */ identitySources?: pulumi.Input[] | undefined>; /** * Configuration of a JWT authorizer. Required for the `JWT` authorizer type. Supported only for HTTP APIs. See `jwtConfiguration` Block below. */ jwtConfiguration?: pulumi.Input; /** * Name of the authorizer. Must be between 1 and 128 characters in length. */ name?: 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; } //# sourceMappingURL=authorizer.d.ts.map