Skip to content

Instantly share code, notes, and snippets.

@mxro
Created October 20, 2022 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxro/e33db61e3cb82a394dde6fd2f0e48abf to your computer and use it in GitHub Desktop.
Save mxro/e33db61e3cb82a394dde6fd2f0e48abf to your computer and use it in GitHub Desktop.
lambda.tf
resource "aws_lambda_function" "this" {
for_each = var.lambdas
function_name = lookup(each.value, "function_name", null)
filename = data.archive_file.empty_lambda.output_path
handler = "lambda.handler"
runtime = "nodejs16.x"
memory_size = 2048
timeout = 27 # default Gateway timeout is 29 s
role = aws_iam_role.lambda_exec.arn
lifecycle {
ignore_changes = [
filename,
]
}
environment {
variables = {
GOLDSTACK_DEPLOYMENT = var.name
CORS = var.cors
NODE_OPTIONS = "--enable-source-maps"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment