resource "aws_lambda_function" "this" {
  function_name    = var.name
  role             = var.role_arn
  package_type     = "Zip"
  # filename         = var.filename
  source_code_hash = var.source_code_hash
  handler          = var.handler
  runtime          = var.runtime
  timeout          = var.timeout
  memory_size      = var.memory_size
  publish          = true

  s3_bucket        = var.s3_bucket
  s3_key           = var.s3_key

  environment {
    variables = var.environment
  }
}

output "lambda_arn" {
  value = aws_lambda_function.this.arn
}

output "function_name" {
  value = aws_lambda_function.this.function_name
}
