Skip to content

Instantly share code, notes, and snippets.

@nivleshc
Created March 27, 2025 00:02
Show Gist options
  • Save nivleshc/2603c459165045cb0ba591924a5a84f5 to your computer and use it in GitHub Desktop.
Save nivleshc/2603c459165045cb0ba591924a5a84f5 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" "regenerate_map_lambda" {
filename = data.archive_file.regenerate_map_lambda_src.output_path
function_name = "${local.lambda_function_name_prefix}-regenerate-map-lambda"
timeout = local.lambda_function_timeout
role = aws_iam_role.lambda_role.arn
handler = "regenerate-map-lambda.lambda_handler"
source_code_hash = data.archive_file.regenerate_map_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
CSV_FILE_KEY = local.csv_file_key
PHOTO_LOCATION_MAP_FILENAME = local.photo_location_map_filename
}
}
depends_on = [
aws_cloudwatch_log_group.regenerate_map_lambda_loggroup
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment