Using the Terraform provider hashicorp/aws
, I have provisioned an API gateway (aws_apigatewayv2_api
) that uses an authorizer Lambda function (aws_apigatewayv2_authorizer
). I also have a Lambda layer (aws_lambda_layer_version
) that contains reusable code.
resource "aws_apigatewayv2_api" "api_gw" { /* ... */ }
resource "aws_apigatewayv2_authorizer" "api_auth" {
api_id = aws_apigatewayv2_api.api_gw.id
/* ... */
}
resource "aws_lambda_layer_version" "lib_layer" { /* ... */ }
How can I attach the Lambda layer lib_layer
to the authorizer api_auth
? I don’t see aws_apigatewayv2_authorizer
having the same option as aws_lambda_function.layers
. All I konw is that it’s possible to attach a Lambda layer to an authorizer Lambda function through the AWS Lambda console.