function_name
Name of the Lambda function
The name of the Lambda function. Matches the input function_name.
Example Value
my-api-handler
Common Use Cases
CloudWatch Log Group
resource "aws_cloudwatch_log_group" "custom" {
name = "/aws/lambda/${module.my_function.function_name}"
retention_in_days = 14
}
Lambda Permission
resource "aws_lambda_permission" "api_gateway" {
statement_id = "AllowAPIGateway"
action = "lambda:InvokeFunction"
function_name = module.my_function.function_name
principal = "apigateway.amazonaws.com"
}
Usage
module "lambda_function" {
source = "registry.patterneddesigns.ca/patterneddesigns/lambda-function/aws"
version = "0.1.0"
# ... inputs
}
# Access this output
output "function_name" {
value = module.lambda_function.function_name
}