Skip to content

Instantly share code, notes, and snippets.

@nivleshc
Created March 26, 2025 23:57
Show Gist options
  • Save nivleshc/4e50dd9f7932e0483f6d707abe01abd8 to your computer and use it in GitHub Desktop.
Save nivleshc/4e50dd9f7932e0483f6d707abe01abd8 to your computer and use it in GitHub Desktop.
This gist contains code from the file lambda.tf which is part of the blog-photo-location-map repository.
resource "aws_lambda_function" "fetch_object_lambda" {
filename = data.archive_file.fetch_object_lambda_src.output_path
function_name = "${local.lambda_function_name_prefix}-fetch-object-lambda"
timeout = local.lambda_function_timeout
role = aws_iam_role.lambda_role.arn
handler = "fetch-object-lambda.lambda_handler"
source_code_hash = data.archive_file.fetch_object_lambda_src.output_base64sha256
runtime = local.lambda_runtime
layers = [aws_lambda_layer_version.photo_location_map_layer.arn]
environment {
variables = {
BUCKET_NAME = local.website_s3_bucket_name
COGNITO_POOL_ID = aws_cognito_user_pool.user_pool.id
COGNITO_REGION = local.region
}
}
depends_on = [
aws_cloudwatch_log_group.fetch_object_lambda_loggroup
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment