-
-
Save KyMidd/4458bdd909ccf60bfa92c02ef9e0504b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Zip up lambda when it changes | |
| data "archive_file" "lambda" { | |
| type = "zip" | |
| source_file = "lambda.js" | |
| output_path = "lambda.zip" | |
| } | |
| resource "aws_lambda_function" "lambda_function" { | |
| filename = "lambda.zip" | |
| function_name = "HttpHeaderShim" | |
| role = aws_iam_role.lambda_role.arn | |
| handler = "lambda.handler" | |
| # Publishes new versions on source update, required for Lambda@Edge with CloudFront | |
| publish = true | |
| # Hash the source file, if it changes, lambda will be updated | |
| source_code_hash = data.archive_file.lambda.output_base64sha256 | |
| runtime = "nodejs12.x" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment