AuthorizerArgs

data class AuthorizerArgs(val apiId: Output<String>? = null, val authorizerCredentialsArn: Output<String>? = null, val authorizerPayloadFormatVersion: Output<String>? = null, val authorizerResultTtlInSeconds: Output<Int>? = null, val authorizerType: Output<String>? = null, val authorizerUri: Output<String>? = null, val enableSimpleResponses: Output<Boolean>? = null, val identitySources: Output<List<String>>? = null, val jwtConfiguration: Output<AuthorizerJwtConfigurationArgs>? = null, val name: Output<String>? = null) : ConvertibleToJava<AuthorizerArgs>

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

Example Usage

Basic WebSocket API

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigatewayv2.Authorizer;
import com.pulumi.aws.apigatewayv2.AuthorizerArgs;
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 Authorizer("example", AuthorizerArgs.builder()
.apiId(aws_apigatewayv2_api.example().id())
.authorizerType("REQUEST")
.authorizerUri(aws_lambda_function.example().invoke_arn())
.identitySources("route.request.header.Auth")
.build());
}
}

Basic HTTP API

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigatewayv2.Authorizer;
import com.pulumi.aws.apigatewayv2.AuthorizerArgs;
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 Authorizer("example", AuthorizerArgs.builder()
.apiId(aws_apigatewayv2_api.example().id())
.authorizerType("REQUEST")
.authorizerUri(aws_lambda_function.example().invoke_arn())
.identitySources("$request.header.Authorization")
.authorizerPayloadFormatVersion("2.0")
.build());
}
}

Import

aws_apigatewayv2_authorizer can be imported by using the API identifier and authorizer identifier, e.g.,

$ pulumi import aws:apigatewayv2/authorizer:Authorizer example aabbccddee/1122334

Constructors

Link copied to clipboard
constructor(apiId: Output<String>? = null, authorizerCredentialsArn: Output<String>? = null, authorizerPayloadFormatVersion: Output<String>? = null, authorizerResultTtlInSeconds: Output<Int>? = null, authorizerType: Output<String>? = null, authorizerUri: Output<String>? = null, enableSimpleResponses: Output<Boolean>? = null, identitySources: Output<List<String>>? = null, jwtConfiguration: Output<AuthorizerJwtConfigurationArgs>? = null, name: Output<String>? = null)

Properties

Link copied to clipboard
val apiId: Output<String>? = null

API identifier.

Link copied to clipboard
val authorizerCredentialsArn: Output<String>? = null

Required credentials as an IAM role for API Gateway to invoke the authorizer. Supported only for REQUEST authorizers.

Link copied to clipboard

Format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. Valid values: 1.0, 2.0.

Link copied to clipboard
val authorizerResultTtlInSeconds: Output<Int>? = null

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.

Link copied to clipboard
val authorizerType: Output<String>? = null

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.

Link copied to clipboard
val authorizerUri: Output<String>? = null

Authorizer's Uniform Resource Identifier (URI). For REQUEST authorizers this must be a well-formed Lambda function URI, such as the invoke_arn attribute of the aws.lambda.Function resource. Supported only for REQUEST authorizers. Must be between 1 and 2048 characters in length.

Link copied to clipboard
val enableSimpleResponses: Output<Boolean>? = null

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.

Link copied to clipboard
val identitySources: Output<List<String>>? = null

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.

Link copied to clipboard

Configuration of a JWT authorizer. Required for the JWT authorizer type. Supported only for HTTP APIs.

Link copied to clipboard
val name: Output<String>? = null

Name of the authorizer. Must be between 1 and 128 characters in length.

Functions

Link copied to clipboard
open override fun toJava(): AuthorizerArgs