Skip to content

Instantly share code, notes, and snippets.

@wenqiglantz
Created May 13, 2023 04:35
Show Gist options
  • Select an option

  • Save wenqiglantz/8548f2ce6509b5faf35e353d92372f4a to your computer and use it in GitHub Desktop.

Select an option

Save wenqiglantz/8548f2ce6509b5faf35e353d92372f4a to your computer and use it in GitHub Desktop.
resource "aws_lambda_function" "lambda_function" {
function_name = var.lambda_function.function_name
runtime = var.lambda_function.runtime
handler = var.lambda_function.handler
memory_size = var.lambda_function.memory_size
timeout = var.lambda_function.timeout
filename = data.archive_file.lambda_zip.output_path
role = aws_iam_role.lambda.arn
tracing_config {
mode = "Active"
}
ephemeral_storage {
size = var.lambda_function.ephemeral_storage
}
publish = true
snap_start {
apply_on = "PublishedVersions"
}
environment {
variables = {
SPRING_CLOUD_FUNCTION_DEFINITION = var.lambda_function.function_name_variable
API_KEY = var.api_key
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment