I am trying to deploy a HTTP API via terraform and I keep getting an issue with my JWT Authorizer. I can't seem to figure out what is wrong with my code. I have looked through documentation but still can't seem to understand what I am doing wrong.
authorizer.tf
resource "aws_apigatewayv2_authorizer" "jwt_authorizer_bulk_import_s3" {
api_id = aws_apigatewayv2_api.main.id
authorizer_type = "JWT"
identity_sources = ["$request.header.Authorization"]
name = "jwt-authorizer"
jwt_configuration {
audience = ["removed for now"]
issuer = "removed for now"
}
}
resource "aws_apigatewayv2_integration" "bulk_import_s3" {
api_id = aws_apigatewayv2_api.main.id
integration_type = "AWS_PROXY"
connection_type = "INTERNET"
description = "Processing Data lambda."
integration_method = "POST"
integration_uri = lookup(var.process_to_s3, "invoke_arn")
}
resource "aws_apigatewayv2_route" "process_to_s3" {
api_id = aws_apigatewayv2_api.main.id
route_key = "POST /process_to_s3/{proxy+}"
authorization_type = "JWT"
target = "integrations/${aws_apigatewayv2_integration.bulk_import_s3.id}"
}