Sets up an HTTP API authorizer with payload format version 2.0, using Amazon API Gateway Version 2 connected to a Lambda function.

Terraform Template

resource "aws_apigatewayv2_authorizer" "example" {
  api_id = "aws_apigatewayv2_api.example.id"
  authorizer_payload_format_version = "2.0"
  authorizer_type = "REQUEST"
  authorizer_uri = "aws_lambda_function.example.invoke_arn"
  identity_sources = ["$request.header.Authorization"]
  name = "example-authorizer"
}