Skip to content

Instantly share code, notes, and snippets.

@nhammad
Last active March 31, 2022 17:46
Show Gist options
  • Save nhammad/a65975857448fa92d7114644339bd702 to your computer and use it in GitHub Desktop.
Save nhammad/a65975857448fa92d7114644339bd702 to your computer and use it in GitHub Desktop.
data "archive_file" "lambda_zip" {
type = "zip"
source_file = "${path.module}/src/conversion_lambda_python_file.py"
output_file_mode = "0666"
output_path = "${path.module}/bin/conversion_lambda_python_file.zip"
}
resource "aws_lambda_function" "conversion_lambda" {
runtime = "python3.9"
filename = data.archive_file.lambda_zip.output_path
function_name = local.lambda_name
handler = "conversion_lambda_python_file.lambda_handler"
source_code_hash = data.archive_file.lambda_zip.output_base64sha256
role = aws_iam_role.lambda_role.arn
memory_size = 10240
timeout = 900
environment {
variables = {
incoming_bucket_arn = aws_s3_bucket.incoming.arn
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment